Esempio n. 1
0
        //回复评论
        public ActionResult ReplyNewsComments(int NewsComID, ReComment 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.ComID        = NewsComID;
                replya.UserID       = userid;
                replya.ReComContent = replytext;
                replya.ReComTime    = DateTime.Now;
                //评论回复
                renew.AddNewsReply(replya);
            }
            return(RedirectToAction("ArticleDetails", "ArticleShow", new { id = aid }));
        }
Esempio n. 2
0
 /// <summary>
 /// 增加回复评论
 /// </summary>
 /// <param name="NewsReply"></param>
 public void AddNewsReply(ReComment NewsReply)
 {
     db.ReComment.Add(NewsReply);
     db.SaveChanges();
 }
Esempio n. 3
0
 /// <summary>
 /// 回复评论
 /// </summary>
 /// <param name="NewsReply"></param>
 public void AddNewsReply(ReComment NewsReply)
 {
     iReComments.AddNewsReply(NewsReply);
 }
Esempio n. 4
0
        /// <summary>
        /// 根据ID得到新闻评论
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ReComment GetNewsReComById(int?id)
        {
            ReComment recomments = db.ReComment.Find(id);

            return(recomments);
        }
Esempio n. 5
0
        /// <summary>
        /// 根据ID得到新闻评论
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ReComment GetNewsReComById(int?id)
        {
            ReComment newRecom = iReComments.GetNewsReComById(id);

            return(newRecom);
        }