예제 #1
0
 /// <summary>
 /// Places a review
 /// </summary>
 /// <param name="review">The review details</param>
 /// <param name="message">The message of the error</param>
 /// <returns>Success</returns>
 public bool Place(Reviewdetails review, out string message)
 {
     if (MainUser.ID != review.PostedToID)
     {
         //Place review
         Review r = new Review(0, review.Rating, MainUser.ID, review.PostedToID, review.Description);
         r.Create();
         message = "Review succesvol geplaatst";
         return true;
     }
     else
     {
         message = "Het is niet mogelijk om een review te plaatsen op uzelf!";
         return false;
     }
 }
예제 #2
0
 /// <summary>
 /// Edits a review
 /// </summary>
 /// <param name="review">The review details</param>
 /// <param name="reviewIndex">The index of the review as loaded in the list</param>
 /// <param name="message">The message of the error</param>
 /// <returns>Success</returns>
 public bool Edit(Reviewdetails review, int reviewIndex, out string message)
 {
     if (LoadedReviews[reviewIndex].PosterID == MainUser.ID)
     {
         //TODO: validate details
         //Edit review
         Review r = new Review(LoadedReviews[reviewIndex].PostID, review.Rating, MainUser.ID, review.PostedToID, review.Description);
         r.Update();
         message = "Review aangepast!";
         return true;
     }
     else
     {
         message = "U hebt niet de rechten om deze review aan te passen";
         return false;
     }
 }