|
@@ -3,6 +3,7 @@ using PP_Ven_MosS.ModelBase;
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
using System.Linq;
|
|
|
+using System.Net;
|
|
|
using System.Text;
|
|
|
using System.Threading.Tasks;
|
|
|
using System.Windows;
|
|
@@ -37,6 +38,20 @@ namespace PP_Ven_MosS.Pages
|
|
|
get { return apptype; }
|
|
|
set { apptype = value; }
|
|
|
}
|
|
|
+ private string employee;
|
|
|
+ public string Employee
|
|
|
+ {
|
|
|
+ get { return employee; }
|
|
|
+ set { employee = value; }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void CBEmpl_Loaded(object sender, RoutedEventArgs e)
|
|
|
+ {
|
|
|
+ ComboBox cb = (ComboBox)sender;
|
|
|
+ cb.ItemsSource = DB.User.ToList().Where(x => x.Id_role == 2);
|
|
|
+ cb.DisplayMemberPath = "Surname";
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
public partial class MenuAdmin : Page
|
|
|
{
|
|
@@ -46,23 +61,27 @@ namespace PP_Ven_MosS.Pages
|
|
|
{
|
|
|
|
|
|
InitializeComponent();
|
|
|
+
|
|
|
+
|
|
|
ApplicationList.ItemsSource = DB.Applications.ToList();
|
|
|
Applications appl = DB.Applications.Where(x => x.Id_status_app == id).FirstOrDefault();
|
|
|
CB_Filter_app.ItemsSource = new List<string> { "Фильтр по статусу", "Выполнен", "Не выполнен" };
|
|
|
CB_Sort_app.ItemsSource = new List<string>() { "Фильтр по дате", "Не сегодня", "Сегодня" };
|
|
|
CB_Sort_app.SelectedIndex = 0;
|
|
|
CB_Filter_app.SelectedIndex = 0;
|
|
|
+
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
EventList.ItemsSource = DB.Event.ToList();
|
|
|
Event evnt = DB.Event.Where(x => x.Id_event == id).FirstOrDefault();
|
|
|
CB_Filter_event.ItemsSource = new List<string>() { "Фильтр по статусу", "Проведено", "Не проведено" };
|
|
|
CB_Sort_event.ItemsSource = new List<string>() { "Фильтр по дате", "Не сегодня", "Сегодня" };
|
|
|
CB_Sort_event.SelectedIndex = 0;
|
|
|
CB_Filter_event.SelectedIndex = 0;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
+
|
|
|
public MenuAdmin(int id)
|
|
|
{
|
|
|
InitializeComponent();
|
|
@@ -72,6 +91,8 @@ namespace PP_Ven_MosS.Pages
|
|
|
CB_Sort_app.ItemsSource = DB.Applications.ToList();
|
|
|
CB_Sort_app.SelectedIndex = 0;
|
|
|
CB_Filter_app.SelectedIndex = 0;
|
|
|
+
|
|
|
+
|
|
|
this.id = id;
|
|
|
|
|
|
EventList.ItemsSource = DB.Event.ToList();
|
|
@@ -82,7 +103,7 @@ namespace PP_Ven_MosS.Pages
|
|
|
CB_Filter_event.SelectedIndex = 0;
|
|
|
this.id = id;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
private void Filter()
|
|
|
{
|
|
|
List<Applications> applications = DB.Applications.ToList();
|
|
@@ -91,10 +112,10 @@ namespace PP_Ven_MosS.Pages
|
|
|
switch (CB_Sort_app.SelectedIndex)
|
|
|
{
|
|
|
case 1:
|
|
|
- applications = applications.Where(x => x.Date_app.Day < DateTime.Today.Day).OrderBy(x => x.Date_app).ToList();
|
|
|
+ applications = applications.Where(x => x.Date_app < DateTime.Today).OrderBy(x => x.Date_app).ToList();
|
|
|
break;
|
|
|
case 2:
|
|
|
- applications = applications.Where(x => x.Date_app.Day == DateTime.Today.Day).OrderBy(x => x.Date_app).ToList();
|
|
|
+ applications = applications.Where(x => x.Date_app == DateTime.Today).OrderBy(x => x.Date_app).ToList();
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
@@ -122,10 +143,10 @@ namespace PP_Ven_MosS.Pages
|
|
|
switch (CB_Sort_event.SelectedIndex)
|
|
|
{
|
|
|
case 1:
|
|
|
- events = events.Where(x => x.Date_event.Day < DateTime.Today.Day).OrderBy(x => x.Date_event).ToList();
|
|
|
+ events = events.Where(x => x.Date_event < DateTime.Today).OrderBy(x => x.Date_event).ToList();
|
|
|
break;
|
|
|
case 2:
|
|
|
- events = events.Where(x => x.Date_event.Day == DateTime.Today.Day).OrderBy(x => x.Date_event).ToList();
|
|
|
+ events = events.Where(x => x.Date_event == DateTime.Today).OrderBy(x => x.Date_event).ToList();
|
|
|
break;
|
|
|
}
|
|
|
}
|