public ActionResult MitigationCatDeleteConfirmed(int id) { MitigationCat cat = db.MitigationCats.Single(p => p.MitigationCatId == id); db.MitigationCats.Remove(cat); db.SaveChanges(); return(RedirectToAction("MitigationCatList")); }
public ActionResult MitigationCatNew(MitigationCat cat) { if (ModelState.IsValid) { db.MitigationCats.Add(cat); db.SaveChanges(); return(RedirectToAction("MitigationCatList")); } return(View(cat)); }
public ActionResult MitigationCatEdit(MitigationCat cat) { if (ModelState.IsValid) { db.MitigationCats.Attach(cat); db.Entry(cat).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); return(RedirectToAction("MitigationCatList")); } return(View(cat)); }