public UserListModel InitializeUserListModel(UserQueryItem userQueryItem) { var model = new UserListModel(); model.Users = _userRepository.Query(userQueryItem); model.UserSearchModel.UserQueryItem = userQueryItem; var roleUserRepository = new RoleUserRepository(); model.RoleUsers = roleUserRepository.GetRoleUsersByUserIds(model.Users.Select(o => o.Id)); return model; }
public SelectedUsersResponse InitializeSelectedUsersResponse(SelectedUsersModel selectedUsersModel) { var model = new SelectedUsersResponse(); var queryItem = new UserQueryItem(); queryItem.Pagination.PageSize = 100; if (selectedUsersModel.CheckedAllPage) { queryItem.DepartmentLikeId = selectedUsersModel.WhereOptions.DepartmentLikeId; queryItem.Name = selectedUsersModel.WhereOptions.Name; } else { if (!selectedUsersModel.Ids.Any()) return model; queryItem.Ids = selectedUsersModel.Ids; } queryItem.UnitId = selectedUsersModel.UnitId; _userRepository.Query(queryItem).ToList().ForEach(user => model.UserViewModels.Add(new UserViewModel() { Id = user.Id, Name = user.Name })); return model; }
public UserListModel InitializeSelectUserByDepartmentsModel(UserQueryItem queryItem) { var model = new UserListModel(); var users = _userRepository.Query(queryItem); model.Users = users; model.UserSearchModel.UserQueryItem = queryItem; return model; }
public UserSearchModel() { UserQueryItem=new UserQueryItem(); }