private void LoadEntities() { gridControlEntities.BeginUpdate(); try { BufferHoursList.Clear(); if (EntityStore != null) { List <BufferHours> cols = ClientEnvironment.StoreService.BufferHoursService.GetBufferHoursFiltered(EntityStore.ID, StartYear, EndYear); if (SWController != null) { SWController.FillBufferHours(cols); } BufferHoursList.CopyList(cols); } if (gridControlEntities.DataSource == null) { gridControlEntities.DataSource = BufferHoursList; } } finally { gridControlEntities.EndUpdate(); } UpdateButtonState(); }
private void EditEntity() { BufferHours bh = FocusedEntity; if (bh == null || SWController == null || EntityStore == null) { return; } if (CanEditEntity()) { FormSelectYear selectYear = new FormSelectYear(); List <StoreToWorld> lst = SWController.GetListByStoreId(EntityStore.ID); selectYear.SetStoreWorlds(lst); selectYear.EntityStore = EntityStore; selectYear.SetReadOnly(); selectYear.Entity = bh; if (selectYear.ShowDialog() == DialogResult.OK) { BufferHoursList.ResetItemById(bh.ID); } } }
private void EditEntity() { Benchmark bh = FocusedEntity; if (bh == null || SWController == null || EntityStore == null) { return; } if (CanEditEntity()) { using (FormBenchmark formEdit = new FormBenchmark()) { List <StoreToWorld> lst = SWController.GetListByStoreId(EntityStore.ID); formEdit.SetStoreWorlds(lst); formEdit.EntityStore = EntityStore; formEdit.SetReadOnly(); formEdit.EntityBenchmark = bh; if (formEdit.ShowDialog() == DialogResult.OK) { BenchmarksList.ResetItemById(bh.ID); } } } }
private void EditEntity() { TrendCorrection bh = FocusedEntity; if (bh == null || SWController == null || EntityStore == null) { return; } // Edit can now trendcorrection, can't edit last EndTime < Today if (CanEditEntity()) { using (FormTrendCorrection formEdit = new FormTrendCorrection()) { List <StoreToWorld> lst = SWController.GetListByStoreId(EntityStore.ID); formEdit.SetStoreWorlds(lst); formEdit.EntityStore = EntityStore; formEdit.SetReadOnly(); formEdit.Entity = bh; if (formEdit.ShowDialog() == DialogResult.OK) { TrendCorrectionList.ResetItemById(bh.ID); } } } }
private void NewEntity() { if (SWController == null || EntityStore == null) { return; } FormSelectYear selectYear = new FormSelectYear(); List <StoreToWorld> lst = SWController.GetListByStoreId(EntityStore.ID); selectYear.SetStoreWorlds(lst); selectYear.EntityStore = EntityStore; if (selectYear.ShowDialog() == DialogResult.OK) { short y = selectYear.Entity.Year; if (y >= StartYear && y <= EndYear) { BufferHoursList.Add(selectYear.Entity); } } }
private void LoadEntities() { if ((!EndDate.HasValue) || (StartDate <= EndDate) || EndDate == null) { gridControl.BeginUpdate(); try { TrendCorrectionList.Clear(); if (EntityStore != null) { List <TrendCorrection> cols = ClientEnvironment.StoreService.TrendCorrectionService.GetTrendCorrectionFiltered(EntityStore.ID, StartDate, EndDate); TrendCorrectionList.CopyList(cols); if (SWController != null) { foreach (TrendCorrection bh in TrendCorrectionList) { bh.WorldName = SWController.GetWorldNameById(bh.StoreWorldID); } } } if (gridControl.DataSource == null) { gridControl.DataSource = TrendCorrectionList; } } finally { gridControl.EndUpdate(); } UpdateButtonState(); } else { ErrorMessage(GetLocalized("ErrorDateRange")); } }
private void NewEntity() { if (SWController == null || EntityStore == null) { return; } using (FormBenchmark formEdit = new FormBenchmark()) { List <StoreToWorld> lst = SWController.GetListByStoreId(EntityStore.ID); formEdit.SetStoreWorlds(lst); formEdit.EntityStore = EntityStore; if (formEdit.ShowDialog() == DialogResult.OK) { short y = formEdit.EntityBenchmark.Year; if (y >= StartYear && y <= EndYear) { BenchmarksList.Add(formEdit.EntityBenchmark); } } } }
private void NewEntity() { if (SWController == null || EntityStore == null) { return; } using (FormTrendCorrection formEdit = new FormTrendCorrection()) { List <StoreToWorld> lst = SWController.GetListByStoreId(EntityStore.ID); formEdit.SetStoreWorlds(lst); formEdit.EntityStore = EntityStore; if (formEdit.ShowDialog() == DialogResult.OK) { if (IsIncludeDateRange(StartDate, EndDate, formEdit.EntityTrend.BeginTime, formEdit.EntityTrend.EndTime)) { TrendCorrectionList.Add(formEdit.EntityTrend); } UpdateButtonState(); } } }