Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class ShirtOrderForm
- Dim ClientOrder(5) As String
- Dim ClientName, Address, PhNo, Delivery, Pickup, order, MasterValue, ShowMaster, neworder, ListSpace As String
- Dim PlainCost, GourmetCost, TotalCost, DeliveryFee As Single
- Dim LF, OutTxt, OutTxt2 As String
- Dim MaxOrder, PCount As Integer
- Dim OrderDone, OrderType As Boolean
- Private Sub cmdQuit_Click(sender As Object, e As EventArgs) Handles cmdQuit.Click
- End
- End Sub
- Private Sub cmdNewOrder_Click(sender As Object, e As EventArgs) Handles cmdNewOrder.Click
- TotalCost = 0
- neworder = 1
- ProgressBar1.Value = 0
- Label1.Text = "Pizzas Ordered = 0"
- initialise()
- OutTxt = ("Pick Order Type" & LF & "now")
- OutText.Text = OutTxt
- getContacts()
- OutTxt = OutTxt & vbCrLf & vbCrLf & "Enter order via buttons"
- OutText.Text = OutTxt
- OutText2.Text = OutTxt2
- End Sub
- Private Sub initialise()
- Dim i As Integer
- ListSpace = " "
- Delivery = "Delivery"
- Pickup = "Pickup"
- ClientName = ""
- Address = ""
- PhNo = ""
- LF = vbCrLf
- For i = 1 To 5
- ClientOrder(i) = ""
- Next
- PCount = 0
- TotalCost = 0
- PlainCost = 8.5
- GourmetCost = PlainCost + 5
- MaxOrder = 5
- DeliveryFee = 3
- OrderDone = False
- End Sub
- Private Sub getContacts()
- order = Pickup
- End Sub
- Private Sub cmdPizza1_Click(sender As Object, e As EventArgs) Handles cmdPizza1.Click
- If Len(ClientName) < 1 Then
- MsgBox("Please press 'New Order' to start an order")
- Else
- If PCount < 5 Then
- PCount += 1
- TotalCost = TotalCost + PlainCost
- ClientOrder(PCount) = cmdPizza1.Text & ListSpace & "$" & PlainCost
- OutText.Text = OutText.Text & LF & cmdPizza1.Text & ListSpace & "$" & PlainCost
- Orderprogress()
- Else
- MsgBox("Maximum order is Five Pizzas. Press DONE to continue.")
- End If
- End If
- End Sub
- Private Sub cmdPizza2_Click(sender As Object, e As EventArgs) Handles cmdPizza2.Click
- If Len(ClientName) < 1 Then
- MsgBox("Please press 'New Order' to start an order")
- Else
- If PCount < 5 Then
- PCount += 1
- TotalCost = TotalCost + PlainCost
- ClientOrder(PCount) = cmdPizza2.Text & ListSpace & "$" & PlainCost
- OutText.Text = OutText.Text & LF & cmdPizza2.Text & ListSpace & "$" & PlainCost
- Orderprogress()
- Else
- MsgBox("Maximum order is Five Pizzas. Press DONE to continue.")
- End If
- End If
- End Sub
- Private Sub cmdPizza3_Click(sender As Object, e As EventArgs) Handles cmdPizza3.Click
- If Len(ClientName) < 1 Then
- MsgBox("Please press 'New Order' to start an order")
- Else
- If PCount < 5 Then
- PCount += 1
- TotalCost = TotalCost + PlainCost
- ClientOrder(PCount) = cmdPizza3.Text & ListSpace & "$" & PlainCost
- OutText.Text = OutText.Text & LF & cmdPizza3.Text & ListSpace & "$" & PlainCost
- Orderprogress()
- Else
- MsgBox("Maximum order is Five Pizzas. Press DONE to continue.")
- End If
- End If
- End Sub
- Private Sub cmdPizza4_Click(sender As Object, e As EventArgs) Handles cmdPizza4.Click
- If Len(ClientName) < 1 Then
- MsgBox("Please press 'New Order' to start an order")
- Else
- If PCount < 5 Then
- PCount += 1
- TotalCost = TotalCost + PlainCost
- ClientOrder(PCount) = cmdPizza4.Text & ListSpace & "$" & PlainCost
- OutText.Text = OutText.Text & LF & cmdPizza4.Text & ListSpace & "$" & PlainCost
- Orderprogress()
- Else
- MsgBox("Maximum order is Five Pizzas. Press DONE to continue.")
- End If
- End If
- End Sub
- Private Sub cmdPizza5_Click(sender As Object, e As EventArgs) Handles cmdPizza5.Click
- If Len(ClientName) < 1 Then
- MsgBox("Please press 'New Order' to start an order")
- Else
- If PCount < 5 Then
- PCount += 1
- TotalCost = TotalCost + PlainCost
- ClientOrder(PCount) = cmdPizza5.Text & ListSpace & "$" & PlainCost
- OutText.Text = OutText.Text & LF & cmdPizza5.Text & ListSpace & "$" & PlainCost
- Orderprogress()
- Else
- MsgBox("Maximum order is Five Pizzas. Press DONE to continue.")
- End If
- End If
- End Sub
- Private Sub cmdPizza6_Click(sender As Object, e As EventArgs) Handles cmdPizza6.Click
- If Len(ClientName) < 1 Then
- MsgBox("Please press 'New Order' to start an order")
- Else
- If PCount < 5 Then
- PCount += 1
- TotalCost = TotalCost + PlainCost
- ClientOrder(PCount) = cmdPizza6.Text & ListSpace & "$" & PlainCost
- OutText.Text = OutText.Text & LF & cmdPizza6.Text & ListSpace & "$" & PlainCost
- Orderprogress()
- Else
- MsgBox("Maximum order is Five Pizzas. Press DONE to continue.")
- End If
- End If
- End Sub
- Private Sub cmdPizza7_Click(sender As Object, e As EventArgs) Handles cmdPizza7.Click
- If Len(ClientName) < 1 Then
- MsgBox("Please press 'New Order' to start an order")
- Else
- If PCount < 5 Then
- PCount += 1
- TotalCost = TotalCost + PlainCost
- ClientOrder(PCount) = cmdPizza7.Text & ListSpace & "$" & PlainCost
- OutText.Text = OutText.Text & LF & cmdPizza7.Text & ListSpace & "$" & PlainCost
- Orderprogress()
- Else
- MsgBox("Maximum order is Five Pizzas. Press DONE to continue.")
- End If
- End If
- End Sub
- Private Sub cmdPizza8_Click(sender As Object, e As EventArgs) Handles cmdPizza8.Click
- If Len(ClientName) < 1 Then
- MsgBox("Please press 'New Order' to start an order")
- Else
- If PCount < 5 Then
- PCount += 1
- TotalCost = TotalCost + GourmetCost
- ClientOrder(PCount) = cmdPizza8.Text & ListSpace & "$" & GourmetCost
- OutText.Text = OutText.Text & LF & cmdPizza8.Text & ListSpace & "$" & GourmetCost
- Orderprogress()
- Else
- MsgBox("Maximum order is Five Pizzas. Press DONE to continue.")
- End If
- End If
- End Sub
- Private Sub cmdPizza9_Click(sender As Object, e As EventArgs) Handles cmdPizza9.Click
- If Len(ClientName) < 1 Then
- MsgBox("Please press 'New Order' to start an order")
- Else
- If PCount < 5 Then
- PCount += 1
- TotalCost = TotalCost + GourmetCost
- ClientOrder(PCount) = cmdPizza9.Text & ListSpace & "$" & GourmetCost
- OutText.Text = OutText.Text & LF & cmdPizza9.Text & ListSpace & "$" & GourmetCost
- Orderprogress()
- Else
- MsgBox("Maximum order is Five Pizzas. Press DONE to continue.")
- End If
- End If
- End Sub
- Private Sub cmdPizza10_Click(sender As Object, e As EventArgs) Handles cmdPizza10.Click
- If Len(ClientName) < 1 Then
- MsgBox("Please press 'New Order' to start an order")
- Else
- If PCount < 5 Then
- PCount += 1
- TotalCost = TotalCost + GourmetCost
- ClientOrder(PCount) = cmdPizza10.Text & ListSpace & "$" & GourmetCost
- OutText.Text = OutText.Text & LF & cmdPizza10.Text & ListSpace & "$" & GourmetCost
- Orderprogress()
- Else
- MsgBox("Maximum order is Five Pizzas. Press DONE to continue.")
- End If
- End If
- End Sub
- Private Sub cmdPizza11_Click(sender As Object, e As EventArgs) Handles cmdPizza11.Click
- If Len(ClientName) < 1 Then
- MsgBox("Please press 'New Order' to start an order")
- Else
- If PCount < 5 Then
- PCount += 1
- TotalCost = TotalCost + GourmetCost
- ClientOrder(PCount) = cmdPizza11.Text & ListSpace & "$" & GourmetCost
- OutText.Text = OutText.Text & LF & cmdPizza11.Text & ListSpace & "$" & GourmetCost
- Orderprogress()
- Else
- MsgBox("Maximum order is Five Pizzas. Press DONE to continue.")
- End If
- End If
- End Sub
- Private Sub cmdPizza12_Click(sender As Object, e As EventArgs) Handles cmdPizza12.Click
- If Len(ClientName) < 1 Then
- MsgBox("Please press 'New Order' to start an order")
- Else
- If PCount < 5 Then
- PCount += 1
- TotalCost = TotalCost + GourmetCost
- ClientOrder(PCount) = cmdPizza12.Text & ListSpace & "$" & GourmetCost
- OutText.Text = OutText.Text & LF & cmdPizza12.Text & ListSpace & "$" & GourmetCost
- Orderprogress()
- Else
- MsgBox("Maximum order is Five Pizzas. Press DONE to continue.")
- End If
- End If
- End Sub
- Private Sub cmdPickup_Click(sender As Object, e As EventArgs) Handles cmdPickup.Click
- If neworder = 1 Then
- initialise()
- order = Pickup
- ClientName = InputBox("Enter Client Name:")
- PhNo = InputBox("Enter client ph no:")
- OutTxt = ClientName & LF & PhNo & LF & cmdPickup.Text
- OutTxt2 = ClientName & LF & PhNo
- OutTxt2 = OutTxt2 & LF & cmdPickup.Text
- OutTxt = OutTxt & vbCrLf & vbCrLf & "Enter order via buttons"
- OutTxt2 = OutTxt2 & vbCrLf & vbCrLf & "Enter order via buttons"
- OutText.Text = OutTxt
- OutText2.Text = OutTxt2
- RecallArray.Items.Add(ClientName & ListSpace & PhNo)
- ElseIf neworder = 0 Then
- MsgBox("Please press 'New Order' to start an order")
- End If
- End Sub
- Private Sub cmdDelivery_Click(sender As Object, e As EventArgs) Handles cmdDelivery.Click
- If neworder = 1 Then
- initialise()
- ClientName = InputBox("Enter Client Name:")
- Address = InputBox("Enter client address:")
- PhNo = InputBox("Enter client ph no:")
- TotalCost = TotalCost + DeliveryFee
- order = Delivery
- OutTxt2 = cmdDelivery.Text & LF & ClientName & LF & Address & LF & PhNo
- OutTxt = cmdDelivery.Text & LF & ClientName & LF & Address & LF & PhNo
- OutTxt = OutTxt & vbCrLf & vbCrLf & "Enter order via buttons"
- OutTxt2 = OutTxt2 & vbCrLf & vbCrLf & "Enter order via buttons"
- OutText.Text = OutTxt
- OutText2.Text = OutTxt2
- RecallArray.Items.Add(ClientName & ListSpace & PhNo)
- ElseIf neworder = 0 Then
- MsgBox("Please press 'New Order' to start an order")
- End If
- End Sub
- Private Sub cmdDone_Click(sender As Object, e As EventArgs) Handles cmdDone.Click
- Dim i As Integer
- OutTxt = OutTxt & LF & "Number of Pizzas ordered = " & PCount & LF
- For i = 1 To PCount
- OutTxt = OutTxt & ClientOrder(i) & vbCrLf
- Next
- If TotalCost < 3 Then
- MsgBox("Please Select Pizzas")
- ElseIf TotalCost > 3 Then
- OutTxt = OutTxt & vbCrLf & "TOTAL Cost= $" & TotalCost & vbCrLf
- If order = Delivery Then
- OutTxt = OutTxt & "Delivery Fee Added"
- ElseIf order = Pickup Then
- OutTxt = OutTxt & "No Delivery Fee Added"
- End If
- OutText.Text = OutTxt
- neworder = 0
- End If
- End Sub
- Private Sub cmdTest_Click(sender As Object, e As EventArgs) Handles cmdTest.Click
- If MasterValue = 1 Then
- initialise()
- neworder = 1
- ClientName = "test"
- Address = "gdfgsdg"
- PhNo = "1234567890"
- TotalCost = TotalCost + DeliveryFee
- order = Delivery
- OutTxt = cmdDelivery.Text & LF & ClientName & LF & Address & LF & PhNo
- OutTxt2 = cmdDelivery.Text & LF & ClientName & LF & Address & LF & PhNo
- OutTxt = OutTxt & vbCrLf & vbCrLf & "Enter order via buttons"
- OutTxt2 = OutTxt2 & vbCrLf & vbCrLf & "Enter order via buttons"
- OutText2.Text = OutTxt
- OutText.Text = OutTxt2
- RecallArray.Items.Add(ClientName & ListSpace & PhNo)
- ElseIf MasterValue = 0 Then
- MsgBox("Master Mode Is Off Please Enable To Use This Function")
- End If
- End Sub
- Private Sub cmdReset_Click(sender As Object, e As EventArgs) Handles cmdReset.Click
- If MasterValue = 1 Then
- order = " "
- ClientName = " "
- Address = " "
- PhNo = " "
- OutTxt = ""
- OutTxt2 = " "
- OutText.Text = "Output Displayed here"
- OutText2.Text = "Ouptut Displayed here"
- neworder = 0
- TotalCost = 0
- ElseIf MasterValue = 0 Then
- MsgBox("Master Mode Is Off Please Enable To Use This Function")
- End If
- End Sub
- Private Sub cmdMaster_Click(sender As Object, e As EventArgs) Handles cmdMaster.Click
- If cmdMaster.CheckState = CheckState.Checked Then
- MasterValue = 1
- MasterOut.Text = "on"
- cmdReset.Visible = True
- cmdTest.Visible = True
- ElseIf cmdMaster.CheckState = CheckState.Unchecked Then
- MasterValue = 0
- MasterOut.Text = "off"
- cmdReset.Visible = False
- cmdTest.Visible = False
- End If
- End Sub
- Private Sub Orderprogress()
- 'Sets the progress bar's Maximum property to the total number of pizzas that can be ordered
- ProgressBar1.Maximum = 5
- 'Increases the value displayed by the progress bar.
- ProgressBar1.Value += 1
- Label1.Text = "Pizzas Ordered = " & ProgressBar1.Value.ToString()
- End Sub
- Private Sub RegularPizzas_Click(sender As Object, e As EventArgs) Handles cmdRegularPizzas.Click
- MsgBox("Set New Order To One")
- neworder = 1
- End Sub
- Private Sub cmdGourmetPizzas_click(sender As Object, e As EventArgs) Handles cmdGourmetPizzas.Click
- MsgBox("you found my secret, do you want a prize?")
- MsgBox("well there is none")
- End Sub
- Private Sub ProgressBar1_click(sender As Object, e As EventArgs) Handles ProgressBar1.Click
- cmdMaster.Visible = False
- MasterOut.Visible = False
- cmdReset.Visible = False
- cmdTest.Visible = False
- cmdMaster.CheckState = CheckState.Unchecked
- MasterValue = 0
- MasterOut.Text = "off"
- End Sub
- Private Sub Label1_click(sender As Object, e As EventArgs) Handles Label1.Click
- MasterOut.Text = "off"
- MasterValue = 0
- cmdMaster.Visible = True
- MasterOut.Visible = True
- End Sub
- Public Sub ShirtOrderForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load
- MasterValue = 0
- ProgressBar1.Maximum = 5
- Label1.Text = "Pizzas Ordered = 0"
- cmdReset.Visible = False
- cmdTest.Visible = False
- cmdMaster.Visible = False
- MasterOut.Visible = False
- RecallArray.Visible = False
- Label2.Visible = False
- neworder = 0
- End Sub
- Private Sub cmdOrderRecall_click(sender As Object, e As EventArgs) Handles cmdOrderRecall.Click
- If cmdOrderRecall.CheckState = CheckState.Checked Then
- RecallArray.Visible = True
- Label2.Visible = True
- ElseIf cmdOrderRecall.CheckState = CheckState.Unchecked Then
- RecallArray.Visible = False
- Label2.Visible = False
- End If
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement