示例#1
0
        public HttpResponseMessage GetUserInfo([FromUri] UserInfoGetRequest eugRequest)
        {
            var result = _userInfoService.GetUserInfo(eugRequest);
            var list   = new PageList <UserCenterInfoResponse>()
            {
                PageIndex  = eugRequest.pageIndex == null ? ConstKeys.DEFAULT_PAGEINDEX : eugRequest.pageIndex.Value,
                PageSize   = result.PageSize,
                TotalCount = result.TotalCount,
                TotalPages = result.TotalPages,
                Data       = result.ToList()
            };

            return(toListJson(list, OperatingState.Success, "获取成功"));
        }
示例#2
0
        public async Task <UserInfoDto> DisplayUserInfo(string userName)
        {
            var userInfo = await _userInfo.GetUserInfo(userName);

            var userInfoDto = _mapper.Map <UserInfoDto>(userInfo);

            return(userInfoDto);
        }
示例#3
0
        public UserInfo GetUserInfoById(int UserInfoId)
        {
            OdbcConnection   conn;
            IList <UserInfo> UserInfo;

            SearchCondition[] condition = new SearchCondition[] { new SearchCondition {
                                                                      con = "id=?", param = "@id", value = UserInfoId.ToString()
                                                                  } };
            using (conn = OdbcHelper.CreateConntion())
            {
                conn.Open();
                UserInfo = UserInfoDal.GetUserInfo(condition, conn);
                if (UserInfo.Count > 0)
                {
                    return(UserInfo[0]);
                }
                conn.Close();
                return(null);
            }
        }