This code handles processing furniture orders. It validates user input, calculates order totals, generates an invoice number, and displays an order bill. Key fields like the customer name are reversed. Order details like item quantities, prices, taxes, and totals are calculated and displayed in a list for the user.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
72 views3 pages
Furniture Order
This code handles processing furniture orders. It validates user input, calculates order totals, generates an invoice number, and displays an order bill. Key fields like the customer name are reversed. Order details like item quantities, prices, taxes, and totals are calculated and displayed in a list for the user.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3
Public Class FrmFurnitureOrder
Const ChairPrice As Double = 350
Const SofaPrice As Double = 925 Const SaleTax As Double = 0.05
Private Sub btnProcessOrder_Click(sender As Object, e As EventArgs) Handles
btnProcessOrder.Click Dim custName As String = txtName.Text, street As String = txtAddress.Text, cityStateZip As String = txtCity.Text Dim chairs, sofas As Integer Dim totalDue, totalTax, orderPrice As Double Dim invoiceId, reversedName As String
If ValidateInput(custName, street, cityStateZip) Then
End Function Private Function ValidateInput(custName As String, street As String, cityStateZip As String) As Boolean If Not custName.Contains(", ") Or custName.Length < 4 Then MessageBox.Show("Invalid Name. Make sure names are separated by comma", "Invalid Input", MessageBoxButtons.OK, MessageBoxIcon.Error) Return False ElseIf street = "" Or cityStateZip = "" Then MessageBox.Show("Invalid street, city, state, or ZIP.", "Invalid Input", MessageBoxButtons.OK, MessageBoxIcon.Error) Return False ElseIf Not IsNumeric(txtChairs.Text) Or Not IsNumeric(txtSofas.Text) Then MessageBox.Show("Invalid number of ordered chairs or sofas.", "Invalid Input", MessageBoxButtons.OK, MessageBoxIcon.Error) Return False Else Return True End If End Function
Private Sub btnQuit_Click(sender As Object, e As EventArgs) Handles btnQuit.Click
Me.Close() End Sub
Private Sub btnClear_Click(sender As Object, e As EventArgs) Handles btnClear.Click
For Each ctrl In Controls.OfType(Of TextBox) ctrl.Clear() Next lstDisplay.Items.Clear() txtName.Focus() End Sub