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