예제 #1
0
        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);
            }
        }
예제 #2
0
        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);
            }
        }