private void Reload_Executed(object sender, ExecutedRoutedEventArgs e) { Context = new PaySysContext(); Context.ExpenseArticles.Load(); ExpenseArticles = Context.ExpenseArticles.Local; TreeViewExpenseArticles.GetBindingExpression(ItemsControl.ItemsSourceProperty)?.UpdateTarget(); TreeViewExpenseArticles.GetBindingExpression(DataContextProperty)?.UpdateTarget(); }
private void Reload_Executed(object sender, ExecutedRoutedEventArgs e) { var selectedId = (DataGridJobs.SelectedItem as Job)?.Id; Context = new PaySysContext(); Context.Jobs.Load(); Jobs = Context.Jobs.Local; DataGridJobs.GetBindingExpression(ItemsControl.ItemsSourceProperty).UpdateTarget(); if (selectedId.HasValue) { DataGridJobs.SelectedItem = Jobs.FirstOrDefault(Job => Job.Id == selectedId.Value); } }
private void Reload() { Context = new PaySysContext(); Context.MainGroups.Load(); DataContext = Context.MainGroups.Local; foreach (var control in GridMain.FindVisualChildren <UcTextPair>()) { control.UpdateTarget(); } Context.ContractFields.Load(); SmpUcContractFieldTitlesMng.ContractFieldsAll = Context.ContractFields.Local.ToList(); }
private void Reload(object sender, ExecutedRoutedEventArgs e) { DataGridSubGroups.SelectionChanged -= SmpUcSelectGroupAndSubGroup_OnSelectedSubGroupChanged; // var currentMgId = SmpUcSelectGroupAndSubGroup.SelectedMainGroup.Id; // var currentSgId = SmpUcSelectGroupAndSubGroup.SelectedSubGroup.Id; Context = new PaySysContext(); Context.MainGroups.Include(mg => mg.SubGroups).Load(); DataGridMainGroups.DataContext = Context.MainGroups.Local; // SmpUcSelectGroupAndSubGroup.SelectedMainGroupId = currentMgId; // SmpUcSelectGroupAndSubGroup.SelectedSubGroupId = currentSgId; LeftJoinAndAssignSubGroupMiscRecharges(); DataGridSubGroups.SelectionChanged += SmpUcSelectGroupAndSubGroup_OnSelectedSubGroupChanged; }
private void Reload_Executed(object sender, ExecutedRoutedEventArgs e) { var selectedId = (DataGridCities.SelectedItem as City)?.Id; Context = new PaySysContext(); Context.Cities.Load(); Cities = Context.Cities.Local; DataGridCities.GetBindingExpression(ItemsControl.ItemsSourceProperty)?.UpdateTarget(); DataGridCities.GetBindingExpression(DataContextProperty)?.UpdateTarget(); if (selectedId.HasValue) { DataGridCities.SelectedItem = Cities.FirstOrDefault(city => city.Id == selectedId.Value); } SmpUcLookup_OnLookupTextChanged(null, null); }
private void Reload(object sender, ExecutedRoutedEventArgs e) { DataGridSubGroups.SelectionChanged -= DataGridSubGroups_OnSelectionChanged; // var currentMg = (DataGridMainGroups.SelectedItem as MainGroup); // var currentSg = (DataGridSubGroups.SelectedItem as SubGroup); Context = new PaySysContext(); Context.MainGroups.Include(mg => mg.SubGroups).Load(); DataGridMainGroups.DataContext = Context.MainGroups.Local; // DataGridMainGroups.SelectedItem = currentMg??Context.MainGroups.Local.First(); // DataGridSubGroups.SelectedItem = currentSg?? (DataGridMainGroups.SelectedItem as MainGroup)?.SubGroups.First(); LeftJoinAndAssignSubGroupMonthlyData(); DataGridSubGroups.SelectionChanged += DataGridSubGroups_OnSelectionChanged; }
private void RefreshListView() { var selectedId = (DataGridMissions.SelectedItem as Mission)?.Id; Context = new PaySysContext(); Context.Missions.Load(); Context.Cities.Load(); MissionsAll = Context.Missions.Local; SmpUcMissionDetail.CitiesAll = Context.Cities.Local; GetBindingExpression(DataContextProperty)?.UpdateTarget(); if (selectedId.HasValue) { DataGridMissions.SelectedItem = MissionsAll.FirstOrDefault(m => m.Id == selectedId.Value); } }
private void Reload() { var selectedId = (DataGridEmployees.SelectedItem as Employee)?.Id; Context = new PaySysContext(); Context.MainGroups.Include(mg => mg.SubGroups).Load(); Context.SubGroups.Load(); Context.Jobs.Load(); Context.Employees.Include(employee => employee.ContractMasters).Load(); SmpUcContractMasterEdit.MainGroups = Context.MainGroups.Local; SmpUcContractMasterEdit.SubGroups = Context.SubGroups.Local; SmpUcContractMasterEdit.Jobs = Context.Jobs.Local; EmployeesAll = Context.Employees.Local; DataGridEmployees.GetBindingExpression(ItemsControl.ItemsSourceProperty)?.UpdateTarget(); DataGridEmployees.GetBindingExpression(DataContextProperty)?.UpdateTarget(); if (selectedId.HasValue) { DataGridEmployees.SelectedItem = EmployeesAll.FirstOrDefault(emp => emp.Id == selectedId.Value); } SmpUcLookup_OnLookupTextChanged(null, null); }