コード例 #1
0
    /// <summary>
    /// Helper checks to see if user already reviewed image
    /// </summary>
    /// <param name="userName">a userName</param>
    /// <returns>bool true/false value</returns>
    private bool HasUserPreviouslyReviewedImage(string userName)
    {
        // Load reviews
        TravelImageRatingCollection col = new TravelImageRatingCollection();

        col.FetchForImage(_imageID);

        // Check if user already review
        foreach (TravelImageRating review in col)
        {
            if (review.UserName.Equals(userName))
            {
                return(true);
            }
        }
        return(false);
    }
コード例 #2
0
 /// <summary>
 /// Loads reviews for a particular image id
 /// </summary>
 private void LoadNewAdditionReviews()
 {
     _collectionReview = new TravelImageRatingCollection();
     _collectionReview.FetchTop(2, false);
 }
コード例 #3
0
 /// <summary>
 /// Loads reviews for a particular image id
 /// </summary>
 private void LoadReviews()
 {
     _collectionReview = new TravelImageRatingCollection();
     _collectionReview.FetchForImage(_imageID);
 }