Exemplo n.º 1
0
        public ActionResult MitigationCatDeleteConfirmed(int id)
        {
            MitigationCat cat = db.MitigationCats.Single(p => p.MitigationCatId == id);

            db.MitigationCats.Remove(cat);
            db.SaveChanges();
            return(RedirectToAction("MitigationCatList"));
        }
Exemplo n.º 2
0
 public ActionResult MitigationCatNew(MitigationCat cat)
 {
     if (ModelState.IsValid)
     {
         db.MitigationCats.Add(cat);
         db.SaveChanges();
         return(RedirectToAction("MitigationCatList"));
     }
     return(View(cat));
 }
Exemplo n.º 3
0
 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));
 }