示例#1
0
        private bool IsOKToGetTrackingNumber(Business.Task.Model.TaskOrderDetailFedexShipment taskOrderDetail)
        {
            bool result = true;

            if (string.IsNullOrEmpty(taskOrderDetail.TrackingNumber) == false)
            {
                result = false;
            }
            if (string.IsNullOrEmpty(taskOrderDetail.ShipToAddress1) == true)
            {
                result = false;
            }
            if (string.IsNullOrEmpty(taskOrderDetail.ShipToCity) == true)
            {
                result = false;
            }
            if (string.IsNullOrEmpty(taskOrderDetail.ShipToState) == true)
            {
                result = false;
            }
            if (string.IsNullOrEmpty(taskOrderDetail.ShipToZip) == true)
            {
                result = false;
            }
            if (string.IsNullOrEmpty(taskOrderDetail.PaymentType) == true)
            {
                result = false;
            }
            return(result);
        }
示例#2
0
        public FedexShipmentRequest(Business.Facility.Model.Facility shipTofacility, FedexAccount fedexAccount, string paymentType, Business.Task.Model.TaskOrderDetailFedexShipment taskOrderDetail)
        {
            this.m_ShipToFacility = shipTofacility;
            this.m_FedexAccount = fedexAccount;
            this.m_PaymentType = paymentType;
            this.m_TaskOrderDetail = taskOrderDetail;

            this.OpenShipmentRequestFile();
            this.SetShipementRequestData();
        }
示例#3
0
 private void BarcodeScanPort_FedexOvernightScanReceived(string scanData)
 {
     this.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Input, new System.Threading.ThreadStart(delegate()
     {
         if (this.m_TaskOrder.TaskOrderDetailCollection.FedexShipmentExists() == true)
         {
             Business.Task.Model.TaskOrderDetailFedexShipment taskOrderDetailFedexShipment = this.m_TaskOrder.TaskOrderDetailCollection.GetFedexShipment();
             if (string.IsNullOrEmpty(taskOrderDetailFedexShipment.TrackingNumber) == true)
             {
                 taskOrderDetailFedexShipment.TrackingNumber = scanData.Substring(22, 12);
             }
         }
     }));
 }
示例#4
0
 private void ComboboxShipToFacility_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (this.IsLoaded == true)
     {
         ComboBox comboBox = (ComboBox)sender;
         if (comboBox.SelectionBoxItem != null)
         {
             Business.Facility.Model.Facility facility = (Business.Facility.Model.Facility)comboBox.SelectedItem;
             if (facility != null)
             {
                 Business.Task.Model.TaskOrderDetailFedexShipment taskOrderDetail = this.m_TaskOrder.TaskOrderDetailCollection.GetFedexShipment();
                 taskOrderDetail.SetShipTo(facility);
             }
         }
         this.NotifyPropertyChanged(string.Empty);
     }
 }
示例#5
0
        private void HyperLinkCancelShipment_Click(object sender, RoutedEventArgs e)
        {
            Business.Task.Model.TaskOrderDetailFedexShipment taskOrderDetail = this.m_TaskOrder.TaskOrderDetailCollection.GetFedexShipment();
            if (string.IsNullOrEmpty(taskOrderDetail.TrackingNumber) == false)
            {
                Business.MaterialTracking.Model.FedexAccountProduction     fedExAccount          = new Business.MaterialTracking.Model.FedexAccountProduction();
                Business.MaterialTracking.Model.FedexDeleteShipmentRequest deleteShipmentRequest = new Business.MaterialTracking.Model.FedexDeleteShipmentRequest(fedExAccount, taskOrderDetail.TrackingNumber);
                Business.MaterialTracking.Model.FedexDeleteShipmentReply   result = deleteShipmentRequest.Post();

                if (result.RequestWasSuccessful == true)
                {
                    taskOrderDetail.ZPLII               = null;
                    taskOrderDetail.TrackingNumber      = null;
                    taskOrderDetail.LabelHasBeenPrinted = false;
                }
                else
                {
                    MessageBox.Show("There was a problem with this Request.");
                }
            }
        }
示例#6
0
 private void HyperLinkPrintLabel_Click(object sender, RoutedEventArgs e)
 {
     Business.Task.Model.TaskOrderDetailFedexShipment taskOrderDetail = this.m_TaskOrder.TaskOrderDetailCollection.GetFedexShipment();
     if (string.IsNullOrEmpty(taskOrderDetail.ZPLII) == false)
     {
         if (string.IsNullOrEmpty(Business.User.UserPreferenceInstance.Instance.UserPreference.FedExLabelPrinter) == false)
         {
             Business.Label.Model.ZPLPrinterTCP zplPrinter = new Business.Label.Model.ZPLPrinterTCP(Business.User.UserPreferenceInstance.Instance.UserPreference.FedExLabelPrinter);
             zplPrinter.Print(taskOrderDetail.ZPLII);
             taskOrderDetail.LabelHasBeenPrinted = true;
         }
         else
         {
             MessageBox.Show("You need to go into User Preferences and choose your FedEx label printer before your label can be printed.");
         }
     }
     else
     {
         MessageBox.Show("The label cannot be printed until a tracking number exists.");
     }
 }
示例#7
0
        private void HyperLinkGetTrackingNumber_Click(object sender, RoutedEventArgs e)
        {
            Business.Task.Model.TaskOrderDetailFedexShipment taskOrderDetail = this.m_TaskOrder.TaskOrderDetailCollection.GetFedexShipment();
            taskOrderDetail.ValidateObject();
            if (taskOrderDetail.ValidationErrors.Count == 0)
            {
                if (this.IsOKToGetTrackingNumber(taskOrderDetail) == true)
                {
                    string masterAccessionNo = taskOrderDetail.TaskOrderDetailId.Split(new char[] { '.' })[0];
                    Business.Facility.Model.Facility facility = Business.Facility.Model.FacilityCollection.Instance.GetByFacilityId(taskOrderDetail.ShipToFacilityId);
                    Business.MaterialTracking.Model.FedexAccountProduction fedExAccount    = new Business.MaterialTracking.Model.FedexAccountProduction();
                    Business.MaterialTracking.Model.FedexShipmentRequest   shipmentRequest = new Business.MaterialTracking.Model.FedexShipmentRequest(fedExAccount,
                                                                                                                                                      masterAccessionNo, taskOrderDetail.PaymentType, taskOrderDetail.ServiceType, taskOrderDetail.TrackingNumber, taskOrderDetail.ShipToName,
                                                                                                                                                      taskOrderDetail.ShipToPhone, taskOrderDetail.ShipToAddress1, taskOrderDetail.ShipToAddress2, taskOrderDetail.ShipToCity,
                                                                                                                                                      taskOrderDetail.ShipToState, taskOrderDetail.ShipToZip, taskOrderDetail.AccountNo);
                    Business.MaterialTracking.Model.FedexProcessShipmentReply result = shipmentRequest.RequestShipment();

                    if (result.RequestWasSuccessful == true)
                    {
                        taskOrderDetail.TrackingNumber = result.TrackingNumber;
                        taskOrderDetail.ZPLII          = Business.Label.Model.ZPLPrinterTCP.DecodeZPLFromBase64(result.ZPLII);
                    }
                    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.");
                }
            }
            else
            {
                string message = "We are unable to get the tracking number at this point because" + Environment.NewLine + taskOrderDetail.Errors;
                MessageBox.Show(message);
            }
        }