private void RoomAboutCommandExecute(object obj) { RoomModel roomModel = null; foreach (var r in RoomCollection) { if (r.Id == (int)obj) { roomModel = r; } } var viewModel = new RoomAboutDialogWindowModel(roomModel); var result = _dialogService.ShowDialog(viewModel); if (!(result is true)) { return; } { if (roomModel != null) { var r = roomModel.Room; _hotel.UpdateRoom(r); } RoomCollectionView.Refresh(); } }
private void AddRoomCommandExecute(object o) { var rnd = new Random(); var room = new Room(rnd.Next(0, 100), rnd.Next(50, 200), (RoomType)rnd.Next(0, 4), (RoomSubtype)rnd.Next(0, 3), rnd.Next(20, 80)); _hotel.AddRoom(room); RoomCollection.Add(new RoomModel(room)); RoomCollectionView.Refresh(); }
private void RemoveRoomCommandExecute(object o) { _hotel.RemoveRoom(SelectedRoom.Id); RoomCollection.Remove(SelectedRoom); RoomCollectionView.Refresh(); }