public async void DeleteBooking() { int bookingId = _bookingEventViewModel.NewBooking.UserId; Persistency.Consumer <Booking> bookingFacade = new Persistency.Consumer <Booking>("http://localhost:61467/api/Bookings"); bool ok = await bookingFacade.DeleteAsync(new [] { (bookingId) }); //ClearBooking(); }
public async void DeleteRoom() { int roomNr = _adminRoomViewModel.NewRoom.RoomNr; Consumer <Room> adminRoomFacade = new Persistency.Consumer <Room>("http://localhost:61467/api/Rooms"); bool ok = await adminRoomFacade.DeleteAsync(new[] { (roomNr) }); if (!ok) { MessageDialogHelper.Show("Der skete en fejl", $"Rum {roomNr} blev ikke slettet"); } else { MessageDialogHelper.Show("Alt gik godt", $"Rum {roomNr} blev slettet"); ClearRoom(); _adminRoomViewModel.AdminRoomSingleton.Reload(((RelayCommand)_adminRoomViewModel.DeleteRoomCommand).RaiseCanExecuteChanged); } }