Ejemplo n.º 1
0
        private void UpdateTherapyPlace(TherapyPlace updatedTherapyPlace)
        {
            var placeListItem = TherapyPlaces.First(listItem => listItem.PlaceId == updatedTherapyPlace.Id);
            var placeType     = dataCenter.GetTherapyPlaceType(updatedTherapyPlace.TypeId);

            placeListItem.Name     = updatedTherapyPlace.Name;
            placeListItem.TypeIcon = GetIconForTherapyPlaceType(placeType.IconType);
            placeListItem.TypeName = placeType.Name;

            SelectedTherapyPlaceObject = updatedTherapyPlace;

            var updatedRoom = SelectedRoomObject.UpdateTherapyPlace(updatedTherapyPlace);

            UpdateRoom(updatedRoom);
        }
Ejemplo n.º 2
0
        private void DoAddTherapyPlace()
        {
            var newTherapyPlace         = TherapyPlaceCreateAndEditLogic.Create("noName");
            var placeType               = dataCenter.GetTherapyPlaceType(newTherapyPlace.TypeId);
            var newTherapyPlaceListItem = new TherapyPlaceDisplayData(newTherapyPlace.Name,
                                                                      placeType.ToString(),
                                                                      GetIconForTherapyPlaceType(placeType.IconType),
                                                                      newTherapyPlace.Id,
                                                                      SelectedRoom.DisplayedColor);

            TherapyPlaces.Add(newTherapyPlaceListItem);
            var updatedRoom = SelectedRoomObject.AddTherapyPlace(newTherapyPlace);

            UpdateRoom(updatedRoom);

            SelectedTherapyPlace = newTherapyPlaceListItem;
        }
Ejemplo n.º 3
0
        private async void DoDeleteTherapyPlace()
        {
            var dialog = new UserDialogBox("",
                                           $"Therapyplatz [{SelectedTherapyPlace.Name}] wirklich löschen?",
                                           MessageBoxButton.OKCancel);

            var result = await dialog.ShowMahAppsDialog();

            if (result == MessageDialogResult.Affirmative)
            {
                var therapyPlaceToDelete = SelectedTherapyPlace;

                var updatedRoom = SelectedRoomObject.RemoveTherapyPlace(therapyPlaceToDelete.PlaceId);
                UpdateRoom(updatedRoom);
                TherapyPlaces.Remove(SelectedTherapyPlace);

                SelectedTherapyPlace = null;
            }
        }