public ActionResult DeleteConfirmed(int id) { barProduct barProduct = db.barProduct.Find(id); db.barProduct.Remove(barProduct); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "id,type,name,price")] barProduct barProduct) { if (ModelState.IsValid) { db.Entry(barProduct).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(barProduct)); }
public ActionResult Create([Bind(Include = "id,type,name,price")] barProduct barProduct) { if (ModelState.IsValid) { db.barProduct.Add(barProduct); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(barProduct)); }
// GET: barProducts/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } barProduct barProduct = db.barProduct.Find(id); if (barProduct == null) { return(HttpNotFound()); } return(View(barProduct)); }