/// <summary>
            /// Used to get the shipment options for a shipment of @nrOfPackages, weighing @weightInGrams headed for @postCode
            /// using @deliveryType
            /// </summary>
            public ProductsWrapper GetFreightOptions(int nrOfPackages, int weightInGrams, string postCode, DeliveryType deliveryType)
            {
                // Create the receiver
                Receiver Receiver = new Receiver
                {
                    PostCode    = postCode,
                    CountryCode = "NO"
                };

                //Create WebshopLine( goods line)
                List <WebShopLine> lines = new List <WebShopLine>();
                WebShopLine        ln    = new WebShopLine
                {
                    NumberOfPackages = nrOfPackages,
                    PackageWeight    = weightInGrams
                };

                lines.Add(ln);

                //Create shipment
                WebShopShipment shipment = new WebShopShipment
                {
                    WebShopId = 1209,
                    Shopper   = Receiver,
                    CODAmount = 0,
                    Lines     = lines.ToArray()
                };
                // Create an instance of ProductsWrapper class to hold the available products that is returned from ShipAdvisor
                ProductsWrapper FreightProducts = new ProductsWrapper();

                FreightProducts = shipAdvisor.GetFreightProductsForShipment(shipment, (int)deliveryType);

                return(FreightProducts);
            }
Beispiel #2
0
 public Task <string> UpdateChodOrderAsync(long ChODId, WebShopShipment shipment, SelectedProduct selectedProduct, OrderStatus status)
 {
     using (new OperationContextScope(client.InnerChannel))
     {
         OperationContext.Current.OutgoingMessageHeaders.Add(authheader);
         return(Task.Factory.FromAsync(client.BeginUpdateChodOrder(ChODId, shipment, selectedProduct, status, null, null), ar => client.EndUpdateChodOrder(ar)));
     }
 }
Beispiel #3
0
 public Task <OrderOutput> CreateConfirmedOrderAsync(WebShopShipment Shipment, SelectedProduct Product)
 {
     using (new OperationContextScope(client.InnerChannel))
     {
         OperationContext.Current.OutgoingMessageHeaders.Add(authheader);
         return(Task.Factory.FromAsync(client.BeginCreateConfirmedOrder(Shipment, Product, null, null), ar => client.EndCreateConfirmedOrder(ar)));
     }
 }
Beispiel #4
0
 public Task <ProductsWrapper> GetPricesAsync(WebShopShipment Shipment, long[] WebShopProductIds)
 {
     using (new OperationContextScope(client.InnerChannel))
     {
         OperationContext.Current.OutgoingMessageHeaders.Add(authheader);
         return(Task.Factory.FromAsync(client.BeginGetPrices(Shipment, WebShopProductIds, null, null), ar => client.EndGetPrices(ar)));
     }
 }
Beispiel #5
0
 public Task <OrderInitializeOutput> OrderInitializeAsync(WebShopShipment Shipment, string ReturnUrl, string CancelUrl, string Hash)
 {
     using (new OperationContextScope(client.InnerChannel))
     {
         OperationContext.Current.OutgoingMessageHeaders.Add(authheader);
         return(Task.Factory.FromAsync(client.BeginOrderInitialize(Shipment, ReturnUrl, CancelUrl, Hash, null, null), ar => client.EndOrderInitialize(ar)));
     }
 }
Beispiel #6
0
 public Task <ProductsWrapper> GetFreightProductsForShipmentAsync(WebShopShipment Shipment, int deliveryTypeOrder)
 {
     using (new OperationContextScope(client.InnerChannel))
     {
         OperationContext.Current.OutgoingMessageHeaders.Add(authheader);
         return(Task.Factory.FromAsync(client.BeginGetFreightProductsForShipment(Shipment, deliveryTypeOrder, null, null), ar => client.EndGetFreightProductsForShipment(ar)));
     }
 }
 public IAsyncResult BeginCreateConfirmedOrder(WebShopShipment Shipment, SelectedProduct Product, AsyncCallback callback, object state)
 {
     return(Channel.BeginCreateConfirmedOrder(Shipment, Product, callback, state));
 }
            public IAsyncResult BeginOrderInitialize(WebShopShipment Shipment, string ReturnUrl, string CancelUrl, string Hash, AsyncCallback callback, object state)
            {
                var _args = new object[] { Shipment, ReturnUrl, CancelUrl, Hash };

                return(base.BeginInvoke("OrderInitialize", _args, callback, state));
            }
            public IAsyncResult BeginUpdateChodOrder(long ChODId, WebShopShipment shipment, SelectedProduct selectedProduct, OrderStatus status, AsyncCallback callback, object state)
            {
                var _args = new object[] { ChODId, shipment, selectedProduct, status };

                return(base.BeginInvoke("UpdateChodOrder", _args, callback, state));
            }
            public IAsyncResult BeginGetFreightProductsForShipment(WebShopShipment Shipment, int deliveryTypeOrder, AsyncCallback callback, object state)
            {
                var _args = new object[] { Shipment, deliveryTypeOrder };

                return(base.BeginInvoke("GetFreightProductsForShipment", _args, callback, state));
            }
            public IAsyncResult BeginGetPrices(WebShopShipment Shipment, long[] WebShopProductIds, AsyncCallback callback, object state)
            {
                var _args = new object[] { Shipment, WebShopProductIds };

                return(base.BeginInvoke("GetPrices", _args, callback, state));
            }
            public IAsyncResult BeginCreateConfirmedOrder(WebShopShipment Shipment, SelectedProduct Product, AsyncCallback callback, object state)
            {
                var _args = new object[] { Shipment, Product };

                return(base.BeginInvoke("CreateConfirmedOrder", _args, callback, state));
            }
 public IAsyncResult BeginUpdateChodOrder(long ChODId, WebShopShipment shipment, SelectedProduct selectedProduct, OrderStatus status, AsyncCallback callback, object state)
 {
     return(Channel.BeginUpdateChodOrder(ChODId, shipment, selectedProduct, status, callback, state));
 }
 public IAsyncResult BeginOrderInitialize(WebShopShipment Shipment, string ReturnUrl, string CancelUrl, string Hash, AsyncCallback callback, object state)
 {
     return(Channel.BeginOrderInitialize(Shipment, ReturnUrl, CancelUrl, Hash, callback, state));
 }
 public IAsyncResult BeginGetPrices(WebShopShipment Shipment, long[] WebShopProductIds, AsyncCallback callback, object state)
 {
     return(Channel.BeginGetPrices(Shipment, WebShopProductIds, callback, state));
 }
 public IAsyncResult BeginGetFreightProductsForShipment(WebShopShipment Shipment, int deliveryTypeOrder, AsyncCallback callback, object state)
 {
     return(Channel.BeginGetFreightProductsForShipment(Shipment, deliveryTypeOrder, callback, state));
 }