public ActionResult Create(VM.RoleInfoItem model, List <ModulePermission> ModulePermissions) { BL.RoleInfo empBL = new BL.RoleInfo(); if (empBL.ValidateName(-1, model.Name)) { return(Content(ResourceHelper.GetValue("SMM_RoleInfo_NameExists"))); } if (empBL.ValidateModulePermissions(ModulePermissions)) { return(Content(ResourceHelper.GetValue("SMM_RoleInfo_AddPermissions"))); } model.CreatedBy = UserHelper.GetCurrentUser().LogonName; empBL.Create(model, ModulePermissions); //CacheDependencyHelper.Change(new string[] { BasicParam.RolePermissionCacheKey }); return(Content("Success")); }
public ActionResult Edit(VM.RoleInfoItem model, List <ModulePermission> ModulePermissions, string allSelectList, int currRoleId, string deleteUserIds) { BL.RoleInfo empBL = new BL.RoleInfo(); BL.UserInfo userBL = new BL.UserInfo(); if (empBL.ValidateName(model.RoleId, model.Name)) { return(Content(ResourceHelper.GetValue("SMM_RoleInfo_NameExists"))); } if (empBL.ValidateModulePermissions(ModulePermissions)) { return(Content(ResourceHelper.GetValue("SMM_RoleInfo_AddPermissions"))); } //empBL.e(model); model.UpdatedBy = UserHelper.GetCurrentUser().LogonName; empBL.Update(model, ModulePermissions); userBL.UpdateUserRole(allSelectList, currRoleId, deleteUserIds, model.UpdatedBy); //CacheDependencyHelper.Change(new string[] { BasicParam.RolePermissionCacheKey }); return(Content("Success")); }