public bool DeleteRole(Role entity) { if (entity == null) return false; _unitOfWork.RoleRepository.Delete(entity); _unitOfWork.Save(); return true; }
public ActionResult Create(Role role) { if (ModelState.IsValid)//testing(role))// { _roleService.AddRole(role); return Json(new { success = true }); } ViewBag.UserProfileID = new SelectList(_roleService.GetAllRole(), "RoleID", "RoleID", role.RoleID); return PartialView(BindRoleModel(role)); }
private RoleModel BindRoleModel(Role role) { RoleModel roleModel = new RoleModel { Description = role.Description, Name = role.Name, RoleID = role.RoleID, SortOrder = role.SortOrder }; return roleModel; }
public bool testing(Role role) { return TryValidateModel(role); }
public ActionResult Edit(Role role) { if (ModelState.IsValid) { _roleService.EditRole(role); return Json(new { success = true }); } ViewBag.UserProfileID = new SelectList(_roleService.GetAllRole(), "RoleID", "RoleID", role.RoleID); return PartialView("Edit", role); }
public static void AddRole(Role role) { //CTSContext entities = new CTSContext(); //entities.Roles.Add(role); //entities.SaveChanges(); }
public bool EditRole(Role entity) { _unitOfWork.RoleRepository.Edit(entity); _unitOfWork.Save(); return true; }
public bool AddRole(Role entity) { _unitOfWork.RoleRepository.Add(entity); _unitOfWork.Save(); return true; }