// // GET: /Category/Delete/5 public ActionResult Delete(int id = 0) { Grant_Category grant_category = db.Grant_Category.Single(g => g.CategoryID == id); if (grant_category == null) { return(HttpNotFound()); } return(View(grant_category)); }
public ActionResult DeleteConfirmed(int id) { Grant_Category grant_category = db.Grant_Category.Single(g => g.CategoryID == id); db.Grant_Category.DeleteObject(grant_category); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit(Grant_Category grant_category) { if (ModelState.IsValid) { db.Grant_Category.Attach(grant_category); db.ObjectStateManager.ChangeObjectState(grant_category, EntityState.Modified); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(grant_category)); }
public ActionResult Create(Grant_Category grant_category) { if (ModelState.IsValid) { db.Grant_Category.AddObject(grant_category); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(grant_category)); }