public override async Task <ReservationDto> DeleteReservation(ReservationDto request, ServerCallContext context) { var reservation = request.ConvertToEntity(); var response = await reservationenManager.DeleteReservation(reservation); return(response.ConvertToDto()); }
public ActionResult Delete(string[] selectedReservation) { int idReservation = 0; int nbOfReservations = selectedReservation.Length; for (int i = 0; i < nbOfReservations; i++) { idReservation = Convert.ToInt32(selectedReservation[i].ToString()); ReservationManager.DeleteRoomReservation(idReservation); ReservationManager.DeleteReservation(idReservation); } return(View("DeleteOk")); }
public void deleteReservation(int id) { WriteActualMethod(); try { _reservationManager.DeleteReservation(id); } catch (InvalidOperationException) { OutOfRangeFault fault = new OutOfRangeFault() { Operation = "delete" }; throw new FaultException <OutOfRangeFault>(fault); } }
/// <summary> /// Delete a reservation when the user is authorized /// </summary> public ActionResult Delete(int id) { if (Session["IsAuthorized"] != null) { bool isAuthorized = Convert.ToBoolean(Session["IsAuthorized"]); //check session status, if true get data and display it if (isAuthorized) { ReservationManager.DeleteReservation(id); TempData["IsDelete"] = true; } } return(RedirectToAction("Index")); }
public async Task <ActionResult> Delete(string Id) { try { var reservation = await reservationManager.GetReservationById(Id); if (reservation != null) { await reservationManager.DeleteReservation(reservation); return(Ok()); } else { return(NotFound("Reservation not found")); } } catch (Exception e) { return(BadRequest(e.Message)); } }
public void DeleteReservation(ReservationDto reservationDto) { WriteActualMethod(); ReservationManager.DeleteReservation(DtoConverter.ConvertToEntity(reservationDto)); }
public async Task DeleteMeetingRoom() { var meetingRoom = await reservationManager.DeleteReservation(NewReservation); Assert.IsNotNull(meetingRoom); }