public ActionResult DeleteConfirmed(int id) { HotelT hotelT = db.HotelT.Find(id); db.HotelT.Remove(hotelT); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "hotelid,hotelname,hotelcapacity,hoteltype,hotelprice,hotelphone,hoteladdress,countryid,tourid")] HotelT hotelT) { if (ModelState.IsValid) { db.Entry(hotelT).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.countryid = new SelectList(db.CountryT, "countryid", "countryname", hotelT.countryid); ViewBag.tourid = new SelectList(db.TourT, "tourid", "tourname", hotelT.tourid); return(View(hotelT)); }
// GET: HotelTs/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } HotelT hotelT = db.HotelT.Find(id); if (hotelT == null) { return(HttpNotFound()); } return(View(hotelT)); }
// GET: HotelTs/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } HotelT hotelT = db.HotelT.Find(id); if (hotelT == null) { return(HttpNotFound()); } ViewBag.countryid = new SelectList(db.CountryT, "countryid", "countryname", hotelT.countryid); ViewBag.tourid = new SelectList(db.TourT, "tourid", "tourname", hotelT.tourid); return(View(hotelT)); }