예제 #1
0
        public ActionResult PostsDetails(int PostID, int?page)
        {
            const int pagesize = 10;
            int       pageNum  = (page ?? 1);

            Session["PostID"] = PostID;
            TribunePostVM tribunePost = new TribunePostVM();

            tribunePost.Posts       = PostM.GetPostDetails(PostID);
            tribunePost.PostComment = PostM.GetPostComments(PostID).ToPagedList(pageNum, pagesize);
            if (Session["UserName"] != null)
            {
                string UserName = Session["UserName"].ToString();
                tribunePost.UserInfo = PostM.SelectUserInfo(UserName);
            }
            return(View(tribunePost));
        }