Ejemplo n.º 1
0
 public string DeleteCommentNews(int id)
 {
     if (id > 0)
     {
         CommentNewsManage.DeleteCommend(id);
         return("success");
     }
     else
     {
         return("fail");
     }
 }
Ejemplo n.º 2
0
        public ActionResult SelectNewsReply(int id)
        {
            var repluy = CommentNewsManage.FindAllReply(id);

            if (repluy == null)
            {
                return(HttpNotFound());
            }
            ViewModels.Cnpagelist indew = new Cnpagelist();
            indew.FindAllReply = repluy;

            return(View(indew));
        }
Ejemplo n.º 3
0
        public string AddCommentNews(CommentNews commnews, string newcontent, int id)
        {
            var useid = Convert.ToInt32(Session["User_id"]);


            if (newcontent != null && newcontent.Length > 0)
            {
                commnews.User_id = useid;
                commnews.News_id = id;
                commnews.Content = newcontent;
                CommentNewsManage.AddComment(commnews);
                return("success");
            }
            else
            {
                return("fail");
            }
        }
Ejemplo n.º 4
0
        public string AddReplyNews(ReplyNews replynew, string conntent, string id, string commuser)
        {
            var comnid = Convert.ToInt32(id);
            var userid = Convert.ToInt32(Session["User_id"]);

            if (!string.IsNullOrEmpty(conntent))
            {
                replynew.Content         = conntent;
                replynew.CommentNews_id  = comnid;
                replynew.CommentUserName = commuser;
                replynew.User_id         = userid;
                CommentNewsManage.AddReplyNews(replynew);
                return("success");
            }
            else
            {
                return("fail");
            }
        }
Ejemplo n.º 5
0
        public ActionResult Detail(int id)
        {
            var detail  = NewsManage.FindDetailNews(id);
            var commend = CommentNewsManage.FindAllComment(id);
            var pre     = NewsManage.FindPreNews(id);

            if (pre == null)
            {
                return(Content("<script>;alert('到顶了!');</script>"));
            }
            var next = NewsManage.FindNextNews(id);

            if (next == null)
            {
                return(Content("<script>;alert('到底了!');</script>"));
            }
            ViewBag.coutcommend = CommentNewsManage.Countmiti(id);
            ViewModels.Cnpagelist index = new ViewModels.Cnpagelist();
            index.FindDetailNews = detail;
            index.FindPreNews    = pre;
            index.FindNextNews   = next;
            index.FindAllComment = commend;
            return(View(index));
        }