Ejemplo n.º 1
0
 public bool Insert(Comment model)
 {
     if (model != null)
     {
         if (_DataBase.InsertModel<Comment>(model))
             return true;
         return false;
     }
     return false;
 }
Ejemplo n.º 2
0
 public ActionResult Insert(string content, string articleId)
 {
     Comment model = new Comment()
     {
         Id = Guid.NewGuid().ToString("N"),
         ArticleId = articleId,
         ParentId = "0",
         Content = content,
         CreateTime = DateTime.Now,
         ModifyTime = DateTime.Now
     };
     if (CUR_USER != null)
     {
         model.UserId = CUR_USER.Id;//评论者ID
         model.CreateUser = CUR_USER.UserName;
         model.ModifyUser = CUR_USER.UserName;
     }
     if (_ICommentService.Insert(model))
     {
         return new ActionReturn(true, "评论成功!", null);
     }
     return new ActionReturn(false, "评论失败!", null);
 }
Ejemplo n.º 3
0
 public int Update(Comment model)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 4
0
 public bool Insert(Comment model)
 {
     return _ICommentDao.Insert(model);
 }
Ejemplo n.º 5
0
 public ActionResult Reply(string content, string articleId, string parentId = "0")
 {
     if (CUR_USER != null)
     {
         Comment model = new Comment()
         {
             Id = Guid.NewGuid().ToString("N"),
             ArticleId = articleId,
             UserId = CUR_USER.Id,//回复者ID
             ParentId = parentId,
             Content = content,
             CreateUser = CUR_USER.UserName,
             CreateTime = DateTime.Now,
             ModifyUser = CUR_USER.UserName,
             ModifyTime = DateTime.Now
         };
         if (_ICommentService.Insert(model))
         {
             return new ActionReturn(true, "回复成功!", null);
         }
         return new ActionReturn(false, "回复失败!", null);
     }
     return new ActionReturn(false, "请先登录!", null);
 }