Example #1
0
        public async Task <JObject> AdjustPrice(Bike.AdjustPrice adjustPrice)
        {
            try
            {
                string      distributorId = ObjectId.Parse(adjustPrice.DistributorId).ToString();
                string      bikeId        = ObjectId.Parse(adjustPrice.BikeId).ToString();
                List <Line> inventory     = ReturnInventoryForDistributor(distributorId);
                //find the correct bike to adjust price
                foreach (var line in inventory.Where(line => line.Bike.Id == bikeId))
                {
                    line.Bike.Price = adjustPrice.NewPrice;
                }

                return(await this.UpdateInventoryList(adjustPrice.DistributorId, inventory));
            }
            catch (Exception ex)
            {
                return
                    (JObject.FromObject(
                         new
                {
                    status = "Exception Thrown",
                    result = false,
                    message = ex.Message
                }
                         ));
            }
        }
Example #2
0
 public async Task <JObject> AdjustPrice(Bike.AdjustPrice adjustprice)
 {
     return(await _lineServiceClient.AdjustPrice(adjustprice));
 }
Example #3
0
 public Task <JObject> AdjustPrice(Bike.AdjustPrice adjustPrice)
 {
     return(_inventoryServiceClient.AdjustPrice(adjustPrice));
 }