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