Esempio n. 1
0
 /// <summary>
 /// 添加用户评论
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public int AddDiscussComment(DiscussComment model)
 {
     string sqltxt = @"INSERT  INTO qds157425440_db.dbo.DiscussComment
     ( UserName ,
       CContent ,
       SupportCount ,
       AgainstCount ,
       Cstatus ,
       UserID ,
       Did ,
       AddTime
     )
     VALUES  ( @UserName ,
       @CContent ,
       0 ,
       0 ,
       1 ,
       @UserID ,
       @Did ,
       GETDATE()
     )";
     SqlParameter[] paramter = {
                                   new SqlParameter("@UserName",model.UserName),
                                   new SqlParameter("@CContent",model.CContent),
                                   new SqlParameter("@UserID",model.UserID),
                                   new SqlParameter("@Did ",model.Did)
                               };
     int rowcount = helper.ExecuteSql(sqltxt, paramter);
     if (rowcount > 0)
     {
         UpdateDiscussCommentCount(model.Did);//增加评论数
     }
     return rowcount;
 }
 public ActionResult AddComment(string content, int did)
 {
     if (string.IsNullOrWhiteSpace(content))
     {
         return Json("0");
     }
     MemberInfo info = (MemberInfo)Session["member"];
     if (info == null)
     {
         return Json("-2");
     }
     DiscussComment model = new DiscussComment();
     model.UserID = info.MID;
     model.UserName = info.Name;
     model.CContent = content;
     model.Did = did;
     int result = dbll.AddDiscussComment(model);
     if (result > 0)
     {
         return Json("1");
     }
     else
         return Json("0");
 }
Esempio n. 3
0
 /// <summary>
 /// 添加用户评论
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public int AddDiscussComment(DiscussComment model)
 {
     return dal.AddDiscussComment(model);
 }