public void EditSelectedItem() { if (!UIHelper.EnsureInstructorLicence()) { return; } var dlg = new EditDomainObjectWindow(); var ctrl = new usrCustomerGroupDetails(); dlg.SetControl(ctrl); ctrl.Fill(SelectedItem.Clone()); if (dlg.ShowDialog() == true) { replace(SelectedItem, ctrl.CustomerGroup); } }
public void NewGroup() { if (!UIHelper.EnsureInstructorLicence()) { return; } var dlg = new EditDomainObjectWindow(); var ctrl = new usrCustomerGroupDetails(); dlg.SetControl(ctrl); var customer = new CustomerGroupDTO(); customer.Color = Color.LightGoldenrodYellow.ToColorString(); ctrl.Fill(customer); if (dlg.ShowDialog() == true) { CustomerGroupsReposidory.Instance.Add(ctrl.CustomerGroup); NotifyOfPropertyChange(() => Items); } }