You are on page 1of 8

LOG IN FORM

Public Class frmLogIn


Dim Username As String
Dim Password As String
Dim Attempt As Integer
Dim ADecision As Boolean
Dim EDecision As Boolean

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click


Me.Close()
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOkay.Click


Username = txtUser.Text
Password = TxtPW.Text

If RdnAdmin.Checked = True And Username = "admin" And Password = "1234" Then


MsgBox("access granted!")
TxtUser.Clear()
txtPW.Clear()
TxtUser.Focus()
Me.Hide()
FrmMainMenu.Show()
ElseIf rdnEmployee.Checked = True And Username = "1234" And Password = "admin" Then
MsgBox("access granted!")
TxtUser.Clear()
txtPW.Clear()
TxtUser.Focus()
Me.Hide()
FrmMainMenu.Show()
ElseIf ADecision = False Or EDecision = False Then
MsgBox("wrong username or password!")
TxtUser.Clear()
txtPW.Clear()
TxtUser.Focus()
End If

Attempt = Attempt + 1
If Attempt = 3 Then
MsgBox("too many Attempts!")
Me.Close()
End If

End Sub

Private Sub RdnAdmin_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


RdnAdmin.CheckedChanged
If Username = "admin" And Password = "1234" Then
ADecision = True
ElseIf Username <> "admin" And Password <> "1234" Then
ADecision = False
End If
End Sub

Private Sub RdnEmployee_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles RdnEmployee.CheckedChanged
If Username = "1234" And Password = "admin" Then
EDecision = True
ElseIf Username <> "1234" And Password <> "admin" Then
EDecision = False
End If
End Sub
End Class

MAIN MENU
Public Class frmMainMenu
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
Dim Ask As MsgBoxResult
Ask = MsgBox("Are you sure you want to quit?", MsgBoxStyle.YesNo, "Main Menu")
If Ask = MsgBoxResult.Yes Then
frmLogIn.Show()
Me.Close()
ElseIf Ask = MsgBoxResult.No Then
Me.ResumeLayout()
End If
End Sub

Private Sub BtnCafe_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCafe.Click


Me.Hide()
frmCafeteria.Show()
End Sub

Private Sub btnCalcu_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalcu.Click


Me.Hide()
frmCompute.Show()
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPicview.Click


Me.Close()
frmPictureView.Show()
End Sub

Private Sub WhatIsThisToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles WhatIsThisToolStripMenuItem.Click
MsgBox("This program is our finals :)).", MsgBoxStyle.OkOnly + MsgBoxStyle.Information, "About this PROGRAM")
End Sub

Private Sub CafeteriaToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles CafeteriaToolStripMenuItem.Click
frmCafeteria.Show()
Me.Hide()
End Sub

Private Sub CalculatorToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles CalculatorToolStripMenuItem.Click
frmCompute.Show()
Me.Hide()
End Sub

Private Sub PictureFrameToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles PictureFrameToolStripMenuItem.Click
frmPictureView.Show()
Me.Hide()
End Sub

Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


ExitToolStripMenuItem.Click
Dim answer As Integer
answer = MsgBox("Are you sure you want to exit?", MsgBoxStyle.Critical + MsgBoxStyle.YesNo, "Main Menu")
If answer = 6 Then
Me.Close()
End If
End Sub
End Class

CAFETERIA
Public Class frmCafeteria

Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


ExitToolStripMenuItem.Click
Dim answer As Integer
answer = MsgBox("Are you sure you want to exit?", MsgBoxStyle.Critical + MsgBoxStyle.YesNo, "Cafeteria")
If answer = 6 Then
Me.Close()
frmLogIn.Close()
End If
End Sub

Private Sub WhatIsThisToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles WhatIsThisToolStripMenuItem.Click
MsgBox("This Program determines the price , style and type of coffee.", MsgBoxStyle.OkOnly +
MsgBoxStyle.Information, "Cafeteria")
End Sub

Private Sub ComputeToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles ComputeToolStripMenuItem.Click
Dim Additional As String = ""
Dim Size As Integer
Dim AddExtras As Integer
Dim Milk As Integer
Dim Creamer As Integer
Dim Sugar As Integer
Dim WhipCream As Integer
Dim Total As Integer
Dim Vat As Integer

If RdnSmall.Checked = True Then


Size = 115
MsgBox("You ordered a Small Sized Drink.")
ElseIf rdnMedium.Checked = True Then
Size = 130
MsgBox("You ordered a Medium Sized Drink.")
ElseIf rdnLarge.Checked = True Then
Size = 145
MsgBox("You ordered a Large Sized Drink.")
End If

If RdnBlended.Checked = True Then


MsgBox("blended coffee.")
ElseIf RdnFrappe.Checked = True Then
MsgBox("frappe.")
ElseIf RdnHot.Checked = True Then
MsgBox("hot coffee.")
End If

