private void signUpButton_Click(object sender, EventArgs e) { ShippingPostalAddress cur = (ShippingPostalAddress)shippingPostalAddressBindingSource.Current; if ( cur != null && (!CheckOrderStatus || cur.SumStatus == ShippingPostalAddress.SumStatusses.ReadyForShip) && cur.ShippingAgentCode == BCShippingAgentTNTCode ) { shipping.showMyDialog(cur, this); } else { if (cur == null) { MessageBox.Show("Please select an order first"); } else if (CheckOrderStatus && cur.SumStatus != ShippingPostalAddress.SumStatusses.ReadyForShip) { MessageBox.Show("Not ready for shipping!"); } else if (cur.ShippingAgentCode != BCShippingAgentTNTCode) { MessageBox.Show("Not a TNT shipment!"); } else { MessageBox.Show("Unknown problem..."); } } }
public void showMyDialog(ShippingPostalAddress thisShipment, Form caller) { this._thisShipment = thisShipment; nameTextBox.Text = _thisShipment.ShipToName; orderNumberTextBox.Text = _thisShipment.Number; actionTextBox.Text = _thisShipment.PackageTrackingNo == "" ? "Sign up a new package at TNT and print the documents" : "Print documents only (package already signed up)"; this.ShowDialog(caller); }
private void clear() { //reset instance variables this._thisShipment = null; //reset inputs this.nameTextBox.ResetText(); this.orderNumberTextBox.ResetText(); this.actionTextBox.ResetText(); this.messageTextBox.ResetText(); this.labelTextBox.ResetText(); this.manifestTextBox.ResetText(); this.connoteTextBox.ResetText(); this.invoiceTextBox.ResetText(); this.trackingnoTextBox.ResetText(); this.trackingnoMessageTextBox.ResetText(); this.signUpButton.Enabled = true; }