|
@@ -3,18 +3,8 @@ using PP_Ven_MosS.ModelBase;
|
|
using System;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Linq;
|
|
-using System.Net;
|
|
|
|
-using System.Text;
|
|
|
|
-using System.Threading.Tasks;
|
|
|
|
using System.Windows;
|
|
using System.Windows;
|
|
using System.Windows.Controls;
|
|
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;
|
|
|
|
|
|
|
|
namespace PP_Ven_MosS.Pages
|
|
namespace PP_Ven_MosS.Pages
|
|
{
|
|
{
|
|
@@ -61,7 +51,10 @@ namespace PP_Ven_MosS.Pages
|
|
}
|
|
}
|
|
private void Report_Click(object sender, RoutedEventArgs e)
|
|
private void Report_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
{
|
|
- FrameClass.MainFrame.Navigate(new ReportForEvent());
|
|
|
|
|
|
+ Button btn = (Button)sender;
|
|
|
|
+ Event evn = DB.Event.FirstOrDefault(x => x.Id_event.ToString() == btn.Uid);
|
|
|
|
+ if (evn != null)
|
|
|
|
+ FrameClass.MainFrame.Navigate(new ReportForEvent(evn));
|
|
}
|
|
}
|
|
|
|
|
|
private void CBEmpl_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
private void CBEmpl_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
@@ -70,7 +63,8 @@ namespace PP_Ven_MosS.Pages
|
|
ComboBox cb = (ComboBox)sender;
|
|
ComboBox cb = (ComboBox)sender;
|
|
cb.DisplayMemberPath = "Surname";
|
|
cb.DisplayMemberPath = "Surname";
|
|
cb.SelectedValuePath = "Id_user";
|
|
cb.SelectedValuePath = "Id_user";
|
|
- if(cb.Uid != null) {
|
|
|
|
|
|
+ if (cb.Uid != null)
|
|
|
|
+ {
|
|
int appId = int.Parse(cb.Uid);
|
|
int appId = int.Parse(cb.Uid);
|
|
Applications ap = DB.Applications.FirstOrDefault(x => x.Id_application == appId);
|
|
Applications ap = DB.Applications.FirstOrDefault(x => x.Id_application == appId);
|
|
if (cb.SelectedItem != null)
|
|
if (cb.SelectedItem != null)
|
|
@@ -81,7 +75,7 @@ namespace PP_Ven_MosS.Pages
|
|
DB.SaveChanges();
|
|
DB.SaveChanges();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -94,6 +88,22 @@ namespace PP_Ven_MosS.Pages
|
|
{
|
|
{
|
|
FrameClass.MainFrame.Navigate(new Diagram());
|
|
FrameClass.MainFrame.Navigate(new Diagram());
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ private void DeleteBtn_Click(object sender, RoutedEventArgs e)
|
|
|
|
+ {
|
|
|
|
+ Button btn = (Button)sender;
|
|
|
|
+ Event evn = Database.entities.Event.FirstOrDefault(x => x.Id_event.ToString() == btn.Uid);
|
|
|
|
+ MessageBoxResult mr = MessageBox.Show("Точно ли вы хотите удалить эту запись?", "Удаление", MessageBoxButton.YesNo, MessageBoxImage.Question);
|
|
|
|
+ switch (mr)
|
|
|
|
+ {
|
|
|
|
+ case MessageBoxResult.Yes:
|
|
|
|
+ Database.entities.Event.Remove(evn);
|
|
|
|
+ Database.entities.SaveChanges(); break;
|
|
|
|
+ case MessageBoxResult.No:
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ EventList.ItemsSource = Database.entities.Event.ToList();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
public partial class MenuAdmin : Page
|
|
public partial class MenuAdmin : Page
|
|
{
|
|
{
|
|
@@ -103,15 +113,15 @@ namespace PP_Ven_MosS.Pages
|
|
{
|
|
{
|
|
|
|
|
|
InitializeComponent();
|
|
InitializeComponent();
|
|
-
|
|
|
|
|
|
+
|
|
ApplicationList.ItemsSource = DB.Applications.ToList();
|
|
ApplicationList.ItemsSource = DB.Applications.ToList();
|
|
Applications appl = DB.Applications.Where(x => x.Id_status_app == id).FirstOrDefault();
|
|
Applications appl = DB.Applications.Where(x => x.Id_status_app == id).FirstOrDefault();
|
|
CB_Filter_app.ItemsSource = new List<string> { "Фильтр по статусу", "Выполнен", "Не выполнен" };
|
|
CB_Filter_app.ItemsSource = new List<string> { "Фильтр по статусу", "Выполнен", "Не выполнен" };
|
|
CB_Sort_app.ItemsSource = new List<string>() { "Фильтр по дате", "Не сегодня", "Сегодня" };
|
|
CB_Sort_app.ItemsSource = new List<string>() { "Фильтр по дате", "Не сегодня", "Сегодня" };
|
|
CB_Sort_app.SelectedIndex = 0;
|
|
CB_Sort_app.SelectedIndex = 0;
|
|
CB_Filter_app.SelectedIndex = 0;
|
|
CB_Filter_app.SelectedIndex = 0;
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
EventList.ItemsSource = DB.Event.ToList();
|
|
EventList.ItemsSource = DB.Event.ToList();
|
|
Event evnt = DB.Event.Where(x => x.Id_event == id).FirstOrDefault();
|
|
Event evnt = DB.Event.Where(x => x.Id_event == id).FirstOrDefault();
|
|
CB_Filter_event.ItemsSource = new List<string>() { "Фильтр по статусу", "Проведено", "Не проведено" };
|
|
CB_Filter_event.ItemsSource = new List<string>() { "Фильтр по статусу", "Проведено", "Не проведено" };
|
|
@@ -119,7 +129,7 @@ namespace PP_Ven_MosS.Pages
|
|
CB_Sort_event.SelectedIndex = 0;
|
|
CB_Sort_event.SelectedIndex = 0;
|
|
CB_Filter_event.SelectedIndex = 0;
|
|
CB_Filter_event.SelectedIndex = 0;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
public MenuAdmin(int id)
|
|
public MenuAdmin(int id)
|
|
{
|
|
{
|
|
InitializeComponent();
|
|
InitializeComponent();
|
|
@@ -129,7 +139,7 @@ namespace PP_Ven_MosS.Pages
|
|
CB_Sort_app.ItemsSource = DB.Applications.ToList();
|
|
CB_Sort_app.ItemsSource = DB.Applications.ToList();
|
|
CB_Sort_app.SelectedIndex = 0;
|
|
CB_Sort_app.SelectedIndex = 0;
|
|
CB_Filter_app.SelectedIndex = 0;
|
|
CB_Filter_app.SelectedIndex = 0;
|
|
-
|
|
|
|
|
|
+
|
|
|
|
|
|
this.id = id;
|
|
this.id = id;
|
|
|
|
|
|
@@ -141,7 +151,7 @@ namespace PP_Ven_MosS.Pages
|
|
CB_Filter_event.SelectedIndex = 0;
|
|
CB_Filter_event.SelectedIndex = 0;
|
|
this.id = id;
|
|
this.id = id;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
private void Filter()
|
|
private void Filter()
|
|
{
|
|
{
|
|
List<Applications> applications = DB.Applications.ToList();
|
|
List<Applications> applications = DB.Applications.ToList();
|