If RdnChoco.Checked = True Then


MsgBox("with chocolate syrup.")
ElseIf RdnCaramel.Checked = True Then
MsgBox("with caramel syrup.")
ElseIf RdnVanilla.Checked = True Then
MsgBox("with vanilla syrup.")
End If

If CBMilk.Checked = True Then


Milk = 25
Additional &= "Milk "
End If

If CBCreamer.Checked = True Then


Creamer = 15
Additional &= "Creamer "
End If

If CBsugar.Checked = True Then


Sugar = 10
Additional &= "Sugar "
End If

If CBWhipCream.Checked = True Then


WhipCream = 40
Additional &= "Whip Cream "
End If

If Additional <> "" Then


MsgBox("and your drink has the following Add-ons: " & Additional)
End If

AddExtras = Milk + Creamer + Sugar + WhipCream


Total = AddExtras + Size
Vat = Total * 0.12
txtAmount.Text = Total
txtVat.Text = Vat
MsgBox("the total amount of your order is ₱" & Total)

End Sub

Private Sub ClearToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


ClearToolStripMenuItem.Click
txtAmount.Clear()
txtVat.Clear()
CBCreamer.Checked = False
CBMilk.Checked = False
CBsugar.Checked = False
CBWhipCream.Checked = False
RdnBlended.Checked = 0
RdnCaramel.Checked = 0
RdnChoco.Checked = 0
RdnFrappe.Checked = 0
RdnHot.Checked = 0
rdnLarge.Checked = 0
rdnMedium.Checked = 0
RdnSmall.Checked = 0
RdnVanilla.Checked = 0
End Sub

Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click


txtAmount.Clear()
txtVat.Clear()
CBCreamer.Checked = False
CBMilk.Checked = False
CBsugar.Checked = False
CBWhipCream.Checked = False
RdnBlended.Checked = 0
RdnCaramel.Checked = 0
RdnChoco.Checked = 0
RdnFrappe.Checked = 0
RdnHot.Checked = 0
rdnLarge.Checked = 0
rdnMedium.Checked = 0
RdnSmall.Checked = 0
RdnVanilla.Checked = 0

End Sub

Private Sub btnCompute_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


btnCompute.Click
Dim Additional As String = ""
Dim Size As Integer
Dim AddExtras As Integer
Dim Milk As Integer
Dim Creamer As Integer
Dim Sugar As Integer
Dim WhipCream As Integer
Dim Total As Integer
Dim Vat As Integer

If RdnSmall.Checked = True Then


Size = 115
MsgBox("You ordered a Small Sized Drink.")
ElseIf rdnMedium.Checked = True Then
Size = 130
MsgBox("You ordered a Medium Sized Drink.")
ElseIf rdnLarge.Checked = True Then
Size = 145
MsgBox("You ordered a Large Sized Drink.")
End If

If RdnBlended.Checked = True Then


MsgBox("blended coffee.")
ElseIf RdnFrappe.Checked = True Then
MsgBox("frappe.")
ElseIf RdnHot.Checked = True Then
MsgBox("hot coffee.")
End If

If RdnChoco.Checked = True Then


MsgBox("with chocolate syrup.")
ElseIf RdnCaramel.Checked = True Then
MsgBox("with caramel syrup.")
ElseIf RdnVanilla.Checked = True Then
MsgBox("with vanilla syrup.")
End If

If CBMilk.Checked = True Then


Milk = 25
Additional &= "Milk "
End If

If CBCreamer.Checked = True Then


Creamer = 15
Additional &= "Creamer "
End If

If CBsugar.Checked = True Then


Sugar = 10
Additional &= "Sugar "
End If

If CBWhipCream.Checked = True Then


WhipCream = 40
Additional &= "Whip Cream "
End If

If Additional <> "" Then


MsgBox("and your drink has the following Add-ons: " & Additional)
End If

AddExtras = Milk + Creamer + Sugar + WhipCream


Total = AddExtras + Size
Vat = Total * 0.12
txtAmount.Text = Total
txtVat.Text = Vat
MsgBox("the total amount of your order is ₱" & Total)

End Sub

Private Sub BtnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnExit.Click


Dim Ask As MsgBoxResult
Ask = MsgBox("Are you sure you want to quit?", MsgBoxStyle.YesNo, "Cafeteria")
If Ask = MsgBoxResult.Yes Then
txtAmount.Clear()
txtVat.Clear()
CBCreamer.Checked = False
CBMilk.Checked = False
CBsugar.Checked = False
CBWhipCream.Checked = False
RdnBlended.Checked = 0
RdnCaramel.Checked = 0
RdnChoco.Checked = 0
RdnFrappe.Checked = 0
RdnHot.Checked = 0
rdnLarge.Checked = 0
rdnMedium.Checked = 0
RdnSmall.Checked = 0
RdnVanilla.Checked = 0
frmMainMenu.Show()
Me.Close()
ElseIf Ask = MsgBoxResult.No Then
Me.ResumeLayout()
End If
End Sub
End Class

