public ActionResult DeleteConfirmed(string id) { SUPPLy sUPPLy = db.SUPPLIES.Find(id); db.SUPPLIES.Remove(sUPPLy); db.SaveChanges(); return(RedirectToAction("Index")); }
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)); }
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)); }
// 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)); }
// 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)); }