Ejemplo n.º 1
0
        public List <UserOut> GetAllUserList(UserOut model)
        {
            //
            var queue = _userInfoRepository.GetAll();

            if (model != null && !string.IsNullOrEmpty(model.UserCode))
            {
                queue = queue.Where(w =>
                                    w.UserCode.Contains(model.UserCode) ||
                                    w.UserNameCn.Contains(model.UserCode)
                                    );
            }
            queue = queue.OrderBy(o => o.UserNameCn);
            return(ObjectMapper.Map <List <UserOut> >(queue.ToList()));
        }
Ejemplo n.º 2
0
        public UserOut GetUserModel(long id)
        {
            //禁用过滤器
            using (_unitOfWorkManager.Current.DisableFilter(AbpDataFilters.SoftDelete))
            {
                //获取用户数据
                UserInfo model = _userInfoRepository.Get(id);
                UserOut  data  = ObjectMapper.Map <UserOut>(model);
                //获取用户扩展的数据
                data.UserInfoEx = _userInfoExtens.GetUserModel(id);

                //此处添加超级管理员判断,删除的用户仅超级管理员可以查看
                if (!AbpSession.IsAdmin && data.IsDeleted)
                {
                    return(new UserOut());
                }
                else
                {
                    return(data);
                }
            }
        }