public ActionResult Delete(ReservationsDeleteViewModel model) { ReservationRepository repository = new ReservationRepository(); repository.Delete(model.ID); return(RedirectToAction("Index")); }
public ActionResult Delete(int id) { ReservationRepository repository = new ReservationRepository(); Reservation reservation = repository.GetByID(id); ReservationsDeleteViewModel model = new ReservationsDeleteViewModel(); model.ID = reservation.ID; model.UserId = reservation.UserId; model.RestaurantId = reservation.RestaurantId; model.ReservationTime = reservation.ReservationTime; model.PeopleCount = reservation.PeopleCount; model.Comment = reservation.Comment; return(View(model)); }