Esempio n. 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            bkg bkg = db.bkgs.Find(id);

            db.bkgs.Remove(bkg);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
 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));
 }
Esempio n. 3
0
        // 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));
        }
Esempio n. 4
0
        // 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));
        }