public CurrPlanEntity(DBSolom.Db db, long Id, Main_manager main_Manager, MicroFoundation microFoundation, KFK kFK, KFB kFB, KDB kDB, KEKB kEKB, double one, double two, double three, double four, double five, double six, double seven, double eight, double nine, double ten, double eleven, double twelve) { this.Id = Id; Головний_розпорядник = main_Manager; if (microFoundation.Фонд is null) { Фонд = db.MicroFoundations.Include(i => i.Фонд).FirstOrDefault(w => w.Видалено == false && w.Повністю == microFoundation.Повністю).Фонд; } else { Фонд = microFoundation.Фонд; } Мікрофонд = microFoundation; КФК = kFK; КФБ = kFB; КДБ = kDB; КЕКВ = kEKB; Січень = one; Лютий = two; Березень = three; Квітень = four; Травень = five; Червень = six; Липень = seven; Серпень = eight; Вересень = nine; Жовтень = ten; Листопад = eleven; Грудень = twelve; }
private void DatePicker_SelectedDateChanged(object sender, SelectionChangedEventArgs e) { if (SDate.SelectedDate != null && EDate.SelectedDate != null) { db = new Db(Func.GetConnectionString); #region "Clear filters, groups and visibility" if (IsInitialization == false) { dict_cmb.Values.ToList().ForEach(cmb => cmb.SelectedValue = null); dict_txt.Values.ToList().ForEach(txt => txt.Text = null); CheckBoxes.ForEach(a => a.IsChecked = false); EXPHDN.Children.Cast <ToggleButton>().ToList().ForEach(tgb => tgb.IsChecked = true); type = ""; prop = ""; value = null; LBFilters.Items.Clear(); GetFilters.Clear(); } #endregion GetCurrPlanEntities = new CurrPlanEntities(db, (DateTime)SDate.SelectedDate, (DateTime)EDate.SelectedDate); CollectionViewSource.Source = GetCurrPlanEntities.GetEntities; DGM.ItemsSource = CollectionViewSource.View; if (IsInitialization) { CollectionViewSource.SortDescriptions.Add(new SortDescription("Головний_розпорядник.Найменування", ListSortDirection.Ascending)); CollectionViewSource.SortDescriptions.Add(new SortDescription("Фонд.Код", ListSortDirection.Ascending)); CollectionViewSource.SortDescriptions.Add(new SortDescription("Мікрофонд.Повністю", ListSortDirection.Ascending)); CollectionViewSource.SortDescriptions.Add(new SortDescription("КФК.Код", ListSortDirection.Ascending)); CollectionViewSource.SortDescriptions.Add(new SortDescription("КФБ.Код", ListSortDirection.Ascending)); CollectionViewSource.SortDescriptions.Add(new SortDescription("КДБ.Код", ListSortDirection.Ascending)); CollectionViewSource.SortDescriptions.Add(new SortDescription("КЕКВ.Код", ListSortDirection.Ascending)); int t = 0; foreach (ItemPropertyInfo item in ((IItemProperties)DGM.Items).ItemProperties) { Func.GetFilters(EXPGRO, t, item, ref dict_cmb, ref dict_txt, ref GetLabels); Func.GetGroups(t, item, ref CheckBoxes, ref EXPGRT); Func.GetVisibilityOfColumns(t, item, ref EXPHDN); t++; } IsInitialization = false; } counterElementsDGM = GetCurrPlanEntities.GetEntities.Count; DGM.FrozenColumnCount = 7; } }
public CurrPlanEntities(DBSolom.Db db, DateTime start, DateTime end) { this.db = db; GetEntities = new List <CurrPlanEntity>(); FillEntities(start, end); }