public ActionResult DeleteConfirmed(int id) { Product_on_warehouse product_on_warehouse = db.Product_on_warehouse.Find(id); db.Product_on_warehouse.Remove(product_on_warehouse); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID_Product_on_warehouse,ID_Product,ID_Warehouse,quantity")] Product_on_warehouse product_on_warehouse) { if (ModelState.IsValid) { db.Entry(product_on_warehouse).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ID_Product = new SelectList(db.Ranges, "ID_product", "Names_range", product_on_warehouse.ID_Product); ViewBag.ID_Warehouse = new SelectList(db.Warehouse, "ID_Warehouse", "Names", product_on_warehouse.ID_Warehouse); return(View(product_on_warehouse)); }
// GET: Product_on_warehouse/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Product_on_warehouse product_on_warehouse = db.Product_on_warehouse.Find(id); if (product_on_warehouse == null) { return(HttpNotFound()); } return(View(product_on_warehouse)); }
// GET: Product_on_warehouse/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Product_on_warehouse product_on_warehouse = db.Product_on_warehouse.Find(id); if (product_on_warehouse == null) { return(HttpNotFound()); } ViewBag.ID_Product = new SelectList(db.Ranges, "ID_product", "Names_range", product_on_warehouse.ID_Product); ViewBag.ID_Warehouse = new SelectList(db.Warehouse, "ID_Warehouse", "Names", product_on_warehouse.ID_Warehouse); return(View(product_on_warehouse)); }