Coffee Ordering Menu
This program is a simple Coffee Ordering System to order a list of coffee orders, save and print a receipt, cash settlement and a tax..
Source Code:
Source Code:
Imports System.Windows.Forms.CheckBoxDOWNLOAD LINKS: CoffeeOrdering.rar
Public Class Form1
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Static i As Integer
Dim welcome As String
welcome = "W e l c o m e t o C o f f e e O r d e r i n g S y s t e m"
i = i + 1
Label7.Text = Label7.Text & Mid(welcome, i, 1)
If Label7.Text = welcome Then
Timer1.Enabled = False
End If
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
Application.Exit()
Me.Close()
End Sub
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
Label8.Text = "Time Check: " & TimeOfDay
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Timer1.Start()
Timer1.Interval = 50
Call Clear()
End Sub
Public Sub Clear()
txtIceCapp.Text = "0"
txtAmerica.Text = "0"
txtAfrica.Text = "0"
txtVales.Text = "0"
txtCapp.Text = "0"
txtIcedLatte.Text = "0"
txtEspresso.Text = "0"
txtLatte.Text = "0"
txtQueen.Text = "0"
txtCarlton.Text = "0"
txtKillburn.Text = "0"
txtLagos.Text = "0"
txtBoston.Text = "0"
txtBlack.Text = "0"
txtRed.Text = "0"
txtCoffee.Text = "0"
txtIceCapp.Enabled = False
txtAmerica.Enabled = False
txtAfrica.Enabled = False
txtVales.Enabled = False
txtCapp.Enabled = False
txtIcedLatte.Enabled = False
txtEspresso.Enabled = False
txtLatte.Enabled = False
txtQueen.Enabled = False
txtCarlton.Enabled = False
txtKillburn.Enabled = False
txtLagos.Enabled = False
txtBoston.Enabled = False
txtBlack.Enabled = False
txtRed.Enabled = False
txtCoffee.Enabled = False
chkIceCapp.Checked = False
chkAmerica.Checked = False
chkAfrica.Checked = False
chkVales.Checked = False
chkCapp.Checked = False
chkIcedLatte.Checked = False
chkEspresso.Checked = False
chkLatte.Checked = False
chkQueens.Checked = False
chkCarlton.Checked = False
chkKillburn.Checked = False
chkLagos.Checked = False
chkBoston.Checked = False
chkBlack.Checked = False
chkRed.Checked = False
chkCoffee.Checked = False
txtDrinks.Text = "0.00"
txtCakes.Text = "0.00"
txtCharge.Text = "0.00"
txtSubTotal.Text = "0.00"
txtTax.Text = "0.00"
txtAmount.Text = "0.00"
End Sub
Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click
Call Clear()
rtfReceipt.Clear()
txtCash.Text = "0.00"
txtChange.Text = "0.00"
Panel1.Visible = False
End Sub
Private Sub chkIceCapp_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkIceCapp.CheckedChanged
If chkIceCapp.Checked = True Then
txtIceCapp.Enabled = True
txtIceCapp.Focus()
txtIceCapp.SelectionStart = 0
txtIceCapp.SelectionLength = Len(txtIceCapp.Text)
Else
txtIceCapp.Enabled = False
txtIceCapp.Text = 0
End If
End Sub
Private Sub chkAmerica_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkAmerica.CheckedChanged
If chkAmerica.Checked = True Then
txtAmerica.Enabled = True
txtAmerica.Focus()
txtAmerica.SelectionStart = 0
txtAmerica.SelectionLength = Len(txtAmerica.Text)
Else
txtAmerica.Enabled = False
txtAmerica.Text = 0
End If
End Sub
Private Sub chkAfrica_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkAfrica.CheckedChanged
If chkAfrica.Checked = True Then
txtAfrica.Enabled = True
txtAfrica.Focus()
txtAfrica.SelectionStart = 0
txtAfrica.SelectionLength = Len(txtAfrica.Text)
Else
txtAfrica.Enabled = False
txtAfrica.Text = 0
End If
End Sub
Private Sub chkVales_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkVales.CheckedChanged
If chkVales.Checked = True Then
txtVales.Enabled = True
txtVales.Focus()
txtVales.SelectionStart = 0
txtVales.SelectionLength = Len(txtVales.Text)
Else
txtVales.Enabled = False
txtVales.Text = 0
End If
End Sub
Private Sub chkCapp_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkCapp.CheckedChanged
If chkCapp.Checked = True Then
txtCapp.Enabled = True
txtCapp.Focus()
txtCapp.SelectionStart = 0
txtCapp.SelectionLength = Len(txtCapp.Text)
Else
txtCapp.Enabled = False
txtCapp.Text = 0
End If
End Sub
Private Sub chkIcedLatte_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkIcedLatte.CheckedChanged
If chkIcedLatte.Checked = True Then
txtIcedLatte.Enabled = True
txtIcedLatte.Focus()
txtIcedLatte.SelectionStart = 0
txtIcedLatte.SelectionLength = Len(txtIcedLatte.Text)
Else
txtIcedLatte.Enabled = False
txtIcedLatte.Text = 0
End If
End Sub
Private Sub chkEspresso_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkEspresso.CheckedChanged
If chkEspresso.Checked = True Then
txtEspresso.Enabled = True
txtEspresso.Focus()
txtEspresso.SelectionStart = 0
txtEspresso.SelectionLength = Len(txtEspresso.Text)
Else
txtEspresso.Enabled = False
txtEspresso.Text = 0
End If
End Sub
Private Sub chkLatte_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkLatte.CheckedChanged
If chkLatte.Checked = True Then
txtLatte.Enabled = True
txtLatte.Focus()
txtLatte.SelectionStart = 0
txtLatte.SelectionLength = Len(txtLatte.Text)
Else
txtLatte.Enabled = False
txtLatte.Text = 0
End If
End Sub
Private Sub chkQueens_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkQueens.CheckedChanged
If chkQueens.Checked = True Then
txtQueen.Enabled = True
txtQueen.Focus()
txtQueen.SelectionStart = 0
txtQueen.SelectionLength = Len(txtQueen.Text)
Else
txtQueen.Enabled = False
txtQueen.Text = 0
End If
End Sub
Private Sub chkCarlton_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkCarlton.CheckedChanged
If chkCarlton.Checked = True Then
txtCarlton.Enabled = True
txtCarlton.Focus()
txtCarlton.SelectionStart = 0
txtCarlton.SelectionLength = Len(txtCarlton.Text)
Else
txtCarlton.Enabled = False
txtCarlton.Text = 0
End If
End Sub
Private Sub chkKillburn_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkKillburn.CheckedChanged
If chkKillburn.Checked = True Then
txtKillburn.Enabled = True
txtKillburn.Focus()
txtKillburn.SelectionStart = 0
txtKillburn.SelectionLength = Len(txtKillburn.Text)
Else
txtKillburn.Enabled = False
txtKillburn.Text = 0
End If
End Sub
Private Sub chkLagos_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkLagos.CheckedChanged
If chkLagos.Checked = True Then
txtLagos.Enabled = True
txtLagos.Focus()
txtLagos.SelectionStart = 0
txtLagos.SelectionLength = Len(txtLagos.Text)
Else
txtLagos.Enabled = False
txtLagos.Text = 0
End If
End Sub
Private Sub chkBoston_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkBoston.CheckedChanged
If chkBoston.Checked = True Then
txtBoston.Enabled = True
txtBoston.Focus()
txtBoston.SelectionStart = 0
txtBoston.SelectionLength = Len(txtBoston.Text)
Else
txtBoston.Enabled = False
txtBoston.Text = 0
End If
End Sub
Private Sub chkBlack_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkBlack.CheckedChanged
If chkBlack.Checked = True Then
txtBlack.Enabled = True
txtBlack.Focus()
txtBlack.SelectionStart = 0
txtBlack.SelectionLength = Len(txtBlack.Text)
Else
txtBlack.Enabled = False
txtBlack.Text = 0
End If
End Sub
Private Sub chkRed_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkRed.CheckedChanged
If chkRed.Checked = True Then
txtRed.Enabled = True
txtRed.Focus()
txtRed.SelectionStart = 0
txtRed.SelectionLength = Len(txtRed.Text)
Else
txtRed.Enabled = False
txtRed.Text = 0
End If
End Sub
Private Sub chkCoffee_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkCoffee.CheckedChanged
If chkCoffee.Checked = True Then
txtCoffee.Enabled = True
txtCoffee.Focus()
txtCoffee.SelectionStart = 0
txtCoffee.SelectionLength = Len(txtCoffee.Text)
Else
txtCoffee.Enabled = False
txtCoffee.Text = 0
End If
End Sub
Private Sub btnPay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPay.Click
Panel1.Visible = True
GroupBox3.Visible = True
txtCash.Focus()
txtCash.SelectionStart = 0
txtCash.SelectionLength = Len(txtCash.Text)
End Sub
Private Sub Label11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label11.Click
Panel1.Visible = False
GroupBox3.Visible = False
End Sub
Private Sub txtNumbersOnly(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtVales.KeyPress, txtRed.KeyPress, txtQueen.KeyPress, txtLatte.KeyPress, txtLagos.KeyPress, txtKillburn.KeyPress, txtIcedLatte.KeyPress, txtIceCapp.KeyPress, txtEspresso.KeyPress, txtCoffee.KeyPress, txtCarlton.KeyPress, txtCapp.KeyPress, txtBoston.KeyPress, txtBlack.KeyPress, txtAmerica.KeyPress, txtAfrica.KeyPress, txtChange.KeyPress
If Char.IsDigit(e.KeyChar) = False And Char.IsControl(e.KeyChar) = False Then
e.Handled = True
MsgBox("Please enter valid number!", MsgBoxStyle.Exclamation + vbOKOnly, "Warning")
End If
End Sub
Private Sub btnOk_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOk.Click
If Val(txtChange.Text) >= 0.0 Then
rtfReceipt.Clear()
rtfReceipt.AppendText(vbTab + vbTab + vbTab + "Wake Up Cafe" + Environment.NewLine)
rtfReceipt.AppendText("=======================================================" + Environment.NewLine)
rtfReceipt.AppendText("*************************************D*R*I*N*K*S*******************************" + Environment.NewLine)
rtfReceipt.AppendText(vbTab + "Iced-Cappucino" + vbTab + vbTab + vbTab + vbTab + txtIceCapp.Text + Environment.NewLine)
rtfReceipt.AppendText(vbTab + "American Coffee" + vbTab + vbTab + vbTab + vbTab + txtAmerica.Text + Environment.NewLine)
rtfReceipt.AppendText(vbTab + "African Coffee" + vbTab + vbTab + vbTab + vbTab + txtAfrica.Text + Environment.NewLine)
rtfReceipt.AppendText(vbTab + "Vales Coffee" + vbTab + vbTab + vbTab + vbTab + txtVales.Text + Environment.NewLine)
rtfReceipt.AppendText(vbTab + "Cappucino" + vbTab + vbTab + vbTab + vbTab + txtCapp.Text + Environment.NewLine)
rtfReceipt.AppendText(vbTab + "Iced-Latte" + vbTab + vbTab + vbTab + vbTab + txtIcedLatte.Text + Environment.NewLine)
rtfReceipt.AppendText(vbTab + "Espresso" + vbTab + vbTab + vbTab + vbTab + vbTab + txtEspresso.Text + Environment.NewLine)
rtfReceipt.AppendText(vbTab + "Latte" + vbTab + vbTab + vbTab + vbTab + vbTab + txtLatte.Text + Environment.NewLine)
rtfReceipt.AppendText("*************************************C*A*K*E*S*********************************" + Environment.NewLine)
rtfReceipt.AppendText(vbTab + "Queens Park " + vbTab + vbTab + vbTab + vbTab + txtQueen.Text + Environment.NewLine)
rtfReceipt.AppendText(vbTab + "Carlton Hill" + vbTab + vbTab + vbTab + vbTab + txtCarlton.Text + Environment.NewLine)
rtfReceipt.AppendText(vbTab + "Killburn" + vbTab + vbTab + vbTab + vbTab + vbTab + txtKillburn.Text + Environment.NewLine)
rtfReceipt.AppendText(vbTab + "Lagos" + vbTab + vbTab + vbTab + vbTab + vbTab + txtLagos.Text + Environment.NewLine)
rtfReceipt.AppendText(vbTab + "Boston" + vbTab + vbTab + vbTab + vbTab + vbTab + txtBoston.Text + Environment.NewLine)
rtfReceipt.AppendText(vbTab + "Black" + vbTab + vbTab + vbTab + vbTab + vbTab + txtBlack.Text + Environment.NewLine)
rtfReceipt.AppendText(vbTab + "Red" + vbTab + vbTab + vbTab + vbTab + vbTab + txtRed.Text + Environment.NewLine)
rtfReceipt.AppendText(vbTab + "Coffee" + vbTab + vbTab + vbTab + vbTab + vbTab + txtCoffee.Text + Environment.NewLine)
rtfReceipt.AppendText("=======================================================" + Environment.NewLine)
rtfReceipt.AppendText("Service Charge:" + vbTab + vbTab + vbTab + vbTab + vbTab + txtCharge.Text + Environment.NewLine)
rtfReceipt.AppendText("=======================================================" + Environment.NewLine + Environment.NewLine)
rtfReceipt.AppendText("Tax:" + vbTab + vbTab + vbTab + vbTab + vbTab + vbTab + txtTax.Text + Environment.NewLine)
rtfReceipt.AppendText("Sub Total:" + vbTab + vbTab + vbTab + vbTab + vbTab + txtSubTotal.Text + Environment.NewLine)
rtfReceipt.AppendText("Total Amount" + vbTab + vbTab + vbTab + vbTab + vbTab + txtAmount.Text + Environment.NewLine)
rtfReceipt.AppendText("=======================================================" + Environment.NewLine + Environment.NewLine)
rtfReceipt.AppendText("Cash: " + vbTab + vbTab + vbTab + vbTab + vbTab + vbTab + FormatNumber(Val(txtCash.Text)) + Environment.NewLine)
rtfReceipt.AppendText("Change:" + vbTab + vbTab + vbTab + vbTab + vbTab + vbTab + FormatNumber(txtChange.Text) + Environment.NewLine)
rtfReceipt.AppendText("=======================================================" + Environment.NewLine)
rtfReceipt.AppendText("Time: " + TimeOfDay + vbTab + vbTab + vbTab + vbTab + "Date: " + DateString + Environment.NewLine)
Panel1.Visible = False
Else
MsgBox("Insufficient Cash, Try Again!", MsgBoxStyle.Exclamation + MsgBoxStyle.OkOnly, "Warning")
txtCash.SelectionStart = 0
txtCash.SelectionLength = Len(txtCash.Text)
Exit Sub
End If
End Sub
Private Sub PrintToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PrintToolStripButton.Click
PrintPreviewDialog1.Document = PrintDocument1
PrintPreviewDialog1.ShowDialog()
End Sub
Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
e.Graphics.DrawString(rtfReceipt.Text, New Font("Arial", 14, FontStyle.Regular), Brushes.Black, 120, 120)
End Sub
Private Sub NewToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NewToolStripButton.Click
rtfReceipt.Clear()
End Sub
Private Sub OpenToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenToolStripButton.Click
OpenFileDialog1.FileName = "Text Files (*.txt)|*.txt|All files (*.*)|*.*"
If (OpenFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK) Then
rtfReceipt.LoadFile(OpenFileDialog1.FileName, RichTextBoxStreamType.PlainText)
End If
End Sub
Private Sub SaveToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveToolStripButton.Click
SaveFileDialog1.Filter = "TEXT Files (*.txt*|*.txt"
If SaveFileDialog1.ShowDialog = System.Windows.Forms.DialogResult.OK Then
My.Computer.FileSystem.WriteAllText(SaveFileDialog1.FileName, rtfReceipt.Text, True)
End If
End Sub
Private Sub btnOrder_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOrder.Click
Dim icecapp, america, africa, vales, capp, icedlatte, espresso, latte As Double
Dim queen, carlton, killburn, lagos, boston, black, red, coffee, tax As Double
tax = 0.12
icecapp = 143.52
america = 129.6
africa = 115.2
vales = 109.73
capp = 123.49
icedlatte = 131.35
espresso = 117.39
latte = 102.59
queen = 151.48
carlton = 138.46
killburn = 118.75
lagos = 93.95
boston = 98.25
black = 125.98
red = 132.53
coffee = 89.85
Dim costdrinks, costcakes, servicecharge As Double
costdrinks = (icecapp * Val(txtIceCapp.Text)) + (america * Val(txtAmerica.Text)) + (africa * Val(txtAfrica.Text)) + _
(vales * Val(txtVales.Text)) + (capp * Val(txtCapp.Text)) + (icedlatte * Val(txtIcedLatte.Text)) + _
(espresso * Val(txtEspresso.Text)) + (latte * Val(txtLatte.Text))
costcakes = (queen * Val(txtQueen.Text)) + (carlton * Val(txtCarlton.Text)) + (killburn * Val(txtKillburn.Text)) + _
(lagos * Val(txtLagos.Text)) + (boston * Val(txtBoston.Text)) + (black * Val(txtBlack.Text)) + _
(red * Val(txtRed.Text)) + (coffee * Val(txtCoffee.Text))
txtDrinks.Text = FormatNumber(costdrinks)
txtCakes.Text = FormatNumber(costcakes)
servicecharge = 35.95
txtCharge.Text = servicecharge
Dim stotal As Double
stotal = FormatNumber(Convert.ToDouble(txtDrinks.Text) + Convert.ToDouble(txtCakes.Text) + Convert.ToDouble(servicecharge))
txtSubTotal.Text = FormatNumber(stotal)
txtTax.Text = FormatNumber(stotal * tax)
txtAmount.Text = FormatNumber(stotal + Convert.ToDouble(txtTax.Text))
End Sub
Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click
If MsgBox("Are you sure to CANCEL your Order?", MsgBoxStyle.Exclamation + MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
Call Clear()
rtfReceipt.Clear()
txtCash.Text = "0.00"
txtChange.Text = "0.00"
Panel1.Visible = False
Else
Exit Sub
End If
End Sub
Private Sub txtCash_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtCash.KeyPress
If Asc(e.KeyChar) = 13 Then
e.Handled = True
btnOk_Click(sender, e)
Else
e.Handled = False
End If
End Sub
Private Sub txtCash_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtCash.TextChanged
On Error Resume Next
txtChange.Text = FormatNumber((txtCash.Text) - (txtAmount.Text))
End Sub
End Class
Coffee Ordering Menu
Reviewed by code-dev
on
9:26 PM
Rating:
What is the decryption key please help me.
ReplyDelete