예제 #1
0
        public async Task <ActionResult> UpdateReview(string restInfo)
        {
            if (!string.IsNullOrWhiteSpace(restInfo))
            {
                Models.RestaurantInfo restaurantInfo =
                    JsonConvert.DeserializeObject <Models.RestaurantInfo>(restInfo);
                RestaurantReviewService.RestaurantInfo info = new RestaurantReviewService.RestaurantInfo();
                info.Name                = restaurantInfo.Name;
                info.Summary             = restaurantInfo.Summary;
                info.Rating              = restaurantInfo.Rating.ToString();
                info.Location            = new RestaurantReviewService.Address();
                info.Location.Street     = restaurantInfo.Location.Street;
                info.Location.City       = restaurantInfo.Location.City;
                info.Location.Province   = restaurantInfo.Location.Province;
                info.Location.PostalCode = restaurantInfo.Location.PostalCode;

                RestaurantReviewService.RestaurantServiceClient reviewer = new RestaurantReviewService.RestaurantServiceClient();

                if (await reviewer.SaveRestaurantAsync(info))
                {
                    return(Json("Updated restaurant review has been saved!"));
                }
            }
            return(Json("No data received!"));
        }
예제 #2
0
 public System.Threading.Tasks.Task <bool> SaveRestaurantAsync(RestaurantReviewService.RestaurantInfo restInfo)
 {
     return(base.Channel.SaveRestaurantAsync(restInfo));
 }