public async Task AddShipping(Shipping shipping)
 {
     await Task.Run(() =>
     {
         shipping.Id = OrderRepositoryHelper.GenerateString(10);
         UpdateOrder(shipping);
         _shippings.Add(shipping);
     });
 }
 public async Task AddReceiving(Receiving receiving)
 {
     await Task.Run(() =>
     {
         receiving.Id = OrderRepositoryHelper.GenerateString(10);
         UpdateOrder(receiving);
         _receivings.Add(receiving);
     });
 }
Example #3
0
        public async Task AddReceiving(Receiving receiving)
        {
            receiving.Id   = OrderRepositoryHelper.GenerateString(10);
            receiving.Type = "receiving";
            var postalCarrier = await GetPostalCarrierAsync(receiving.PostalCarrierId);

            receiving.PostalCarrier = postalCarrier;
            var stringData          = JsonConvert.SerializeObject(receiving, jsonSettings);
            var contentData         = new StringContent(stringData, System.Text.Encoding.UTF8, "application/json");
            HttpResponseMessage res = await _orderClient.PostAsync("/api/Receiving", contentData);

            res.EnsureSuccessStatusCode();
        }