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 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 (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 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); } } } }