Пример #1
0
        /// <summary>
        /// 根据部门查用户用户
        /// </summary>
        /// <param name="userByDepartSearchViewModel"></param>
        /// <returns></returns>
        public IQueryable <User_Info> GetUserByDepartAll(UserByDepartSearchViewModel userByDepartSearchViewModel)
        {
            int departId    = userByDepartSearchViewModel.User_DepartId;
            var queryResult = DbSet.Where(k => k.User_DepartId == departId && k.status == "0");

            return(queryResult);
        }
Пример #2
0
        /// <summary>
        /// 根据部门查用户用户
        /// </summary>
        /// <param name="userByDepartSearchViewModel"></param>
        /// <returns></returns>
        public IQueryable <User_Info> GetUserByDepartAll(UserByDepartSearchViewModel userByDepartSearchViewModel)
        {
            int    departId    = userByDepartSearchViewModel.User_DepartId;
            string username    = userByDepartSearchViewModel.userName;
            var    queryResult = DbSet.Where(k => k.User_DepartId == departId && k.status == "0" && k.UserName.Contains(username));

            return(queryResult);
        }
Пример #3
0
        /// <summary>
        /// 根据部门查用户
        /// </summary>
        /// <param name="userByDepartSearchViewModel"></param>
        /// <returns></returns>
        public List <User_Info> SearchUserInfoByDepartWhere(UserByDepartSearchViewModel userByDepartSearchViewModel)
        {
            int SkipNum     = userByDepartSearchViewModel.pageViewModel.CurrentPageNum * userByDepartSearchViewModel.pageViewModel.PageSize;
            int lineid      = userByDepartSearchViewModel.User_DepartId;
            var queryResult = DbSet.Where(k => k.User_DepartId == lineid && k.status == "0")
                              .Skip(SkipNum)
                              .Take(userByDepartSearchViewModel.pageViewModel.PageSize)
                              .ToList();

            return(queryResult);
        }
Пример #4
0
        /// <summary>
        /// 根据部门查用户
        /// </summary>
        /// <param name="userByDepartSearchViewModel"></param>
        /// <returns></returns>
        public List <UserSearchMiddlecs> User_By_Depart_Search(UserByDepartSearchViewModel userByDepartSearchViewModel)
        {
            List <User_Info>          Bus_Relate_Line = _IUserInfoRepository.SearchUserInfoByDepartWhere(userByDepartSearchViewModel);
            List <UserSearchMiddlecs> user_infos      = new List <UserSearchMiddlecs>();

            foreach (var item in Bus_Relate_Line)
            {
                var user_info_temp = _IMapper.Map <User_Info, UserSearchMiddlecs>(item);
                user_infos.Add(user_info_temp);
            }
            return(user_infos);
        }
        public ActionResult <UserByDepartSearchResModel> Manage_User_By_Depart_Search(UserByDepartSearchViewModel userByDepartSearchViewModel)
        {
            UserByDepartSearchResModel userByDepartSearchResModel = new UserByDepartSearchResModel();

            userByDepartSearchResModel.userInfo = _userService.User_By_Depart_Search(userByDepartSearchViewModel);

            userByDepartSearchResModel.IsSuccess                  = true;
            userByDepartSearchResModel.TotalNum                   = _userService.User_By_Depart_Get_ALLNum(userByDepartSearchViewModel);
            userByDepartSearchResModel.baseViewModel.Message      = "根据部门查用户成功";
            userByDepartSearchResModel.baseViewModel.ResponseCode = 200;
            //_ILogger.Information("根据部门查用户成功");
            return(Ok(userByDepartSearchResModel));
        }
Пример #6
0
 public int User_By_Depart_Get_ALLNum(UserByDepartSearchViewModel userByDepartSearchViewModel)
 {
     return(_IUserInfoRepository.GetUserByDepartAll(userByDepartSearchViewModel).Count());
 }