Пример #1
0
        //[AuthAttribute(Code = "member")]
        public ActionResult LoadComment(int goods_id, int?page, int?size)
        {
            page = page == null ? 1 : page;
            size = size == null ? 10 : size;
            int total = 0;                                       //定义变量接收评论总数
            List <NS_Goods_Appraisal> commentList        = null; //定义变量接收评论集合
            List <NS_Goods_Appraisal> currentCommentList = null; //定义变量接收当前页的评论内容

            //获取商品评论信息
            commentList = commenthandler.LoadCommentListByGoods(goods_id);
            if (commentList != null)
            {
                total = commentList.Count;
            }
            currentCommentList = commenthandler.LoadCommentListByGoods(page, size, goods_id);
            DataPager <NS_Goods_Appraisal> pager = new DataPager <NS_Goods_Appraisal>(total, currentCommentList, (int)page, (int)size, (int)0, "/Comment/LoadComment", "#comment_list", "&goods_id=" + goods_id);
            string data = pager.InitPager();

            ViewBag.Data = new MvcHtmlString(data);
            //获取
            return(View(currentCommentList));
        }