public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } else { var model = _reservationManager.Find(i => i.Id == id); if (model == null) { return(HttpNotFound()); } return(View(model)); } }
public ActionResult Delete(int id) { Car car = carManager.Find(x => x.Id == id); if (car.IsActive == false) { reservationManager.Delete(reservationManager.Find(x => x.CarID == id)); reservationManager.Save(); } carManager.Delete(car); carManager.Save(); return(RedirectToAction("Index", "Car")); }
public ReservationDto GetReservation(int id) { WriteActualMethod(); return(DtoConverter.ConvertToDto(reservationManager.Find(id))); }