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