Exemplo n.º 1
0
        public static CustomerDTO CreateNewCustomer(UserSearchDTO connectedAccount = null)
        {
            var dlg = new EditDomainObjectWindow();

            var ctrl = new usrCustomerDetails();

            dlg.SetControl(ctrl);
            var customer = new CustomerDTO();

            customer.Settings         = new CustomerSettingsDTO();
            customer.ConnectedAccount = connectedAccount;
            ctrl.SelectedCustomer     = customer;
            if (dlg.ShowDialog() == true)
            {
                //FillActivities();//TODO:maybe we should change this
                CustomersReposidory.Instance.Add(ctrl.Customer);
                //refresh reminders only if this customer has it
                if (ctrl.Customer.RemindBefore != null)
                {
                    ReminderItemsReposidory.Instance.ClearCache();
                }
                return(ctrl.Customer);
            }
            return(null);
        }
Exemplo n.º 2
0
        public void EditSelectedItem()
        {
            if (!UIHelper.EnsureInstructorLicence())
            {
                return;
            }
            var dlg = new EditDomainObjectWindow();

            var ctrl = new usrCustomerDetails();

            dlg.SetControl(ctrl);
            ctrl.SelectedCustomer = SelectedItem.Clone();
            if (dlg.ShowDialog() == true)
            {
                replace(SelectedItem, ctrl.Customer);
                //refresh reminders
                ReminderItemsReposidory.Instance.ClearCache();
            }
        }