Пример #1
0
 /// <summary>
 /// Places a comment
 /// </summary>
 /// <param name="comment">The comment details</param>
 /// <param name="message">The message of the error</param>
 /// <returns>Success</returns>
 public bool Place(Commentdetails comment, out string message)
 {
     //Place comment
     Comment c = new Comment(0, comment.Description, MainUser.ID, comment.PostedToID, comment.PostDate);
     c.Create();
     message = "Comment placed";
     return true;
 }
Пример #2
0
 /// <summary>
 /// Edits a comment
 /// </summary>
 /// <param name="comment">The comment details</param>
 /// <param name="index">The index of the comment as loaded from the list</param>
 /// <param name="message">The message of the error</param>
 /// <returns>Success</returns>
 public bool Edit(Commentdetails comment, int commentIndex, out string message)
 {
     if (LoadedComments[commentIndex].PosterID == MainUser.ID)
     {
         //Edit comment
         message = "Comment aangepast";
         Comment c = new Comment(LoadedComments[commentIndex].PostID, comment.Description, MainUser.ID, comment.PostedToID, comment.PostDate);
         return true;
     }
     else
     {
         message = "U hebt geen rechten om deze comment aan te passen";
         return false;
     }
 }