示例#1
0
        public ActionResult AddReply(ArticleReply model)
        {
            ArticleReplyRepository repo = new ArticleReplyRepository();

            repo.Add(model);
            return(View("Article"));
        }
        public ActionResult ReplyArticleComments(int ArticleComID, ArticleReply replya)
        {
            int    aid       = Convert.ToInt32(Session["aid"]);
            string replytext = Request.Form["textarea1"];

            if (replytext == "")
            {
                return(Content("<script>;alert('回复不能为空');history.go(-1)</script>"));
            }
            else
            {
                int userid = Convert.ToInt32(Session["UserID"]);
                replya.ArticleComID = ArticleComID;
                replya.UserID       = userid;
                replya.ReplyContent = replytext;
                replya.ReplyTime    = DateTime.Now;
                articlereplymanager.AddArticleReply(replya);
            }
            return(RedirectToAction("ArticleDetails", "ArticleShow", new { id = aid }));
        }
示例#3
0
        public ArticleReply GetShiReplyById(int?id)
        {
            ArticleReply articleReply = iarticleReply.GetArticleReplyById(id);

            return(articleReply);
        }
示例#4
0
 public void AddArticleReply(ArticleReply articleReply)
 {
     iarticleReply.AddArticleReply(articleReply);
 }
示例#5
0
        public ArticleReply GetArticleReplyById(int?id)
        {
            ArticleReply articleReply = db.ArticleReply.Find(id);

            return(articleReply);
        }
示例#6
0
 public void AddArticleReply(ArticleReply articleReply)
 {
     db.ArticleReply.Add(articleReply);
     db.SaveChanges();
 }