internal void AddComment(string comment)
 {
     Comment c = new Comment();
     c.Body = comment;
     c.CommentByAccountID = _webContext.CurrentUser.AccountID;
     c.CommentByUsername = _webContext.CurrentUser.Username;
     c.CreateDate = DateTime.Now;
     c.SystemObjectID = _view.SystemObjectID;
     c.SystemObjectRecordID = _view.SystemObjectRecordID;
     Comment.SaveComment(c);
     //  _view.ClearComments();
     // LoadComments();
 }
Exemple #2
0
 public List<Comment> AddComment(Comment data)
 {
     if (IsValid())
     {
         IUserSession userSession = ObjectFactory.GetInstance<IUserSession>();
         data.CommentByAccountID = userSession.CurrentUser.AccountID;
         data.CommentByUsername = userSession.CurrentUser.Username;
         data.CreateDate = DateTime.Now;
         long commentID = Comment.SaveComment(data);
         List<Comment> list = Comment.Find(x => x.CommentID == commentID);
         list.ForEach(x => x.AuthorCanDelete = true);
         return list;
     }
     return new List<Comment>();
 }
Exemple #3
0
 public static long SaveComment(Comment comment)
 {
     if (comment.CommentID > 0)
     {
         Update(comment);
     }
     else
     {
         Add(comment);
     }
     return comment.CommentID;
 }
Exemple #4
0
 public static void DeleteComment(Comment comment)
 {
     Delete(comment.CommentID);
 }