|
@@ -1,19 +1,11 @@
|
|
|
using Microsoft.Win32;
|
|
|
using System;
|
|
|
-using System.Collections.Generic;
|
|
|
using System.IO;
|
|
|
using System.Linq;
|
|
|
-using System.Text;
|
|
|
-using System.Threading.Tasks;
|
|
|
using System.Windows;
|
|
|
using System.Windows.Controls;
|
|
|
-using System.Windows.Data;
|
|
|
-using System.Windows.Documents;
|
|
|
using System.Windows.Input;
|
|
|
-using System.Windows.Media;
|
|
|
using System.Windows.Media.Imaging;
|
|
|
-using System.Windows.Navigation;
|
|
|
-using System.Windows.Shapes;
|
|
|
using Word = Microsoft.Office.Interop.Word;
|
|
|
|
|
|
namespace mateo
|
|
@@ -34,7 +26,7 @@ namespace mateo
|
|
|
string imageLoc;
|
|
|
OpenFileDialog dld = new OpenFileDialog();
|
|
|
dld.Filter = "JPG Files (*.jpg)|*.jpg|PNG Files (*.png)|*.png|JPEG Files (*.jpeg)|*.jpeg";
|
|
|
- if (dld.ShowDialog()==true)
|
|
|
+ if (dld.ShowDialog() == true)
|
|
|
{
|
|
|
imageLoc = dld.FileName;
|
|
|
imgProfile.Source = new BitmapImage(new Uri(imageLoc));
|
|
@@ -120,7 +112,7 @@ namespace mateo
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
MessageBox.Show(ex.ToString(), "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error);
|
|
|
- }
|
|
|
+ }
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
@@ -180,7 +172,7 @@ namespace mateo
|
|
|
summ = Summ(summ);
|
|
|
|
|
|
return tf;
|
|
|
- }
|
|
|
+ }
|
|
|
public bool TicketsPlus(int quantity)
|
|
|
{
|
|
|
bool tf = false;
|
|
@@ -210,7 +202,7 @@ namespace mateo
|
|
|
|
|
|
return quantity;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public int TicketsPlusInt(int quantity)
|
|
|
{
|
|
|
if (quantity == 30) MessageBox.Show("Превышено количество билетов", "Информация", MessageBoxButton.OK, MessageBoxImage.Information);
|
|
@@ -230,7 +222,8 @@ namespace mateo
|
|
|
|
|
|
public void Update() //функция для обновления информации о пользователе
|
|
|
{
|
|
|
- try {
|
|
|
+ try
|
|
|
+ {
|
|
|
//фио
|
|
|
var fio = DB.GetContext().Users.FirstOrDefault(x => x.IDUsers == DB.Iduser);
|
|
|
txtNameProfile.Text = fio.LastName + " " + fio.FirstName + " " + fio.MiddleName;
|
|
@@ -251,7 +244,7 @@ namespace mateo
|
|
|
//История платежей
|
|
|
datagridHistoryProfile.ItemsSource = DB.GetContext().History.Where(x => x.FKUser == DB.Iduser).ToList();
|
|
|
}
|
|
|
- catch(Exception ex)
|
|
|
+ catch (Exception ex)
|
|
|
{
|
|
|
MessageBox.Show(ex.ToString(), "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error);
|
|
|
}
|
|
@@ -265,14 +258,14 @@ namespace mateo
|
|
|
{
|
|
|
listAllAttraction.ItemsSource = DB.GetContext().Attraction.Where(x => x.FKStatusAttraction != 2).ToList();
|
|
|
}
|
|
|
- catch(Exception ex)
|
|
|
+ catch (Exception ex)
|
|
|
{
|
|
|
MessageBox.Show(ex.ToString(), "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error);
|
|
|
}
|
|
|
|
|
|
//Update();
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
#region раздел Услуги
|
|
|
private void btnUslugiClick(object sender, RoutedEventArgs e)
|
|
|
{
|
|
@@ -303,7 +296,7 @@ namespace mateo
|
|
|
if (attraction.PriceBaby == 0 || attraction.PriceBaby == null) stackPriceBaby.Visibility = Visibility.Hidden;
|
|
|
}
|
|
|
}
|
|
|
- catch(Exception ex)
|
|
|
+ catch (Exception ex)
|
|
|
{
|
|
|
MessageBox.Show(ex.ToString(), "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error);
|
|
|
}
|
|
@@ -354,18 +347,18 @@ namespace mateo
|
|
|
|
|
|
private void btnTickets(object sender, RoutedEventArgs e) //вывод добавленных билетов
|
|
|
{
|
|
|
- stackAttraction.Visibility = Visibility.Hidden;
|
|
|
- listAllAttraction.Visibility = Visibility.Hidden;
|
|
|
- gridProfile.Visibility = Visibility.Hidden;
|
|
|
- gridPlusBalance.Visibility = Visibility.Hidden;
|
|
|
- gridTickets.Visibility = Visibility.Visible;
|
|
|
+ stackAttraction.Visibility = Visibility.Hidden;
|
|
|
+ listAllAttraction.Visibility = Visibility.Hidden;
|
|
|
+ gridProfile.Visibility = Visibility.Hidden;
|
|
|
+ gridPlusBalance.Visibility = Visibility.Hidden;
|
|
|
+ gridTickets.Visibility = Visibility.Visible;
|
|
|
try
|
|
|
{
|
|
|
listTickets.ItemsSource = DB.GetContext().Tickets.Where(x => x.FKUser == DB.Iduser && x.FKStatusPuy == 2).ToList();
|
|
|
decimal summ = 0;
|
|
|
summ = Summ(summ);
|
|
|
}
|
|
|
- catch(Exception ex)
|
|
|
+ catch (Exception ex)
|
|
|
{
|
|
|
MessageBox.Show(ex.ToString(), "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error);
|
|
|
}
|
|
@@ -380,7 +373,7 @@ namespace mateo
|
|
|
TicketsMinus(tickets.Quantity);
|
|
|
}
|
|
|
}
|
|
|
- catch(Exception ex)
|
|
|
+ catch (Exception ex)
|
|
|
{
|
|
|
MessageBox.Show(ex.ToString(), "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error);
|
|
|
}
|
|
@@ -395,7 +388,7 @@ namespace mateo
|
|
|
TicketsPlus(tickets.Quantity);
|
|
|
}
|
|
|
}
|
|
|
- catch(Exception ex)
|
|
|
+ catch (Exception ex)
|
|
|
{
|
|
|
MessageBox.Show(ex.ToString(), "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error);
|
|
|
}
|
|
@@ -424,7 +417,7 @@ namespace mateo
|
|
|
else txtSumm.Text = String.Format("Сумма: {0:0,00}", summ);
|
|
|
}
|
|
|
}
|
|
|
- catch(Exception ex)
|
|
|
+ catch (Exception ex)
|
|
|
{
|
|
|
MessageBox.Show(ex.ToString(), "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error);
|
|
|
}
|
|
@@ -572,7 +565,7 @@ namespace mateo
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- catch(Exception ex)
|
|
|
+ catch (Exception ex)
|
|
|
{
|
|
|
MessageBox.Show(ex.ToString(), "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error);
|
|
|
}
|
|
@@ -605,7 +598,8 @@ namespace mateo
|
|
|
|
|
|
private void BtnDeletePhoto(object sender, RoutedEventArgs e) //удаление фото в тч из бд
|
|
|
{
|
|
|
- try {
|
|
|
+ try
|
|
|
+ {
|
|
|
var fio = DB.GetContext().Users.FirstOrDefault(x => x.IDUsers == DB.Iduser);
|
|
|
fio.Image = null;
|
|
|
DB.GetContext().SaveChanges();
|
|
@@ -613,7 +607,7 @@ namespace mateo
|
|
|
btnAddPhoto.Content = "добавить фото";
|
|
|
Update();
|
|
|
}
|
|
|
- catch(Exception ex)
|
|
|
+ catch (Exception ex)
|
|
|
{
|
|
|
MessageBox.Show(ex.ToString(), "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error);
|
|
|
}
|