Пример #1
0
 private async void BtnAddDelivery_Click(object sender, EventArgs e)
 {
     var delivery = new Delivery()
     {
         DeliveryDate = DateTime.Now,
         ReferenceNum = Guid.NewGuid().ToString(),
         Description  = "Delivery 1",
         TotalWeight  = 110,
         Splits       = new List <Split>()
         {
             new Split()
             {
                 Id           = Guid.NewGuid().ToString(),
                 Description  = "Split 1",
                 Quantity     = 10,
                 Weight       = 50,
                 GarmentCount = 1000,
                 Steps        = new List <Step>()
                 {
                     new Step()
                     {
                         Id = Guid.NewGuid().ToString(), Date = DateTime.Now.Date, Location = "Ho Chi Minh"
                     },
                     new Step()
                     {
                         Id = Guid.NewGuid().ToString(), Date = DateTime.Now.Date, Location = "Ha Noi"
                     }
                 }
             },
             new Split()
             {
                 Id           = Guid.NewGuid().ToString(),
                 Description  = "Split 2",
                 Quantity     = 20,
                 Weight       = 80,
                 GarmentCount = 2000,
                 Steps        = new List <Step>()
                 {
                     new Step()
                     {
                         Id = Guid.NewGuid().ToString(), Date = DateTime.Now.Date, Location = "Da Nang"
                     },
                     new Step()
                     {
                         Id = Guid.NewGuid().ToString(), Date = DateTime.Now.Date, Location = "Can Tho"
                     }
                 }
             },
         }
     };
     var deliveryService = new DeliveryService();
     var result          = await deliveryService.AddDeliveryAsync(delivery);
 }