//回复评论 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 })); }
/// <summary> /// 增加回复评论 /// </summary> /// <param name="NewsReply"></param> public void AddNewsReply(ReComment NewsReply) { db.ReComment.Add(NewsReply); db.SaveChanges(); }
/// <summary> /// 回复评论 /// </summary> /// <param name="NewsReply"></param> public void AddNewsReply(ReComment NewsReply) { iReComments.AddNewsReply(NewsReply); }
/// <summary> /// 根据ID得到新闻评论 /// </summary> /// <param name="id"></param> /// <returns></returns> public ReComment GetNewsReComById(int?id) { ReComment recomments = db.ReComment.Find(id); return(recomments); }
/// <summary> /// 根据ID得到新闻评论 /// </summary> /// <param name="id"></param> /// <returns></returns> public ReComment GetNewsReComById(int?id) { ReComment newRecom = iReComments.GetNewsReComById(id); return(newRecom); }