public ActionResult DeleteConfirmed(int id) { Product_TBL product_TBL = db.Product_TBL.Find(id); db.Product_TBL.Remove(product_TBL); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Product_id,Product_name,Product_category,Price,QTE")] Product_TBL product_TBL) { if (ModelState.IsValid) { db.Entry(product_TBL).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(product_TBL)); }
public ActionResult Create([Bind(Include = "Product_id,Product_name,Product_category,Price,QTE")] Product_TBL product_TBL) { if (ModelState.IsValid) { db.Product_TBL.Add(product_TBL); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(product_TBL)); }
// GET: Product_TBL/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Product_TBL product_TBL = db.Product_TBL.Find(id); if (product_TBL == null) { return(HttpNotFound()); } return(View(product_TBL)); }