public ActionResult Edit(Role role) { if (ModelState.IsValid) { roleRepo.Update(role); roleRepo.Save(); return Json(new { success = true }); } return PartialView("Edit", role); }
public JsonResult Create(Role role) { if (ModelState.IsValid) { roleRepo.Insert(role); roleRepo.Save(); return Json(new { success = true }); } return Json(role, JsonRequestBehavior.AllowGet); }
public ActionResult Create() { var role = new Role(); return PartialView("Create", role); }
public void Delete(Role entity) { context.Roles.Remove(entity); }
public void Update(Role entity) { context.Entry(entity).State = System.Data.Entity.EntityState.Modified; }
public void Insert(Role entity) { context.Roles.Add(entity); }