Beispiel #1
0
        public IList <ViewPost> GetViewPostTop()
        {
            //对图片路径做一个处理
            IList <ViewPost> viewPosts = DbSession.PostDal.GetViewPostsTop();

            viewPosts.ForEach(post => post.User.Head = ConvertPath.RelativeToAppLocation(post.User.Head));
            return(viewPosts);
        }
Beispiel #2
0
        public IList <ViewPost> GetViewPost(int pageindex, int boardid, out int pagecount)
        {
            int             pageSize = PageSize.Value;
            List <ViewPost> list     = DbSession.PostDal.GetViewPosts(pageindex, pageSize, boardid, out pagecount).ToList();

            list.ForEach((post) =>
            {
                post.User.Head = ConvertPath.RelativeToAppLocation(post.User.Head);
            });
            return(list);
        }
Beispiel #3
0
        public IList <ViewComment> GetViewCommentByPage(int postid, int pageindex, out int pagecount)
        {
            int pageSize            = PageSize.Value;
            List <ViewComment> list = DbSession.CommentDal.GetViewComments(postid, pageindex, pageSize, out pagecount).ToList();

            list.ForEach(x =>
            {
                x.User.Head = ConvertPath.RelativeToAppLocation(x.User.Head);
            });
            return(list);
        }
Beispiel #4
0
        public ViewUserInfo GetViewUserInfo(int userid)
        {
            ViewUserInfo model = DbSession.UserDal.GetViewUserInfo(userid);

            if (null == model)
            {
                throw new UserException("未找到该用户相关信息");
            }
            //转换路径
            model.User.Head = ConvertPath.RelativeToAppLocation(model.User.Head);
            return(model);
        }
Beispiel #5
0
        public ViewUser GetViewUser(UserSimp usersimp)
        {
            if (null == usersimp)
            {
                throw new ArgumentNullException("usersimp", "usersimp对象为null");
            }
            ViewUser viewUser = new ViewUser();

            viewUser.UserId   = usersimp.UserId;
            viewUser.UserName = usersimp.UserName;
            //这里要进行一次路径的转换
            viewUser.Head = ConvertPath.RelativeToAppLocation(usersimp.Head);
            return(viewUser);
        }