示例#1
0
        private void DoAddTheraptPlaceType()
        {
            var newTherapyPlaceType = TherapyPlaceTypeCreateAndEditLogic.Create();

            dataCenter.AddNewTherapyPlaceType(newTherapyPlaceType);
            connectionService.SendTherapyPlaceTypeAddedNotification(newTherapyPlaceType);
            TherapyPlaceTypes.Add(newTherapyPlaceType);

            SelectedTherapyPlaceType = newTherapyPlaceType;
        }
示例#2
0
        private void OnSelectedPageChanged(MainPage mainPage)
        {
            if (mainPage == MainPage.TherapyPlaceTypes)
            {
                TherapyPlaceTypes.Clear();

                dataCenter.GetAllTherapyPlaceTypes()
                .Do(TherapyPlaceTypes.Add);

                SelectedTherapyPlaceType = null;
            }
        }
示例#3
0
        private void DoSaveChanges()
        {
            if (!NameChecker.CheckName(Name))
            {
                NameChecker.ShowCharacterError(Name);
                return;
            }

            var newTherapyPlaceType = SelectedTherapyPlaceType.SetNewName(Name)
                                      .SetNewIcon(IconType.IconType);

            dataCenter.UpdateTherapyPlaceType(newTherapyPlaceType);
            connectionService.SendTherapyPlaceTypeUpdatedNotification(newTherapyPlaceType);

            TherapyPlaceTypes.Remove(SelectedTherapyPlaceType);
            TherapyPlaceTypes.Add(newTherapyPlaceType);

            SelectedTherapyPlaceType = null;
            ShowModificationView     = false;
        }