public ActionResult DeleteConfirmed(int id) { AmountOfMaterial amountofmaterial = db.AmountOfMaterials.Find(id); db.AmountOfMaterials.Remove(amountofmaterial); db.SaveChanges(); return(RedirectToAction("Index")); }
// // GET: /AmountOfMaterial/Details/5 public ActionResult Details(int id = 0) { AmountOfMaterial amountofmaterial = db.AmountOfMaterials.Find(id); if (amountofmaterial == null) { return(HttpNotFound()); } return(View(amountofmaterial)); }
public ActionResult Edit(AmountOfMaterial amountofmaterial) { if (ModelState.IsValid) { db.Entry(amountofmaterial).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.RawMaterialsId = new SelectList(db.RawMaterials, "Id", "Nume", amountofmaterial.RawMaterialsId); ViewBag.StockMaterialsId = new SelectList(db.StockMaterials, "Id", "Id", amountofmaterial.StockMaterialsId); return(View(amountofmaterial)); }
// // GET: /AmountOfMaterial/Edit/5 public ActionResult Edit(int id = 0) { AmountOfMaterial amountofmaterial = db.AmountOfMaterials.Find(id); if (amountofmaterial == null) { return(HttpNotFound()); } ViewBag.RawMaterialsId = new SelectList(db.RawMaterials, "Id", "Nume", amountofmaterial.RawMaterialsId); ViewBag.StockMaterialsId = new SelectList(db.StockMaterials, "Id", "Id", amountofmaterial.StockMaterialsId); return(View(amountofmaterial)); }
public ActionResult Create(AmountOfMaterial amountofmaterial) { if (ModelState.IsValid) { db.AmountOfMaterials.Add(amountofmaterial); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.RawMaterialsId = new SelectList(db.RawMaterials, "Id", "Nume", amountofmaterial.RawMaterialsId); ViewBag.StockMaterialsId = new SelectList(db.StockMaterials, "Id", "Id", amountofmaterial.StockMaterialsId); return(View(amountofmaterial)); }