public ActionResult DeleteConfirmed(int id) { RoomServicePackage roomServicePackage = db.RoomServicePackage.Find(id); db.RoomServicePackage.Remove(roomServicePackage); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "roomServicePackageID,roomPackageID,serviceID")] RoomServicePackage roomServicePackage) { if (ModelState.IsValid) { db.Entry(roomServicePackage).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.roomPackageID = new SelectList(db.RoomPackage, "roomPackageID", "namePackage", roomServicePackage.roomPackageID); ViewBag.serviceID = new SelectList(db.Service, "serviceID", "name", roomServicePackage.serviceID); return(View(roomServicePackage)); }
// GET: RoomServicePackages/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } RoomServicePackage roomServicePackage = db.RoomServicePackage.Find(id); if (roomServicePackage == null) { return(HttpNotFound()); } return(View(roomServicePackage)); }
// GET: RoomServicePackages/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } RoomServicePackage roomServicePackage = db.RoomServicePackage.Find(id); if (roomServicePackage == null) { return(HttpNotFound()); } ViewBag.roomPackageID = new SelectList(db.RoomPackage, "roomPackageID", "namePackage", roomServicePackage.roomPackageID); ViewBag.serviceID = new SelectList(db.Service, "serviceID", "name", roomServicePackage.serviceID); return(View(roomServicePackage)); }