Esempio n. 1
0
        private void HyperLinkGetTrackingNumber_Click(object sender, RoutedEventArgs e)
        {
            if (this.IsOKToGetTrackingNumber() == true)
            {
                Fedex.FedexAccountProduction fedExAccount    = new Fedex.FedexAccountProduction();
                FedexShipmentRequest         shipmentRequest = new FedexShipmentRequest(fedExAccount,
                                                                                        this.m_ClientOrder.PLastName, this.m_PaymentType, this.m_ServiceType, this.m_TrackingNumber,
                                                                                        this.m_ShipToName, this.m_ShipToPhone, this.m_ShipToAddress1,
                                                                                        this.m_ShipToAddress2, this.m_ShipToCity, this.m_ShipToState,
                                                                                        this.m_ShipToZip, this.m_AccountNo);
                FedexProcessShipmentReply result = shipmentRequest.RequestShipment();

                if (result.RequestWasSuccessful == true)
                {
                    this.m_TrackingNumber = result.TrackingNumber;
                    this.m_ZPLII          = ZPLPrinterTCP.DecodeZPLFromBase64(result.ZPLII);
                    this.NotifyPropertyChanged(string.Empty);
                }
                else
                {
                    MessageBox.Show(result.Message);
                }
            }
            else
            {
                MessageBox.Show("We are unable to get the tracking number at this point because there are problems with the data.");
            }
        }
Esempio n. 2
0
 private void HyperLinkPrintLabel_Click(object sender, RoutedEventArgs e)
 {
     if (string.IsNullOrEmpty(this.m_ZPLII) == false)
     {
         ZPLPrinterTCP zplPrinter = new ZPLPrinterTCP("10.1.1.33");
         zplPrinter.Print(this.m_ZPLII);
     }
     else
     {
         MessageBox.Show("The label cannot be printed until a tracking number exists.");
     }
 }
Esempio n. 3
0
        private void HyperLinkPrintReturnLabel_Click(object sender, RoutedEventArgs e)
        {
            FedexAccountProduction  fedExAccount       = new FedexAccountProduction();
            FedexReturnLabelRequest returnLabelRequest = new FedexReturnLabelRequest($"{this.m_ClientOrder.PFirstName} {this.m_ClientOrder.PLastName}",
                                                                                     this.m_ClientOrder.PPhone, this.m_ClientOrder.PAddress1, null, this.m_ClientOrder.PCity, this.m_ClientOrder.PState, this.m_ClientOrder.PZipCode, fedExAccount);
            FedexProcessShipmentReply result = returnLabelRequest.RequestShipment();

            ZPLPrinterTCP zplPrinter = new ZPLPrinterTCP("10.1.1.33");

            zplPrinter.Print(ZPLPrinterTCP.DecodeZPLFromBase64(result.ZPLII));

            MessageBox.Show("Fedex labels have been sent to the printer.");
        }