public void EditEntity(AvgWorkingDaysInWeek amount) { AvgWorkingDaysInWeek am = amount; if (amount == null && FocusedEntity == null) { return; } if (am == null) { am = FocusedEntity; } if (am == null) { return; // paranoik check } using (AvgWorkingDaysInWeekForm form = new AvgWorkingDaysInWeekForm()) { form.Amount = am; if (form.ShowDialog() == DialogResult.OK) { ListOfAvgWDInWeek.ResetItemById(am.ID); } } }
void NewEntity() { AvgWorkingDaysInWeek amount = ClientEnvironment.AvgWorkingDaysInWeekService.CreateEntity(); amount.CountryID = EntityCountry.ID; using (AvgWorkingDaysInWeekForm form = new AvgWorkingDaysInWeekForm()) { form.Amount = amount; if (form.ShowDialog() == DialogResult.OK) { ListOfAvgWDInWeek.Add(form.Amount); UpdateBarButtons(); } } }
public void EditEntity(AvgWorkingDaysInWeek amount) { AvgWorkingDaysInWeek am = amount; if (amount == null && FocusedEntity == null) return; if (am == null) am = FocusedEntity; if (am == null) return;// paranoik check using (AvgWorkingDaysInWeekForm form = new AvgWorkingDaysInWeekForm()) { form.Amount = am; if (form.ShowDialog() == DialogResult.OK) { ListOfAvgWDInWeek.ResetItemById(am.ID); } } }