You are on page 1of 3

Option Explicit Dim Pprice As Integer Dim Pprice2 As Integer Dim Pprice3 As Integer Dim DP As Integer Dim TP As Integer

Dim lblpizza As String Dim lblpasta As String Dim lblflavor As String Dim lblsize As String Dim lbldrinks As String Private Sub chkcheese_Click(Index As Integer) If chkcheese(Index).Value = 1 Then TP = TP + 10 If chkcheese(Index).Value = 0 Then TP = TP - 10 End Sub Private Sub chkdrinkslarge_Click() If chkdrinkslarge.Value = 0 Then DP = DP - 20 If chkdrinkslarge.Value = 1 Then DP = DP + 20 lblsize = chkdrinkslarge.Caption End Sub Private Sub chkdrinksregular_Click() If chkdrinksregular.Value = 0 Then DP = DP - 0 If chkdrinksregular.Value = 1 Then DP = DP + 0 lblsize = chkdrinksregular.Caption End Sub Private Sub cmddrinks_Click() frapizza.Visible = False frapasta.Visible = False fradrinks.Visible = True End Sub Private Sub cmdorder_Click() txtchange.Text = Val(txtreceived.Text) Val(txttotal.Text) End Sub Private Sub cmdpassub_Click() txtpassub = Pprice2 * Val(txtquantity2) txttotal.Text = Val(txttotal.Text) + Val(txtpassub) Form1.lstitem.AddItem lblpasta Form1.lstprice.AddItem Val(txtpassub) Form1.lstqty.AddItem Val(txtquantity2) resibo.lstitem.AddItem lblpasta resibo.lstprice.AddItem Val(txtpassub) resibo.lstqty.AddItem Val(txtquantity2) Dim I As Integer For I = 0 To 2 optpasta(I).Value = False

Next I txtprice2 = "" txtquantity2 = "" txtpassub = "" End Sub Private Sub cmdpasta_Click() frapizza.Visible = False frapasta.Visible = True fradrinks.Visible = False End Sub Private Sub cmdpizsub_Click() txtpizsub = Pprice * Val(txtquantity) + Val(txtquantity) * TP txttotal.Text = Val(txtpizsub) + Val(txttotal.Text) Form1.lstitem.AddItem lblpizza Form1.lstprice.AddItem Val(txtpizsub) Form1.lstqty.AddItem Val(txtquantity) resibo.lstitem.AddItem lblpizza resibo.lstprice.AddItem Val(txtpizsub) resibo.lstqty.AddItem Val(txtquantity) optpizzasize(0).Value = False optpizzasize(1).Value = False optpizzasize(2).Value = False optflavor(0).Value = False optflavor(1).Value = False optflavor(2).Value = False txtprice = "" txtquantity = "" txtpizsub = "" Dim K As Integer For K = 0 To 5 chkcheese(K).Value = False Next K End Sub Private Sub cmdpizza_Click() frapizza.Visible = True frapasta.Visible = False fradrinks.Visible = False End Sub Private Sub cmdresibo_Click() resibo.Show resibo.txttotal.Text = "P " + txttotal + ".00" resibo.txtreceived.Text = "P " + txtreceived + ".00" resibo.txtchange.Text = "P " + txtchange + ".00" Unload Me End Sub

Private Sub cmdsubdrinks_Click() txtsubdrinks = Pprice3 * Val(txtquantity3) + Val(txtquantity3) * DP txttotal.Text = Val(txtsubdrinks) + Val(txttotal.Text) Form1.lstitem.AddItem lbldrinks + "-" + lblsize Form1.lstprice.AddItem Val(txtsubdrinks) Form1.lstqty.AddItem Val(txtquantity3) resibo.lstitem.AddItem lbldrinks + "-" + lblsize resibo.lstprice.AddItem Val(txtsubdrinks) resibo.lstqty.AddItem Val(txtquantity3) Dim I As Integer For I = 0 To 5 optdrinks(I).Value = False Next I txtprice3 = "" txtquantity3 = "" txtsubdrinks = "" chkdrinkslarge.Value = 0 chkdrinksregular.Value = 0 End Sub Private Sub cmdvoid_Click() Dim I As Integer For I = 0 To lstitem.ListIndex If lstitem.ListIndex = I Then txtprice = Val(lstprice.List(I)) lstqty.ListIndex = I lstprice.ListIndex = I lstitem.RemoveItem I lstqty.RemoveItem I lstprice.RemoveItem I End If Next I txttotal = txttotal - txtprice txtchange = txtreceived - txttotal End Sub Private Sub Form_Load() txtprice = "" txtquantity = "" txtpizsub = "" txtprice2 = "" txtquantity2 = "" txtpassub = "" txtprice3 = "" txtquantity3 = "" txtsubdrinks = "" chkdrinkslarge.Value = 0 chkdrinksregular.Value = 0 End Sub

Private Sub optdrinks_Click(Index As Integer) If optdrinks(0).Value = True Then Pprice3 = 20 txtprice3 = "P 20.00" lbldrinks = optdrinks(0).Caption ElseIf optdrinks(1).Value = True Then Pprice3 = 20 txtprice3 = "P 20.00" lbldrinks = optdrinks(1).Caption ElseIf optdrinks(2).Value = True Then Pprice3 = 20 txtprice3 = "P 20.00" lbldrinks = optdrinks(2).Caption ElseIf optdrinks(3).Value = True Then Pprice3 = 20 txtprice3 = "P 20.00" lbldrinks = optdrinks(3).Caption ElseIf optdrinks(4).Value = True Then Pprice3 = 20 txtprice3 = "P 20.00" lbldrinks = optdrinks(4).Caption ElseIf optdrinks(4).Value = True Then Pprice3 = 20 txtprice2 = "P 20.00" lbldrinks = optdrinks(5).Caption End If End Sub Private Sub optflavor_Click(Index As Integer) If optflavor(0).Value = True Then lblflavor = optflavor(0).Caption ElseIf optflavor(1).Value = True Then lblflavor = optflavor(1).Caption ElseIf optflavor(2).Value = True Then lblflavor = optflavor(2).Caption End If End Sub Private Sub optpasta_Click(Index As Integer) If optpasta(0).Value = True Then Pprice2 = 50 txtprice2 = "P 50.00" lblpasta = optpasta(0).Caption ElseIf optpasta(1).Value = True Then Pprice2 = 60 txtprice2 = "P 60.00" lblpasta = optpasta(1).Caption ElseIf optpasta(2).Value = True Then Pprice2 = 65 txtprice2 = "P 65.00" lblpasta = optpasta(2).Caption End If End Sub

Private Sub optpizzasize_Click(Index As Integer) If optpizzasize(0).Value = True Then Pprice = 500 txtprice = "P 500.00" lblpizza = lblflavor + "-" + optpizzasize(0).Caption ElseIf optpizzasize(1).Value = True Then Pprice = 250 txtprice = "P 250.00"

lblpizza = lblflavor + "-" + optpizzasize(1).Caption ElseIf optpizzasize(2).Value = True Then Pprice = 200 txtprice = "P 200.00" lblpizza = lblflavor + "-" + optpizzasize(2).Caption End If End Sub

You might also like