Exemple #1
0
        public IActionResult Grid(WebApplicationSearchModel model)
        {
            model = InitializeModel(model);
            var result = _employeeFacadeApiClient.GetWebApplications(model).Result;

            return(PartialView(result));
        }
Exemple #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);
        }
Exemple #3
0
        private CalendarSearchModel GetCalendarTaskModel(UserPersonTaskDto userPersonTask = null)
        {
            var model = new UserSearchModel {
                PageSize = int.MaxValue
            };

            model = _employeeFacadeApiClient.GetUsers(model).Result;
            //var personSearch = new PersonSearchModel { PageSize = int.MaxValue };
            //personSearch = _personApiClient.GetPersons(personSearch).Result;
            var taskTypeSearchmodel = new TaskTypeSearchModel {
                PageSize = int.MaxValue
            };

            taskTypeSearchmodel = _taskTypeApiClient.GetTaskTypes(taskTypeSearchmodel).Result;
            var selectedTaskTypeId = taskTypeSearchmodel.TaskTypeSearchResult.FirstOrDefault(x => x.Name == userPersonTask?.TaskTypeSelected)?.Id;
            var taskTypes          = taskTypeSearchmodel.TaskTypeSearchResult?.ConvertAll(x => (BaseLookupDto)x);

            var applications = new WebApplicationSearchModel {
                PageSize = int.MaxValue
            };

            applications = _employeeFacadeApiClient.GetWebApplications(applications).Result;



            var userCalendarModel = new CalendarSearchModel
            {
                ApplicationList = SelectedListHelper.GetApplicationSelectList(applications.WebApplicationSearchResult, userPersonTask?.ApplicationId.ToString()),
                EmployeeList    = SelectedListHelper.GetUserSelectList(model.UserSearchResult, userPersonTask?.UserId.ToString()),
                TaskTypes       = taskTypeSearchmodel.TaskTypeSearchResult,
                TaskTypeList    = SelectedListHelper.GetSelectListForItems(taskTypes, selectedTaskTypeId?.ToString()),
                TaskTypeId      = selectedTaskTypeId,
                //PersonList = SelectedListHelper.GetPersonSelectList(personSearch.PersonSearchResult, userPersonTask?.PersonId.ToString())
            };

            return(userCalendarModel);
        }