public ActionResult DeleteConfirmed(string id) { Hotel_Booking hotel_Booking = db.Hotel_Booking.Find(id); db.Hotel_Booking.Remove(hotel_Booking); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "HOTELID,CUSTOMERID,CHECK_IN,CHECK_OUT")] Hotel_Booking hotel_Booking) { if (ModelState.IsValid) { db.Entry(hotel_Booking).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CUSTOMERID = new SelectList(db.Customers, "CUSTOMERID", "NAME", hotel_Booking.CUSTOMERID); ViewBag.HOTELID = new SelectList(db.Hotels, "HOTELID", "NAME", hotel_Booking.HOTELID); return(View(hotel_Booking)); }
// GET: Hotel_Booking/Details/5 public ActionResult Details(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Hotel_Booking hotel_Booking = db.Hotel_Booking.Find(id); if (hotel_Booking == null) { return(HttpNotFound()); } return(View(hotel_Booking)); }
// GET: Hotel_Booking/Edit/5 public ActionResult Edit(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Hotel_Booking hotel_Booking = db.Hotel_Booking.Find(id); if (hotel_Booking == null) { return(HttpNotFound()); } ViewBag.CUSTOMERID = new SelectList(db.Customers, "CUSTOMERID", "NAME", hotel_Booking.CUSTOMERID); ViewBag.HOTELID = new SelectList(db.Hotels, "HOTELID", "NAME", hotel_Booking.HOTELID); return(View(hotel_Booking)); }