コード例 #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);
        }
コード例 #2
0
        public void EditSelectedActivity()
        {
            var dlg = new EditDomainObjectWindow();

            var ctrl = new usrActivityDetails();

            dlg.SetControl(ctrl);
            ctrl.Fill(SelectedActivity.Clone());
            if (dlg.ShowDialog() == true)
            {
                replace(SelectedActivity, ctrl.Activity);
            }
        }
コード例 #3
0
        public void New()
        {
            var dlg = new EditDomainObjectWindow();

            var ctrl = new usrReminderDetails();

            dlg.SetControl(ctrl);
            var reminder = new ReminderItemDTO();

            ctrl.ReminderItem = reminder;
            if (dlg.ShowDialog() == true)
            {
                ReminderItemsReposidory.Instance.Add(ctrl.ReminderItem);
            }
        }
コード例 #4
0
        private void editSelectedItem()
        {
            if (!UIHelper.EnsurePremiumLicence())
            {
                return;
            }
            var dlg = new EditDomainObjectWindow();

            var ctrl = new usrMyPlaceDetails();

            dlg.SetControl(ctrl);
            ctrl.Fill(SelectedItem.Clone());
            if (dlg.ShowDialog() == true)
            {
                replace(SelectedItem, ctrl.MyPlace);
            }
        }
コード例 #5
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);
            }
        }
コード例 #6
0
        public void Edit()
        {
            if (SelectedReminder.Type != ReminderType.Custom)
            {
                return;
            }
            var dlg = new EditDomainObjectWindow();

            var ctrl = new usrReminderDetails();

            dlg.SetControl(ctrl);
            ctrl.ReminderItem = SelectedReminder.Clone();
            if (dlg.ShowDialog() == true)
            {
                replace(SelectedReminder, ctrl.ReminderItem);
            }
        }
コード例 #7
0
        public void NewActivity()
        {
            var dlg = new EditDomainObjectWindow();

            var ctrl = new usrActivityDetails();

            dlg.SetControl(ctrl);
            ActivityDTO activity = new ActivityDTO();

            activity.Color = Color.LightGreen.ToColorString();
            ctrl.Fill(activity);
            if (dlg.ShowDialog() == true)
            {
                ActivitiesReposidory.Instance.Add(ctrl.Activity);
                NotifyOfPropertyChange(() => Activities);
            }
        }
コード例 #8
0
        private void rbtnNew_Click(object sender, RoutedEventArgs e)
        {
            //ExerciseEditorWindow dlg = new ExerciseEditorWindow();
            //var newExercise = new ExerciseDTO();
            //if (SelectedExerciseType.HasValue)
            //{
            //    newExercise.ExerciseType = SelectedExerciseType.Value;
            //}
            //else if(SelectedExercise!=null)
            //{
            //    newExercise.ExerciseType = SelectedExercise.ExerciseType;
            //}
            //dlg.Fill(newExercise);
            //if(dlg.ShowDialog()==true)
            //{
            //    Fill();
            //}

            if (!UIHelper.EnsurePremiumLicence())
            {
                return;
            }
            var dlg = new EditDomainObjectWindow();

            var ctrl        = new usrExerciseEditor();
            var newExercise = new ExerciseDTO();

            if (SelectedExerciseType.HasValue)
            {
                newExercise.ExerciseType = SelectedExerciseType.Value;
            }
            else if (SelectedExercise != null)
            {
                newExercise.ExerciseType = SelectedExercise.ExerciseType;
            }
            ctrl.Fill(newExercise, ExercisesReposidory.Instance.Items.Values);
            dlg.SetControl(ctrl);

            if (dlg.ShowDialog() == true)
            {
                ExercisesReposidory.Instance.Add((ExerciseDTO)ctrl.Object);
                Fill(pageContext);
            }
        }
コード例 #9
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();
            }
        }
コード例 #10
0
        private void rbtnEdit_Click(object sender, RoutedEventArgs e)
        {
            if (!UIHelper.EnsurePremiumLicence())
            {
                return;
            }

            var dlg = new EditDomainObjectWindow();

            var ctrl = new usrExerciseEditor();

            ctrl.Fill(SelectedExercise.StandardClone(), ExercisesReposidory.Instance.Items.Values);
            dlg.SetControl(ctrl);

            if (dlg.ShowDialog() == true)
            {
                ExercisesReposidory.Instance.Update((ExerciseDTO)ctrl.Object);
                Fill(pageContext);
            }
        }
コード例 #11
0
        private void newItem()
        {
            if (!UIHelper.EnsurePremiumLicence())
            {
                return;
            }
            var dlg = new EditDomainObjectWindow();

            var ctrl = new usrMyPlaceDetails();

            dlg.SetControl(ctrl);
            var myPlace = new MyPlaceDTO();

            myPlace.Color = Color.LavenderBlush.ToColorString();
            ctrl.Fill(myPlace);
            if (dlg.ShowDialog() == true)
            {
                _myPlacesCache.Add(ctrl.MyPlace);
                NotifyOfPropertyChange(() => Items);
            }
        }
コード例 #12
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);
            }
        }
コード例 #13
0
        public void EditSelected()
        {
            if (SelectedEntry.IsLocked)
            {
                return;
            }
            var dlg = new EditDomainObjectWindow();
            IEditableControl ctrl = null;


            var viewModel = SelectedEntry;

            if (!viewModel.IsNew)
            {
                viewModel = viewModel.Clone();
            }

            if (SelectedEntry is ScheduleEntryDTO)
            {
                var control = new usrScheduleEntryDetails();
                ctrl = control;
                control.Fill(viewModel);
                dlg.SetControl(control);
            }
            else
            {
                var control = new usrChampionshipScheduleEntryEditor();
                ctrl = control;
                control.Fill(viewModel);
                dlg.SetControl(control);
            }


            if (dlg.ShowDialog() == true)
            {
                IsModified = true;
                update((ScheduleEntryBaseDTO)ctrl.Object);
            }
        }