public ActionResult DeleteConfirmed(int id) { bkg bkg = db.bkgs.Find(id); db.bkgs.Remove(bkg); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "bookingId,custId,shipId,agnId")] bkg bkg) { if (ModelState.IsValid) { db.Entry(bkg).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.agnId = new SelectList(db.agns, "agentId", "agentName", bkg.agnId); ViewBag.custId = new SelectList(db.cus, "customerId", "customerName", bkg.custId); ViewBag.shipId = new SelectList(db.shps, "shipmentId", "shipModel", bkg.shipId); return(View(bkg)); }
// GET: Bookings/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } bkg bkg = db.bkgs.Find(id); if (bkg == null) { return(HttpNotFound()); } return(View(bkg)); }
// GET: Bookings/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } bkg bkg = db.bkgs.Find(id); if (bkg == null) { return(HttpNotFound()); } ViewBag.agnId = new SelectList(db.agns, "agentId", "agentName", bkg.agnId); ViewBag.custId = new SelectList(db.cus, "customerId", "customerName", bkg.custId); ViewBag.shipId = new SelectList(db.shps, "shipmentId", "shipModel", bkg.shipId); return(View(bkg)); }