예제 #1
0
        public IActionResult Grid(UserGroupSearchModel model)
        {
            model = InitializeModel(model);
            var result = _employeeFacadeApiClient.GetUserGroups(model).Result;

            return(PartialView(result));
        }
예제 #2
0
        private UserDto GetUserForDetails(int userId, bool loadManager)
        {
            var userSearchModel = new UserSearchModel {
                PageSize = int.MaxValue, SortColumn = "Name"
            };
            var user = _employeeApiClient.GetUser(userId).Result;

            if (loadManager)
            {
                var managers = _employeeApiClient.GetUsers(userSearchModel).Result.UserSearchResult.Where(x => x.Id != userId).ToList();
                user.ManagerSelectList = SelectedListHelper.GetSelectListForManager(managers, user.ManagerId?.ToString());
            }
            var linkedUserApplicationIds = user.Applications.Select(x => x.ApplicationId).ToList();
            var userGroupSearch          = new UserGroupSearchModel {
                PageSize = int.MaxValue, SortColumn = "Name"
            };

            userGroupSearch          = _employeeApiClient.GetUserGroups(userGroupSearch).Result;
            user.UserGroupSelectList = SelectedListHelper.GetSelectListForUserGroup(userGroupSearch.UserGroupSearchResult, user.UserGroupId?.ToString());

            var searchWebApplication = new WebApplicationSearchModel {
                PageSize = int.MaxValue, SortColumn = "Name", SortDirection = "Asc"
            };

            searchWebApplication          = _employeeApiClient.GetWebApplications(searchWebApplication).Result;
            user.ApplicationSelectList    = SelectedListHelper.GetApplicationTaskSelectList(searchWebApplication.WebApplicationSearchResult, linkedUserApplicationIds);
            user.LinkedUserApplicationIds = linkedUserApplicationIds.Select(x => x.ToString()).ToList();
            return(user);
        }