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

            db.tblGuestFeedbacks.Remove(tblGuestFeedback);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "feedback_id,guest_phone_number,feedback_content,date_submitted,guest_email")] tblGuestFeedback tblGuestFeedback)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tblGuestFeedback).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.guest_phone_number = new SelectList(db.tblGuests, "guest_phone_number", "guest_name", tblGuestFeedback.guest_phone_number);
     return(View(tblGuestFeedback));
 }
コード例 #3
0
        // GET: Feedbacks/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tblGuestFeedback tblGuestFeedback = db.tblGuestFeedbacks.Find(id);

            if (tblGuestFeedback == null)
            {
                return(HttpNotFound());
            }
            return(View(tblGuestFeedback));
        }
コード例 #4
0
        // GET: Feedbacks/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tblGuestFeedback tblGuestFeedback = db.tblGuestFeedbacks.Find(id);

            if (tblGuestFeedback == null)
            {
                return(HttpNotFound());
            }
            ViewBag.guest_phone_number = new SelectList(db.tblGuests, "guest_phone_number", "guest_name", tblGuestFeedback.guest_phone_number);
            return(View(tblGuestFeedback));
        }