예제 #1
0
        /// <summary>
        /// 获取评论分页数据
        /// </summary>
        /// <returns></returns>
        public string GetCommentPageList()
        {
            try
            {
                int        cid       = Convert.ToInt32(Request["cid"]);
                int        pageIndex = Convert.ToInt32(Request["pageIndex"] ?? "1");
                int        pageSize  = Convert.ToInt32(Request["pageSize"] ?? "5");
                ContentBLL bll       = new ContentBLL();

                SessionInfo info   = (SessionInfo)Session["sessionInfo"];
                int         userid = 0;
                if (info != null)
                {
                    userid = info.userModel.Id;
                }
                ContentPageModel <CommentModel> list = bll.GetCommentPageList(cid, pageIndex, pageSize, userid);
                list.pageThis = pageIndex;
                var res = JsonConvert.SerializeObject(list);
                return("success:" + res.ToString());
            }
            catch (Exception ex)
            {
                Log.WriteFile(ex);
                return("faliure:失败");
            }
        }