private void HyperLinkGetTrackingNumber_Click(object sender, RoutedEventArgs e) { if (this.IsOKToGetTrackingNumber() == true) { Business.MaterialTracking.Model.FedexAccountProduction fedExAccount = new Business.MaterialTracking.Model.FedexAccountProduction(); Business.MaterialTracking.Model.FedexShipmentRequest shipmentRequest = new Business.MaterialTracking.Model.FedexShipmentRequest(fedExAccount, this.m_FakeAccessionNo, 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); Business.MaterialTracking.Model.FedexProcessShipmentReply result = shipmentRequest.RequestShipment(); if (result.RequestWasSuccessful == true) { this.m_TrackingNumber = result.TrackingNumber; this.m_ZPLII = Business.Label.Model.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."); } }
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); } }
private void HyperLinkGetTrackingNumber_Click(object sender, RoutedEventArgs e) { Business.Task.Model.TaskOrderDetailFedexShipment taskOrderDetail = this.m_TaskOrder.TaskOrderDetailCollection.GetFedexShipment(); if(this.IsOKToGetTrackingNumber(taskOrderDetail) == true) { Business.Facility.Model.FacilityCollection allFacilities = Business.Facility.Model.FacilityCollection.GetAllFacilities(); Business.Facility.Model.Facility facility = allFacilities.GetByFacilityId(taskOrderDetail.ShipToFacilityId); Business.MaterialTracking.Model.FedexAccountProduction fedExAccount = new Business.MaterialTracking.Model.FedexAccountProduction(); Business.MaterialTracking.Model.FedexShipmentRequest shipmentRequest = new Business.MaterialTracking.Model.FedexShipmentRequest(facility, fedExAccount, taskOrderDetail.PaymentType, taskOrderDetail); Business.MaterialTracking.Model.FedexProcessShipmentReply result = shipmentRequest.RequestShipment(); if (result.RequestWasSuccessful == true) { taskOrderDetail.TrackingNumber = result.TrackingNumber; taskOrderDetail.ZPLII = Business.Label.Model.ZPLPrinter.DecodeZPLFromBase64(result.ZPLII); } else { MessageBox.Show("There was a problem with this shipping request."); } } else { MessageBox.Show("We are unable to get the tracking number at this point because there are problems with the data."); } }