Esempio n. 1
0
        public async Task <IActionResult> RoleGrid(RoleSearchModel model)
        {
            model = InitializeRoleModel(model, model.ApplicationId);
            var result = await _employeeFacadeApiClient.GetRoles(model);

            return(PartialView(result));
        }
Esempio n. 2
0
        private UserDto PopulateRolesForUser(UserDto model, int applicationId, int userId)
        {
            var searchUserApplicationRoles = new UserApplicationRoleSearchModel {
                PageSize = int.MaxValue, SortColumn = "Role/Role/RoleName", SortDirection = "Asc", ApplicationId = applicationId, UserId = userId
            };

            searchUserApplicationRoles = _employeeApiClient.GetUserApplicationRoles(searchUserApplicationRoles).Result;
            var searchRoles = new RoleSearchModel {
                PageSize = int.MaxValue, SortColumn = "RoleName", SortDirection = "Asc", ApplicationId = applicationId
            };

            searchRoles          = _employeeApiClient.GetRoles(searchRoles).Result;
            model.RoleSelectList = SelectedListHelper.GetApplicationRolesSelectList(searchRoles.RoleSearchResult, searchUserApplicationRoles.UserApplicationRoleSearchResult.Select(x => x.Role.Id).ToList());
            return(model);
        }