public ActionResult DeleteConfirmed(int id) { TB_CATEGORY tb_category = db.TB_CATEGORY.Find(id); db.TB_CATEGORY.Remove(tb_category); db.SaveChanges(); return(RedirectToAction("Index")); }
// // GET: /Category/Delete/5 public ActionResult Delete(int id = 0) { TB_CATEGORY tb_category = db.TB_CATEGORY.Find(id); if (tb_category == null) { return(HttpNotFound()); } return(View(tb_category)); }
public ActionResult Edit(TB_CATEGORY tb_category) { if (ModelState.IsValid) { db.Entry(tb_category).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tb_category)); }
public ActionResult Create(TB_CATEGORY tb_category) { if (ModelState.IsValid) { db.TB_CATEGORY.Add(tb_category); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tb_category)); }