コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            ReservationReview reservationReview = db.ReservationReview.Find(id);

            db.ReservationReview.Remove(reservationReview);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 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));
 }
コード例 #3
0
        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));
        }
コード例 #4
0
        // 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));
        }
コード例 #5
0
        // 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));
        }