private void DoAddTheraptPlaceType() { var newTherapyPlaceType = TherapyPlaceTypeCreateAndEditLogic.Create(); dataCenter.AddNewTherapyPlaceType(newTherapyPlaceType); connectionService.SendTherapyPlaceTypeAddedNotification(newTherapyPlaceType); TherapyPlaceTypes.Add(newTherapyPlaceType); SelectedTherapyPlaceType = newTherapyPlaceType; }
private void OnSelectedPageChanged(MainPage mainPage) { if (mainPage == MainPage.TherapyPlaceTypes) { TherapyPlaceTypes.Clear(); dataCenter.GetAllTherapyPlaceTypes() .Do(TherapyPlaceTypes.Add); SelectedTherapyPlaceType = null; } }
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; }