Esempio n. 1
0
        public ActionResult DeleteConfirmed(string id)
        {
            SUPPLy sUPPLy = db.SUPPLIES.Find(id);

            db.SUPPLIES.Remove(sUPPLy);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
 public ActionResult Edit([Bind(Include = "VendorID,MaterialID,SupplyUnitPrice, SupplyID")] SUPPLy sUPPLy)
 {
     if (ModelState.IsValid)
     {
         db.Entry(sUPPLy).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.MaterialID = new SelectList(db.RAWMATERIALs, "MaterialID", "MaterialName", sUPPLy.MaterialID);
     ViewBag.VendorID   = new SelectList(db.VENDORs, "VendorID", "VendorName", sUPPLy.VendorID);
     return(View(sUPPLy));
 }
Esempio n. 3
0
        public ActionResult Create([Bind(Include = "VendorID,MaterialID,SupplyUnitPrice,SupplyID")] SUPPLy sUPPLy)
        {
            if (ModelState.IsValid)
            {
                sUPPLy.SupplyID = GenerateID(sUPPLy.VendorID, sUPPLy.MaterialID);
                db.SUPPLIES.Add(sUPPLy);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.MaterialID = new SelectList(db.RAWMATERIALs, "MaterialID", "MaterialName", sUPPLy.MaterialID);
            ViewBag.VendorID   = new SelectList(db.VENDORs, "VendorID", "VendorName", sUPPLy.VendorID);
            return(View(sUPPLy));
        }
Esempio n. 4
0
        // GET: SUPPLies/Details/5
        public ActionResult Details(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            SUPPLy sUPPLy = db.SUPPLIES.Find(id);

            if (sUPPLy == null)
            {
                return(HttpNotFound());
            }
            return(View(sUPPLy));
        }
Esempio n. 5
0
        // GET: SUPPLies/Edit/5
        public ActionResult Edit(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            SUPPLy sUPPLy = db.SUPPLIES.Find(id);

            if (sUPPLy == null)
            {
                return(HttpNotFound());
            }
            ViewBag.MaterialID = new SelectList(db.RAWMATERIALs, "MaterialID", "MaterialName", sUPPLy.MaterialID);
            ViewBag.VendorID   = new SelectList(db.VENDORs, "VendorID", "VendorName", sUPPLy.VendorID);
            return(View(sUPPLy));
        }