internal bool ApproveRejectUserReview(UserReviewRequestEntity ReviewRequest) { using (_httpClient = new HttpClient()) { string WebAPIURL = System.Configuration.ConfigurationManager.AppSettings["WebAPIURL"].ToString(); string apiMethod = "ApproveRejectUserReview"; string completeURL = WebAPIURL + apiMethod; StringContent httpContent = new StringContent(JsonConvert.SerializeObject(ReviewRequest), Encoding.UTF8, "application/json"); HttpResponseMessage response = _httpClient.PostAsync(completeURL, httpContent).Result; bool isApproveReject = false; if (response.IsSuccessStatusCode) { isApproveReject = JsonConvert.DeserializeObject <bool>(response.Content.ReadAsStringAsync().Result); return(isApproveReject); } else { return(isApproveReject); } } }
internal UserReviewsResponseEntity ViewReviewByID(UserReviewRequestEntity ReviewRequest) { using (_httpClient = new HttpClient()) { string WebAPIURL = System.Configuration.ConfigurationManager.AppSettings["WebAPIURL"].ToString(); string apiMethod = "GetUserReviewByReviewID"; string completeURL = WebAPIURL + apiMethod; StringContent httpContent = new StringContent(JsonConvert.SerializeObject(ReviewRequest), Encoding.UTF8, "application/json"); HttpResponseMessage response = _httpClient.PostAsync(completeURL, httpContent).Result; UserReviewsResponseEntity reviewResponseObj = new UserReviewsResponseEntity(); if (response.IsSuccessStatusCode) { reviewResponseObj = JsonConvert.DeserializeObject <UserReviewsResponseEntity>(response.Content.ReadAsStringAsync().Result); return(reviewResponseObj); } else { return(reviewResponseObj); } } }