Exemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            ReservationComplaint reservationComplaint = db.ReservationComplaint.Find(id);

            db.ReservationComplaint.Remove(reservationComplaint);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "complaintID,reservationID,comment,dateComplaint,departamentID")] ReservationComplaint reservationComplaint)
 {
     if (ModelState.IsValid)
     {
         db.Entry(reservationComplaint).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.departamentID = new SelectList(db.Departament, "departamentID", "type", reservationComplaint.departamentID);
     ViewBag.reservationID = new SelectList(db.Reservation, "reservationID", "reservationID", reservationComplaint.reservationID);
     return(View(reservationComplaint));
 }
Exemplo n.º 3
0
        public ActionResult Create([Bind(Include = "reservationID,comment,departamentID")] ReservationComplaint reservationComplaint)
        {
            if (ModelState.IsValid)
            {
                reservationComplaint.dateComplaint = DateTime.Now;
                db.ReservationComplaint.Add(reservationComplaint);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.departamentID = new SelectList(db.Departament, "departamentID", "type", reservationComplaint.departamentID);
            ViewBag.reservationID = new SelectList(db.Reservation, "reservationID", "reservationID", reservationComplaint.reservationID);
            return(View(reservationComplaint));
        }
Exemplo n.º 4
0
        // GET: ReservationComplaints/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ReservationComplaint reservationComplaint = db.ReservationComplaint.Find(id);

            if (reservationComplaint == null)
            {
                return(HttpNotFound());
            }
            return(View(reservationComplaint));
        }
Exemplo n.º 5
0
        // GET: ReservationComplaints/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ReservationComplaint reservationComplaint = db.ReservationComplaint.Find(id);

            if (reservationComplaint == null)
            {
                return(HttpNotFound());
            }
            ViewBag.departamentID = new SelectList(db.Departament, "departamentID", "type", reservationComplaint.departamentID);
            ViewBag.reservationID = new SelectList(db.Reservation, "reservationID", "reservationID", reservationComplaint.reservationID);
            return(View(reservationComplaint));
        }