예제 #1
0
 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;
 }
예제 #2
0
 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;
 }
예제 #3
0
 public UserListModel InitializeSelectUserByDepartmentsModel(UserQueryItem queryItem)
 {
     var model = new UserListModel();
     var users = _userRepository.Query(queryItem);
     model.Users = users;
     model.UserSearchModel.UserQueryItem = queryItem;
     return model;
 }
예제 #4
0
 public UserSearchModel()
 {
     UserQueryItem=new UserQueryItem();
 }