Example #1
0
 public ActionResult FindComment()
 {
     try
     {
         var list = CMS_Comment_BLL.Find();
         return(Json(list));
     }
     catch (Exception error)
     {
         throw error;
     }
 }
        //文章内容
        public ActionResult LaceMian(int id = 0)
        {
            try
            {
                if (id == 0)
                {
                    Response.Redirect("/Front/Home/Index");
                }
                else
                {
                    //查找文章
                    ArticleMain_View artFilter = new ArticleMain_View();
                    artFilter.aid = id;
                    var listArticle = CMS_Article_BLL.Find(artFilter);
                    ViewBag.articleList = listArticle;
                    //查账该文章的评论数
                    CMS_Comment comFilter = new CMS_Comment();
                    comFilter.aid = id;
                    var countCommentSum = CMS_Comment_BLL.FindCommentSum(comFilter);
                    if (countCommentSum == 0)
                    {
                        ViewBag.commentSumCount = 0;
                    }
                    else
                    {
                        ViewBag.commentSumCount = countCommentSum;
                    }
                    //查找该文章的评论
                    CommentMain_View comView = new CommentMain_View();
                    comView.aid = id;
                    var listComment = CMS_Comment_BLL.Find(comView);
                    ViewBag.commentList = listComment;

                    if (Session["userID"] != null)
                    {
                        ViewBag.userID = Session["userID"].ToString();
                    }
                    else
                    {
                        ViewBag.userID = "0";
                    }
                }
            }
            catch (Exception error)
            {
                throw error;
            }

            return(View());
        }
 public ActionResult Find(int rows, int page, int uid = 0, int aid = 0)
 {
     try
     {
         CommentMain_View comFilter = new CommentMain_View();
         if (uid > 0)
         {
             comFilter.uid = uid;
         }
         if (aid > 0)
         {
             comFilter.aid = aid;
         }
         Pagination pagination = CMS_Comment_BLL.Find(comFilter, rows, page);
         return(Json(pagination, JsonRequestBehavior.AllowGet));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }