Private Sub addShirtButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles addShirtButton.Click
Try
'Allow only 20 items in one order
If numberTransactionsInteger < 20 Then
'Instantiate the StudentBookSale object and set the properties.
aShirtSale = New ShirtSale(UCase(customerNameTextBox.Text), _
orderNumberTextBox.Text, _
Integer.Parse(quantityTextBox.Text), _
selectedButtonString, _
monogramCheckBox.Checked, _
pocketCheckBox.Checked)
'Display Current Order Information
sizeSummaryListBox.Items.Add(UCase(aShirtSale.Size))
extrasSummaryListBox.Items.Add(UCase(aShirtSale.Extras))
quantitySummaryListBox.Items.Add(aShirtSale.Quantity)
itemTotalSummaryListBox.Items.Add(aShirtSale.ItemTotal.ToString("C"))
totalTaxSummaryLabel.Text = aShirtSale.ItemTax.ToString("C")
totalAmountSummaryLabel.Text = aShirtSale.GrandTotal.ToString("C")
'Add to Array for printing
Dim rowInteger, columnInteger As Integer
transactionShirtSale(numberTransactionsInteger).sizeString = UCase(aShirtSale.Size)
transactionShirtSale(numberTransactionsInteger).extrasString = UCase(aShirtSale.Extras)
transactionShirtSale(numberTransactionsInteger).quantityInteger = aShirtSale.Quantity
transactionShirtSale(numberTransactionsInteger).itemTotalDecimal = aShirtSale.ItemTotal
startOrder = True 'The order has started
' If the order started, disable the customer information
If startOrder = True Then
With customerNameTextBox
.Enabled = False
End With
With orderNumberTextBox
.Enabled = False
End With
With quantityTextBox
.Clear()
.Focus()
End With
'Enable and Disable form buttons
dailySummaryButton.Enabled = False
fileDisplaySummaryMenuItem.Enabled = False
cancelOrderButton.Enabled = True
saleCancelOrderMenuItem.Enabled = True
completeButton.Enabled = True
saleCompleteMenuItem.Enabled = True
End If
'Reset Order Options
smallRadioButton.Checked = True
monogramCheckBox.Checked = False
pocketCheckBox.Checked = False
numberTransactionsInteger += 1
Else
MessageBox.Show("Only 20 Items are allowed", "Overlimit", MessageBoxButtons.OK)
End If
Catch ex As Exception When (IsNumeric(customerNameTextBox.Text) = True Or customerNameTextBox.Text = "")
MessageBox.Show("Please input a proper CUSTOMER NAME", "Input Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
customerNameTextBox.Enabled = True
customerNameTextBox.ForeColor = Color.Red
Catch ex As Exception When (IsNumeric(orderNumberTextBox.Text) = False Or orderNumberTextBox.Text = "")
MessageBox.Show("Please input a proper ORDER NUMBER", "Input Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
orderNumberTextBox.Enabled = True
orderNumberTextBox.ForeColor = Color.Red
Catch ex As Exception When (IsNumeric(quantityTextBox.Text) = False Or quantityTextBox.Text = "")
MessageBox.Show("Please input the proper QUANTITY", "Input Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
quantityTextBox.ForeColor = Color.Red
End Try
End Sub