private void SetTransportGuiData(ExternalBooking externalBooking)
        {
            fromAddressTextBox.Text = string.Format("{0} {1}{2} {3}{4}{5} {6}", externalBooking.Body.Shipments[0].Shipper.Name, Environment.NewLine,
                                        externalBooking.Body.Shipments[0].Shipper.Street, externalBooking.Body.Shipments[0].Shipper.StreetNbr, Environment.NewLine,
                                        externalBooking.Body.Shipments[0].Shipper.PostCode, externalBooking.Body.Shipments[0].FromCity);

            pickupDateTextBox.Text = string.Format("{0} {1}",externalBooking.Body.Shipments[0].ReadyDateTime,
                                        externalBooking.Body.Shipments[0].EarliestDeliveryDateTime);

            toAddressTextBox.Text = string.Format("{0} {1}{2} {3}{4}{5} {6}", externalBooking.Body.Shipments[0].Consignee.Name, Environment.NewLine,
                                        externalBooking.Body.Shipments[0].Consignee.Street, externalBooking.Body.Shipments[0].Consignee.StreetNbr, Environment.NewLine,
                                        externalBooking.Body.Shipments[0].Consignee.PostCode, externalBooking.Body.Shipments[0].ToCity);

            deliveryDateTextBox.Text = externalBooking.Body.Shipments[0].LatestDeliveryDateTime;
        }
        private static ExternalBooking CreateExternalCourierBooking()
        {
            var externalBooking = new ExternalBooking
            {
                Header = new HeaderType
                {
                    /* Booking time stamp */
                    Date = DateTime.Today,
                    Time = DateTime.Now,

                    /* Your user credentials, given by Jetpak */
                    UserName = "******",
                    Password = "******",
                },
                Body = new BodyType
                {
                    /* Your customer number, given by Jetpak */
                    CustomerNbr = "999999",

                    /* Your customer product, given by Jetpak */
                    CustomerProduct = "product",

                    Shipments = new[]
                                {
                                    new ShipmentsTypeShipment
                                        {
                                            /* Your shipment reference */
                                            ShipmentId = "1234567890",

                                            /* What are you shipping? (Content) */
                                            NatureOfGoods = "Documents",

                                            FromCountry = "SE",
                                            ToCountry = "SE",
                                            FromCity = "Stockholm",
                                            ToCity = "Stockholm",

                                            /* Shipment picked up by Jetpak (always YES for courier) */
                                            Pickup = YesNoType.Y,

                                            /* Shipment delivered by Jetpak (always YES for courier) */
                                            Delivery = YesNoType.Y,

                                            /* Earliest pickup */
                                            ReadyDateTime = DateTime.Today.AddDays(1).ToShortDateString() + " 10:00",

                                            LatestDeliveryDateTime = DateTime.Today.AddDays(1).ToShortDateString() + " 18:00",

                                            Shipper = new ContactType
                                                {
                                                    Name = "Shipper Company AB",
                                                    Street = "Ringvägen",
                                                    StreetNbr = "100",
                                                    PostCode = "11860",
                                                    EntryCode = "1234",
                                                    ContactPerson = new ContactPersonType
                                                        {
                                                            FirstName = "Anders",
                                                            SurName = "Testavsändare",
                                                            PhoneNbr = "08-123456",
                                                            Email = "*****@*****.**",
                                                        }
                                                },

                                            Consignee = new ContactType
                                                {
                                                    Name = "Consignee Company AB",
                                                    Street = "Sveavägen",
                                                    StreetNbr = "35",
                                                    PostCode = "11134",
                                                    EntryCode = "4321",
                                                    ContactPerson = new ContactPersonType
                                                        {
                                                            FirstName = "Test",
                                                            SurName = "Consignee",
                                                            PhoneNbr = "08-654321",
                                                            Email = "*****@*****.**",
                                                        }
                                                },
                                            Payer = new PayerType
                                                {
                                                    /* Item2 = Invoice payment (mandatory option) */
                                                    PaymentMethod = PaymentMethodType.Item2,

                                                    /* Your own payment reference on invoice */
                                                    Reference = "12345",
                                                },
                                            Advises = new[]
                                                {
                                                    new AdvisesTypeAdvise
                                                        {
                                                            /* Send an email advise when shipment on different actions;
                                                             * Item0 = advise activated, Item1 = inactivated */

                                                            /* Booking confirmation */
                                                            SendDef = BooleanType.Item0,

                                                            /* Status update */
                                                            SendStatus = BooleanType.Item0,

                                                            /* Confirmation that shipment has been delivered */
                                                            SendPod = BooleanType.Item0,

                                                            /* Shipment har been rebooked by Jetpak */
                                                            SendRebook = BooleanType.Item0,

                                                            Method = MethodType.EMAIL,
                                                            Address = "*****@*****.**",
                                                        }
                                                },
                                            Packages = new[]
                                                {
                                                    new PackagesTypePackage
                                                        {
                                                            /* Content of the package */
                                                            NatureOfGoods = "Document",

                                                            /* Package dimension [cm] */
                                                            Weight = 5,
                                                            Length = 25,
                                                            Width = 10,
                                                            Height = 40,
                                                        }
                                                },
                                        }
                                }
                },
            };
            return externalBooking;
        }
Ejemplo n.º 3
0
 /// <remarks/>
 public void JenaGetTransportAlternativesAsync(ExternalBooking JenaExternalBooking) {
     this.JenaGetTransportAlternativesAsync(JenaExternalBooking, null);
 }
Ejemplo n.º 4
0
 public TransportAlternatives JenaGetTransportAlternatives(ExternalBooking JenaExternalBooking) {
     object[] results = this.Invoke("JenaGetTransportAlternatives", new object[] {
                 JenaExternalBooking});
     return ((TransportAlternatives)(results[0]));
 }
Ejemplo n.º 5
0
 /// <remarks/>
 public void JenaExternalBookingAsync(ExternalBooking JenaExternalBooking1, object userState) {
     if ((this.JenaExternalBookingOperationCompleted == null)) {
         this.JenaExternalBookingOperationCompleted = new System.Threading.SendOrPostCallback(this.OnJenaExternalBookingOperationCompleted);
     }
     this.InvokeAsync("JenaExternalBooking", new object[] {
                 JenaExternalBooking1}, this.JenaExternalBookingOperationCompleted, userState);
 }
Ejemplo n.º 6
0
 /// <remarks/>
 public void JenaExternalBookingAsync(ExternalBooking JenaExternalBooking1) {
     this.JenaExternalBookingAsync(JenaExternalBooking1, null);
 }
Ejemplo n.º 7
0
 /// <remarks/>
 public void JenaGetTransportAlternativesAsync(ExternalBooking JenaExternalBooking, object userState) {
     if ((this.JenaGetTransportAlternativesOperationCompleted == null)) {
         this.JenaGetTransportAlternativesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnJenaGetTransportAlternativesOperationCompleted);
     }
     this.InvokeAsync("JenaGetTransportAlternatives", new object[] {
                 JenaExternalBooking}, this.JenaGetTransportAlternativesOperationCompleted, userState);
 }