|
@@ -48,8 +48,7 @@ namespace PP_Ven_MosS.Pages
|
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
- ApplicationList.ItemsSource = DB.Applications.ToList().Where(x => x.Id_employee == user.Id_user);
|
|
|
- Applications appl = DB.Applications.Where(x => x.Id_status_app == id).FirstOrDefault();
|
|
|
+ ApplicationList.ItemsSource = DB.Applications.Where(x => x.Id_employee == UserID.userid).ToList();
|
|
|
CB_Filter_app.ItemsSource = new List<string> { "Фильтр по статусу", "Выполнен", "Не выполнен" };
|
|
|
CB_Sort_app.ItemsSource = new List<string>() { "Фильтр по дате","Не сегодня", "Сегодня" };
|
|
|
CB_Sort_app.SelectedIndex = 0;
|
|
@@ -65,8 +64,7 @@ namespace PP_Ven_MosS.Pages
|
|
|
public ApplicationsListAdmin(int id)
|
|
|
{
|
|
|
InitializeComponent();
|
|
|
- ApplicationList.ItemsSource = DB.Applications.ToList();
|
|
|
- Applications appl = DB.Applications.Where(x => x.Id_application == id).FirstOrDefault();
|
|
|
+ ApplicationList.ItemsSource = DB.Applications.Where(x => x.Id_employee == UserID.userid).ToList();
|
|
|
CB_Filter_app.ItemsSource = DB.Applications.ToList() ;
|
|
|
CB_Sort_app.ItemsSource = DB.Applications.ToList() ;
|
|
|
CB_Sort_app.SelectedIndex = 0;
|
|
@@ -85,7 +83,7 @@ namespace PP_Ven_MosS.Pages
|
|
|
{
|
|
|
CheckBox cb = (CheckBox)sender;
|
|
|
int id = Convert.ToInt32(cb.Uid);
|
|
|
- Applications applications = Classes.Database.entities.Applications.FirstOrDefault(x => x.Id_application == id);
|
|
|
+ Applications applications = Classes.Database.entities.Applications.Where(x => x.Id_employee == UserID.userid).FirstOrDefault();
|
|
|
applications.Id_status_app = 1;
|
|
|
user.Count_complete_app++;
|
|
|
Classes.Database.entities.SaveChanges();
|
|
@@ -103,7 +101,7 @@ namespace PP_Ven_MosS.Pages
|
|
|
}
|
|
|
private void Filter()
|
|
|
{
|
|
|
- List<Applications> applications = DB.Applications.ToList();
|
|
|
+ List<Applications> applications = DB.Applications.Where(x => x.Id_employee == UserID.userid).ToList();
|
|
|
if (CB_Sort_app.SelectedIndex != 0)
|
|
|
{
|
|
|
switch (CB_Sort_app.SelectedIndex)
|