// GET: Reservation/Edit/5 public ActionResult Edit(int id) { var reservation = reservationRepository.GetById(id); //Seat var seats = seatRepository.GetAll(); var Seats = seats.Select(s => new SelectListItem() { Value = s.Id.ToString(), Text = s.SeatNo.ToString() }).ToList(); //Show var shows = showRepository.GetAll(); var Shows = shows.Select(s => new SelectListItem() { Value = s.Id.ToString(), Text = s.Film.Name }).ToList(); ViewBag.Seats = Seats; ViewBag.Shows = Shows; if (reservation == null) { return(HttpNotFound()); } var reservationId = new Models.Reservation(); reservationId.InjectFrom(reservation); return(View(reservationId)); }
// GET: Reservation/Delete/5 public ActionResult Delete(int id) { var reservation = reservationRepository.FindById(id); if (reservationRepository == null) { return(HttpNotFound()); } var reservationId = new Models.Reservation(); reservationId.InjectFrom(reservation); return(View(reservationId)); }