Пример #1
0
 public ActionResult Edit(Role role)
 {
     if (ModelState.IsValid)
     {
         roleRepo.Update(role);
         roleRepo.Save();
         return Json(new { success = true });
     }
     return PartialView("Edit", role);
 }
Пример #2
0
 public JsonResult Create(Role role)
 {
     if (ModelState.IsValid)
     {
         roleRepo.Insert(role);
         roleRepo.Save();
         return Json(new { success = true });
     }
     return Json(role, JsonRequestBehavior.AllowGet);
 }
Пример #3
0
 public ActionResult Create()
 {
     var role = new Role();
     return PartialView("Create", role);
 }
Пример #4
0
 public void Delete(Role entity)
 {
     context.Roles.Remove(entity);
 }
Пример #5
0
 public void Update(Role entity)
 {
     context.Entry(entity).State = System.Data.Entity.EntityState.Modified;
 }
Пример #6
0
 public void Insert(Role entity)
 {
     context.Roles.Add(entity);
 }