|
@@ -50,8 +50,35 @@ namespace PP_Ven_MosS.Pages
|
|
|
ComboBox cb = (ComboBox)sender;
|
|
|
cb.ItemsSource = DB.User.ToList().Where(x => x.Id_role == 2);
|
|
|
cb.DisplayMemberPath = "Surname";
|
|
|
+ cb.SelectedValuePath = "Id_user";
|
|
|
+ int appId = int.Parse(cb.Uid);
|
|
|
+ Applications ap = DB.Applications.FirstOrDefault(x => x.Id_application == appId);
|
|
|
+ if (ap.Id_employee != null)
|
|
|
+ {
|
|
|
+ cb.SelectedValue = Convert.ToInt32(ap.Id_employee);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+ private void CBEmpl_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
|
+ {
|
|
|
+ PP_MininEntities2 DB = new PP_MininEntities2();
|
|
|
+ ComboBox cb = (ComboBox)sender;
|
|
|
+ cb.DisplayMemberPath = "Surname";
|
|
|
+ cb.SelectedValuePath = "Id_user";
|
|
|
+ if(cb.Uid != null) {
|
|
|
+ int appId = int.Parse(cb.Uid);
|
|
|
+ Applications ap = DB.Applications.FirstOrDefault(x => x.Id_application == appId);
|
|
|
+ if (cb.SelectedItem != null)
|
|
|
+ {
|
|
|
+ if (ap != null)
|
|
|
+ {
|
|
|
+ ap.Id_employee = Convert.ToInt32(cb.SelectedValue);
|
|
|
+ DB.SaveChanges();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
public partial class MenuAdmin : Page
|
|
|
{
|
|
@@ -62,7 +89,6 @@ 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> { "Фильтр по статусу", "Выполнен", "Не выполнен" };
|
|
@@ -77,9 +103,6 @@ namespace PP_Ven_MosS.Pages
|
|
|
CB_Sort_event.ItemsSource = new List<string>() { "Фильтр по дате", "Не сегодня", "Сегодня" };
|
|
|
CB_Sort_event.SelectedIndex = 0;
|
|
|
CB_Filter_event.SelectedIndex = 0;
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
|
|
|
public MenuAdmin(int id)
|