public ActionResult DeleteConfirmed(int id) { RawMaterialStock rawMaterialStock = db.RawMaterialStocks.Find(id); db.RawMaterialStocks.Remove(rawMaterialStock); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID,Quantity,RawMaterialID,SectorID")] RawMaterialStock rawMaterialStock) { if (ModelState.IsValid) { db.Entry(rawMaterialStock).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.RawMaterialID = new SelectList(db.RawMaterials, "ID", "Description", rawMaterialStock.RawMaterialID); ViewBag.SectorID = new SelectList(db.Sectors, "ID", "Name", rawMaterialStock.SectorID); return(View(rawMaterialStock)); }
// GET: RawMaterialStocks/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } RawMaterialStock rawMaterialStock = db.RawMaterialStocks.Find(id); if (rawMaterialStock == null) { return(HttpNotFound()); } return(View(rawMaterialStock)); }
// GET: RawMaterialStocks/SubmitOrder public ActionResult SubmitOrder(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } RawMaterialStock rawMaterialStock = db.RawMaterialStocks.Find(id); if (rawMaterialStock == null) { return(HttpNotFound()); } ViewBag.RawMaterialID = new SelectList(db.RawMaterials, "ID", "Description", rawMaterialStock.RawMaterialID); return(View(rawMaterialStock)); }