public ActionResult DeleteConfirmed(int id) { ProductHolding productHoldings = db.ProductHoldings.Find(id); db.ProductHoldings.Remove(productHoldings); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ProductID,Quantity,ReorderLevel")] ProductHolding productHoldings) { if (ModelState.IsValid) { db.Entry(productHoldings).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(productHoldings)); }
public ActionResult Create([Bind(Include = "ProductID,Quantity,ReorderLevel")] ProductHolding productHoldings) { if (ModelState.IsValid) { db.ProductHoldings.Add(productHoldings); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(productHoldings)); }
// GET: ProductHoldings/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ProductHolding productHoldings = db.ProductHoldings.Find(id); if (productHoldings == null) { return(HttpNotFound()); } return(View(productHoldings)); }
public Validation AddInclude(Product product) { ProductHolding ph = new ProductHolding { ProductHoldingID = product.ProductID, Quantity = 0, ReorderLevel = 1 }; product.ProductHolding = ph; var validation = this.Add(product); return(validation); }