public ActionResult DeleteConfirmed(int id) { ReservationReview reservationReview = db.ReservationReview.Find(id); db.ReservationReview.Remove(reservationReview); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "reviewID,reviewRoom,dateReview,reservationID,departamentID")] ReservationReview reservationReview) { if (ModelState.IsValid) { db.Entry(reservationReview).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.departamentID = new SelectList(db.Departament, "departamentID", "type", reservationReview.departamentID); ViewBag.reservationID = new SelectList(db.Reservation, "reservationID", "reservationID", reservationReview.reservationID); return(View(reservationReview)); }
public ActionResult Create([Bind(Include = "reviewID,reviewRoom,reservationID,departamentID")] ReservationReview reservationReview) { if (ModelState.IsValid) { reservationReview.dateReview = DateTime.Now; db.ReservationReview.Add(reservationReview); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.departamentID = new SelectList(db.Departament, "departamentID", "type", reservationReview.departamentID); ViewBag.reservationID = new SelectList(db.Reservation, "reservationID", "reservationID", reservationReview.reservationID); return(View(reservationReview)); }
// GET: ReservationReviews/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ReservationReview reservationReview = db.ReservationReview.Find(id); if (reservationReview == null) { return(HttpNotFound()); } return(View(reservationReview)); }
// GET: ReservationReviews/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ReservationReview reservationReview = db.ReservationReview.Find(id); if (reservationReview == null) { return(HttpNotFound()); } ViewBag.departamentID = new SelectList(db.Departament, "departamentID", "type", reservationReview.departamentID); ViewBag.reservationID = new SelectList(db.Reservation, "reservationID", "reservationID", reservationReview.reservationID); return(View(reservationReview)); }