public ActionResult AddGroup(opr.Models.Group mod) { oprEntities dbgrp = new oprEntities(); dbgrp.Groups.Add(mod); dbgrp.SaveChanges(); return(View()); }
public ActionResult EditGroup(opr.Models.Group grp) { oprEntities groupData = new oprEntities(); groupData.Entry(grp).State = System.Data.Entity.EntityState.Modified; try { groupData.SaveChanges(); return(RedirectToAction("Index")); } catch { } ModelState.AddModelError("", "Unable to save changes made to the entity."); return(View(grp)); }