コード例 #1
0
        public bool DeleteReview(long resourceId, long reviewId)
        {
            var dataReview = new DataClassReview();
            var bResult    = dataReview.DeleteReview(resourceId, reviewId);

            if (!bResult)
            {
                SetResponseStatus(HttpStatusCode.InternalServerError, "Unable to delete review");
            }
            return(bResult);
        }
コード例 #2
0
        public long?AddReview(long resourceId, ApiClassReview review)
        {
            var dataReview = new DataClassReview();
            var lResult    = dataReview.SaveReview(resourceId, review);

            if (lResult == null)
            {
                SetResponseStatus(HttpStatusCode.InternalServerError, "Unable to add review");
            }
            return(lResult);
        }
コード例 #3
0
        public bool UpdateReview(long resourceId, long reviewId, ApiClassReview review)
        {
            review.ID = review.ID;
            var dataReview = new DataClassReview();
            var bResult    = dataReview.UpdateReview(resourceId, reviewId, review);

            if (!bResult)
            {
                SetResponseStatus(HttpStatusCode.InternalServerError, "Unable to update review");
            }
            return(bResult);
        }
コード例 #4
0
        public List <ApiClassReview> GetReviews(long resourceId)
        {
            var reviews = new List <ApiClassReview>();

            try
            {
                var dataReview = new DataClassReview();
                dataReview.LoadReviewList(resourceId, reviews);
            }
            catch
            {
                reviews.Clear();
            }

            return(reviews);
        }