CALCULATOR
Public Class frmCompute
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
Dim Ask As MsgBoxResult
Ask = MsgBox("Are you sure you want to quit?", MsgBoxStyle.YesNo, "Calculator")
If Ask = MsgBoxResult.Yes Then
frmMainMenu.Show()
Me.Close()
ElseIf Ask = MsgBoxResult.No Then
Me.ResumeLayout()
End If

End Sub

Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click


txtNum1.Clear()
txtNum2.Clear()
CBaddition.Checked = False
CBSubtraction.Checked = False
CBMultiplication.Checked = False
CBDivision.Checked = False
RdnAddition.Checked = 0
RdnSubtraction.Checked = 0
RdnMultiplication.Checked = 0
RdnDivision.Checked = 0
txtNum1.Focus()

End Sub

Private Sub ClearToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


ClearToolStripMenuItem.Click
txtNum1.Clear()
txtNum2.Clear()
CBaddition.Checked = False
CBSubtraction.Checked = False
CBMultiplication.Checked = False
CBDivision.Checked = False
RdnAddition.Checked = 0
RdnSubtraction.Checked = 0
RdnMultiplication.Checked = 0
RdnDivision.Checked = 0
txtNum1.Focus()
End Sub

Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


ExitToolStripMenuItem.Click
Dim answer As Integer
answer = MsgBox("Are you sure you want to exit?", MsgBoxStyle.Critical + MsgBoxStyle.YesNo, "Basic Operations
Calculator")
If answer = 6 Then
Me.Close()
frmLogIn.Close()
End If

End Sub

Private Sub btnCompute_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


btnCompute.Click
Dim no1 As Integer
Dim no2 As Integer
Dim sum As Integer
Dim difference As Integer
Dim product As Integer
Dim Quotient As Integer

no1 = txtNum1.Text
no2 = txtNum2.Text
If CBaddition.Checked = True Then
sum = no1 + no2
End If

If CBSubtraction.Checked = True Then


difference = no1 - no2
End If

If CBMultiplication.Checked = True Then


product = no1 * no2
End If

If CBDivision.Checked = True Then


quotient = no1 / no2
End If

If RdnAddition.Checked = True Then


sum = no1 + no2
ElseIf RdnSubtraction.Checked = True Then
difference = no1 - no2
ElseIf RdnMultiplication.Checked = True Then
product = no1 * no2
ElseIf RdnDivision.Checked = True Then
Quotient = no1 / no2
End If

lblSum.Text = sum
lbldifference.Text = difference
LblProduct.Text = product
lblQuotient.Text = quotient

End Sub

Private Sub AdditionToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


AdditionToolStripMenuItem.Click
Dim no1 As Integer
Dim no2 As Integer
Dim sum As Integer
no1 = txtNum1.Text
no2 = txtNum2.Text
sum = no1 + no2
lblSum.Text = sum
End Sub

Private Sub SubtractionToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles SubtractionToolStripMenuItem.Click
Dim no1 As Integer
Dim no2 As Integer
Dim difference As Integer
no1 = txtNum1.Text
no2 = txtNum2.Text
difference = no1 - no2
lbldifference.Text = difference
End Sub

Private Sub MultiplicationToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles MultiplicationToolStripMenuItem.Click
Dim no1 As Integer
Dim no2 As Integer
Dim Product As Integer
no1 = txtNum1.Text
no2 = txtNum2.Text
Product = no1 * no2
LblProduct.Text = Product
End Sub

Private Sub DivisionToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


DivisionToolStripMenuItem.Click
Dim no1 As Integer
Dim no2 As Integer
Dim Quotient As Integer
no1 = txtNum1.Text
no2 = txtNum2.Text
Quotient = no1 * no2
lblQuotient.Text = Quotient
End Sub
End Class
Public Class PictureView

Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click


Public Class frmPictureView

Private Sub frmPictureView_Mousedown(ByVal sender As Object, ByVal e As _


System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown, _
PictureBox1.MouseDown, PictureBox2.MouseDown
If TypeOf sender Is PictureBox Then
Label1.Location = sender.Location + e.Location
Else
MsgBox("Please click a picture")
End If
End Sub

Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click


Dim Ask As MsgBoxResult
Ask = MsgBox("Are you sure you want to quit?", MsgBoxStyle.YesNo, "Button")
If Ask = MsgBoxResult.Yes Then
frmMainMenu.Show()
Me.Close()
ElseIf Ask = MsgBoxResult.No Then
Me.ResumeLayout()
End If
End Sub

End ClassEnd Class

You might also like