示例#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);
        }