MELJUN CORTES VB Ordering System Documetation (FULL & COMPLETE)

Embed Size (px)

Citation preview

  • 7/27/2019 MELJUN CORTES VB Ordering System Documetation (FULL & COMPLETE)

    1/43

    Programming Language

    Ordering System

    Page 1

    Start Page

    Figure 1.0

    Start Page

    Front page/Start page consists of;

    Login button Login page appears.

    Register button Shows the register page where user creates an account.

    Close button End/Close the application.

    Design The Logo (PL, Programming Language), the Ordering System being the title.

  • 7/27/2019 MELJUN CORTES VB Ordering System Documetation (FULL & COMPLETE)

    2/43

    Programming Language

    Ordering System

    Page 2

    Registration Page

    Figure 2.0

    Registration Page

  • 7/27/2019 MELJUN CORTES VB Ordering System Documetation (FULL & COMPLETE)

    3/43

    Programming Language

    Ordering System

    Page 3

    Registration page consists of two main parts Personal Information and Account Information,

    Personal Information

    Firstname Where the user inputs his/her first name. Maximum of 15 characters (letters).

    Lastname Where the user inputs his/her last name. Maximum of 15 characters (letters).

    Address The users home address. Maximum of 50 characters (letters).

    Gender User checks if hes a male or shes a female.

    Birthdate The user inputs the day he/she was born. The user cannot be below 18 years old.

    Contact Number This is the personal or non-personal contact information of the user. Maximum of 11 characters (numbers).

    Account Information

    Username The ID the user will use in logging in the application. Maximum of 20 characters (letters/numbers).

    Password This is the validation of the account (Whether its not a valid account or having an incorrect password).

    Maximum of 20 characters (letters/numbers).

    Email Address With the user permission, the news or announcements regarding the application can be received by the

    email address inputted.

    Design Some circles for the division of the title and buttons, the Sign Up, Personal Information, and Account Information being the

    header titles.

  • 7/27/2019 MELJUN CORTES VB Ordering System Documetation (FULL & COMPLETE)

    4/43

    Programming Language

    Ordering System

    Page 4

    Registration Page (Validation)

    Figure 2.1

    Registration Page (Validation)

    If the fields in the registration page are incomplete or all unfilled there will be a validation text below the form (Please complete the

    form.).

  • 7/27/2019 MELJUN CORTES VB Ordering System Documetation (FULL & COMPLETE)

    5/43

    Programming Language

    Ordering System

    Page 5

    Login Page

    Figure 3.0

    Login Page

    Front page/Start page consists of;

    Login button If the username and password inputted is valid, the user will now view the main page.

    Cancel button Return to the start page.

    Design The Logo (T, Theodore) and, the Login being the title.

  • 7/27/2019 MELJUN CORTES VB Ordering System Documetation (FULL & COMPLETE)

    6/43

    Programming Language

    Ordering System

    Page 6

    Login Page (Validation)

    Figure 3.1

    Login Page (Username and Password)

    If the fields in the login page are all unfilled, Please enter a

    username and password shows.

    Figure 3.2

    Login Page (Password)

    If the username and password is not valid/ not found in the

    database, Enter a valid username and password. shows.

    Figure 3.3

    Login Page (Password)

    If the password field is blank, Please enter a password shows.

    Figure 3.4

    Login Page (Username)

    If the username field is blank, Please enter a username shows.

  • 7/27/2019 MELJUN CORTES VB Ordering System Documetation (FULL & COMPLETE)

    7/43

    Programming Language

    Ordering System

    Page 7

    Main Page

    Figure 4.0

    Main Page

  • 7/27/2019 MELJUN CORTES VB Ordering System Documetation (FULL & COMPLETE)

    8/43

    Programming Language

    Ordering System

    Page 8

    Main page consists of two main parts Mailing address/ information, and the item bought/ information.

    Mailing information

    Address This is where the product/item will be delivered. Mailing address is divided into 2 parts, Address 1 and Address 2.

    City This is the user city.

    St Street where the user lives.

    Country Is where the user lives.

    Paid Via Paid via is to determine is the user will pay via cash or prepaid card.

    Item Information (or mostly preferred as cart)

    This is where the items bought/ will be bought is placed.

    Order button This shows the page where the user can choose what to order.

    Save button If none of the fields are blank, click save to save the informations to our database.

    Profile button This button makes the user view and/or edit his/her profile.

    Logout button Remove/stops the user from using the main page of the application.

  • 7/27/2019 MELJUN CORTES VB Ordering System Documetation (FULL & COMPLETE)

    9/43

    Programming Language

    Ordering System

    Page 9

    Profile Page

    Figure 5.0a

    Profile Page (View state)Figure 5.0b

    Profile Page (Edit state)

  • 7/27/2019 MELJUN CORTES VB Ordering System Documetation (FULL & COMPLETE)

    10/43

    Programming Language

    Ordering System

    Page 10

    Profile page consists of,

    Firstname This shows the user their first name.

    Lastname This shows the user their last name.

    Address This shows the user their home address.

    Gender Tells if the user is female or male.

    Birthdate This shows the user their birth date.

    Contact Number The users contact number.

    Username The users username.

    Password The users password.

    Email Address Shows the user their username.

    Edit button Lets the user edit their account information.

    Back button Returns the user to the main page.

    Profile page has two states; the view state and the edit state. In view state, the user can only view his/her personal information while edit

    state, the user can edit their account.

  • 7/27/2019 MELJUN CORTES VB Ordering System Documetation (FULL & COMPLETE)

    11/43

    Programming Language

    Ordering System

    Page 11

    Order Page

    Figure 6.0

    Order Page

  • 7/27/2019 MELJUN CORTES VB Ordering System Documetation (FULL & COMPLETE)

    12/43

    Programming Language

    Ordering System

    Page 12

    Order page consists of,

    Item This contains 3 choices; Pizza, Coffee, and Ice Cream.

    Pizza

    Figure 6.1Order Page (Pizza)

    Coffee

    Figure 6.2Order Page (Coffee)

  • 7/27/2019 MELJUN CORTES VB Ordering System Documetation (FULL & COMPLETE)

    13/43

    Programming Language

    Ordering System

    Page 13

    Ice Cream

    Figure 6.3

    Order Page (Ice Cream)

    Cancel button Returns the user from the main page.

    The will click the picture of what item/ product they desire, and the ordering page appears.

  • 7/27/2019 MELJUN CORTES VB Ordering System Documetation (FULL & COMPLETE)

    14/43

    Programming Language

    Ordering System

    Page 14

    Order Page

    (Product Details)

    Figure 7.0

    Order Page

    (Product Details)

  • 7/27/2019 MELJUN CORTES VB Ordering System Documetation (FULL & COMPLETE)

    15/43

    Programming Language

    Ordering System

    Page 15

    This order page consists of;

    Item number Item numbers are constant for every product each item has their own item numbers.

    Item name This is the products name.

    Type This refers to the products variety (ie. 10, 14, Small, Large, Venti, Tall).

    Discount Two types of discount for this application is, no discount and senior citizen.

    Price It is the price of the product.

    Tax This application uses 20% tax.

    Quantity the number of items the user will buy.

    Total the total price of the item when the quantity is entered.

    Save button Save the product/ items to the users cart list.

    Cancel button Returns the user to the other order page.

  • 7/27/2019 MELJUN CORTES VB Ordering System Documetation (FULL & COMPLETE)

    16/43

    Programming Language

    Ordering System

    Page 16

    Figure I

    Home Form

    Public Class HomeForm

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

    btnRegister.Click

    Me.Hide()

    RegistrationForm.Show()

    End Sub

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

    btnLogin.Click

    Me.Hide()

    LoginForm.Show()

    End Sub

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

    btnClose.Click

    End

    End Sub

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

    MyBase.Load

    dbProvider = "PROVIDER=Microsoft.ACE.OLEDB.12.0;"

    dbSource = "Data Source=C:\Program Files\Ordering System\ProgLanguage.accdb"

    con.ConnectionString = dbProvider & dbSource

    End Sub

    End Class

  • 7/27/2019 MELJUN CORTES VB Ordering System Documetation (FULL & COMPLETE)

    17/43

    Programming Language

    Ordering System

    Page 17

    Figure II

    Login Form

    Imports System.Data.OleDbPublic Class LoginForm

    Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesbtnCancel.Click

    Me.Close()HomeForm.Show()End SubPrivate Sub btnLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles

    btnLogin.ClickIf txtUsername.Text = "" And txtPassword.Text = "" Then

    Call messageGen("Please enter a username and password.")ElseIf txtUsername.Text "" And txtPassword.Text = "" Then

    Call messageGen("Please enter a pasword.")ElseIf txtPassword.Text "" And txtUsername.Text = "" Then

    Call messageGen("Please enter a username.")Else

    Call selectSql("Select * from Account where custUsername= '" & txtUsername.Text & "' " &"And custPassword= '" & txtPassword.Text & "'")

    If (txtUsername.Text = Username And txtPassword.Text = Password) Thencon.Close()Me.Close()EmpName = FullnameMainForm.Show()

    ElseCall messageGen("Enter a valid Username and Password.")

    End IfEnd If

    End SubPrivate Sub messageGen(ByVal message As String)

    lblMessage.Visible = TruelblMessage.Text = message

    End SubPrivate Sub clearField()

    txtUsername.Text = ""txtPassword.Text = ""lblMessage.Visible = False

    End SubEnd Class

  • 7/27/2019 MELJUN CORTES VB Ordering System Documetation (FULL & COMPLETE)

    18/43

    Programming Language

    Ordering System

    Page 18

    Figure III.1

    Registration Form

    Imports System.Data.OleDbPublic Class RegistrationForm

    Private Sub cboxMale_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlescboxMale.CheckedChanged

    If cboxMale.CheckState = CheckState.Checked Then

    cboxFemale.CheckState = CheckState.UncheckedGender = cboxMale.Text

    End IfEnd SubPrivate Sub cboxFemale_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles

    cboxFemale.CheckedChangedIf cboxFemale.CheckState = CheckState.Checked Then

    cboxMale.CheckState = CheckState.UncheckedGender = cboxFemale.Text

    End IfEnd SubPrivate Sub btnRegister_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles

    btnRegister.Click

    Call executeRegister()End SubPrivate Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles

    btnCancel.ClickMe.Close()HomeForm.Show()

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

    Call clearField()End SubPrivate Sub executeRegister()

    If txtFirstname.Text = "" Or txtLastname.Text = "" Or txtAddress.Text = "" Or txtContact.Text = "" OrtxtUsername.Text = "" Or txtPassword.Text = "" Or txtEmail.Text = "" Or cmboxEmail.Text = "" _

    Or (cboxFemale.CheckState = CheckState.Unchecked And cboxMale.CheckState = CheckState.Unchecked) _

    Or Not txtContact.Text.Length = 11 ThenCall messageGen("Please complete the form.")

    ElseIf dateBday.Value.Year > 1992 Then

    Call messageGen("You should be atleast 18 years old.")Else

    Firstname = txtFirstname.TextLastname = txtLastname.TextFullname = Firstname + " " + LastnameAddress = txtAddress.Text

  • 7/27/2019 MELJUN CORTES VB Ordering System Documetation (FULL & COMPLETE)

    19/43

    Programming Language

    Ordering System

    Page 19

    Figure III.2

    Registration Form

    Username = txtUsername.TextPassword = txtPassword.TextEmail = txtEmail.Text + cmboxEmail.Text

    sql = "INSERT INTO Account(custName, custAddress, custGender, custBirthday, custContact,custUsername, custPassword, custEmail) VALUES ('" & Fullname _& "', '" & Address & "', '" & Gender _& "', '" & Birthday & "', '" & Contact _& "', '" & Username _& "', '" & Password _& "', '" & Email & "')"

    con.Open()cmd = New OleDbCommand(sql, con)cmd.ExecuteNonQuery()con.Close()Me.Close()HomeForm.Show()

    End If

    End IfEnd SubPrivate Sub messageGen(ByVal message As String)

    lblMessage.Visible = TruelblMessage.TextAlign = ContentAlignment.MiddleCenterlblMessage.Text = message

    End SubPrivate Sub clearField()

    txtFirstname.Text = ""txtLastname.Text = ""txtAddress.Text = ""txtContact.Text = ""txtUsername.Text = ""txtPassword.Text = ""txtEmail.Text = ""dateBday.Value = "1/1/1990"cboxMale.CheckState = CheckState.UncheckedcboxFemale.CheckState = CheckState.UncheckedcmboxEmail.Text = ""messageGen("")

    End SubPrivate Sub keyDisable(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles

    cmboxEmail.KeyPresse.Handled = True

  • 7/27/2019 MELJUN CORTES VB Ordering System Documetation (FULL & COMPLETE)

    20/43

    Programming Language

    Ordering System

    Page 20

    Figure III.3

    Registration Form

    End SubPrivate Sub letterOnly(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles

    txtFirstname.KeyPress, txtLastname.KeyPress' A - Z, a - zIf (e.KeyChar < Chr(65) Or e.KeyChar > Chr(90)) _

    And (e.KeyChar < Chr(97) Or e.KeyChar > Chr(122)) ThenIf (e.KeyChar Chr(32)) Then 'Space

    e.Handled = TrueEnd If

    End IfIf e.KeyChar = Chr(8) Then ' Backspace

    e.Handled = FalseEnd If

    End SubPrivate Sub numOnly(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles

    txtContact.KeyPress' 0 - 9If Not Char.IsDigit(e.KeyChar) Then

    e.Handled = TrueEnd IfIf e.KeyChar = Chr(8) Then 'Backspace

    e.Handled = FalseEnd If

    End SubPrivate Sub letnumOnly(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles

    txtUsername.KeyPress, txtPassword.KeyPress' A - Z , a - z , 0 - 9If (e.KeyChar < Chr(65) Or e.KeyChar > Chr(90)) _And (e.KeyChar < Chr(97) Or e.KeyChar > Chr(122)) Then

    If (e.KeyChar Chr(32) Or e.KeyChar Chr(95)) _And (e.KeyChar < Chr(48) Or (e.KeyChar > Chr(57))) Then 'space, +,.,-

    e.Handled = True

    End IfEnd IfIf e.KeyChar = Chr(8) Then ' Backspace

    e.Handled = FalseEnd If

    End SubEnd Class

  • 7/27/2019 MELJUN CORTES VB Ordering System Documetation (FULL & COMPLETE)

    21/43

    Programming Language

    Ordering System

    Page 21

    Figure IV.1

    Profile Form

    Imports System.Data.OleDbPublic Class ProfileForm

    Private Sub ProfileForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.LoadCall disableFields()Call selectSql("Select * from Account where custName= '" & EmpName & "' ")

    txtName.Text = FullnametxtAddress.Text = AddressIf Gender = "Male" Then

    cboxMale.CheckState = CheckState.CheckedElseIf Gender = "Female" Then

    cboxFemale.CheckState = CheckState.CheckedEnd IfdateBday.Value = BirthdaytxtContact.Text = ContacttxtUsername.Text = UsernametxtPassword.Text = PasswordtxtEmail.Text = Email

    End SubPrivate Sub btnEdit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEdit.Click

    btnSave.Visible = TruebtnEdit.Visible = FalseCall enableFields()

    End SubPrivate Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBack.Click

    Me.Close()MainForm.Show()

    End SubPrivate Sub cboxMale_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles

    cboxMale.CheckedChangedIf cboxMale.CheckState = CheckState.Checked Then

    cboxFemale.CheckState = CheckState.UncheckedGender = "Male"

    End IfEnd SubPrivate Sub cboxFemale_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles

    cboxFemale.CheckedChangedIf cboxFemale.CheckState = CheckState.Checked Then

    cboxMale.CheckState = CheckState.Unchecked

  • 7/27/2019 MELJUN CORTES VB Ordering System Documetation (FULL & COMPLETE)

    22/43

    Programming Language

    Ordering System

    Page 22

    Figure IV.2

    Profile Form

    Gender = "Male"End If

    End SubPrivate Sub cboxFemale_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles

    cboxFemale.CheckedChanged

    If cboxFemale.CheckState = CheckState.Checked ThencboxMale.CheckState = CheckState.UncheckedGender = "Female"

    End IfEnd SubPrivate Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click

    If txtName.Text = "" Or txtAddress.Text = "" Or txtContact.Text = "" Or txtUsername.Text = "" OrtxtPassword.Text = "" Or txtEmail.Text = "" Then

    MsgBox("Please complete the form.", MsgBoxStyle.OkOnly, "ProgLanguage")Else

    Call setInformation()Call updateSql("UPDATE Account SET custName = '" & Fullname & "'," & "custAddress = '" & Address &

    "'," & "custGender = '" & Gender & "'," & "custBirthday = '" & Birthday & "'," & "custContact = '" & Contact &"'," & "custUsername = '" & Username & "'," & "custPassword = '" & Password & "'," & "custEmail = '" & Email & "'WHERE custName= '" & EmpName & "' ")

    returnType = MsgBox("Profile updated. Do you want to continue?", MsgBoxStyle.YesNo, "ProgLanguage")If Not returnType = 6 Then

    Me.Close()MainForm.Show()

    ElsebtnEdit.Visible = TruebtnSave.Visible = FalseCall disableFields()

    End IfEnd If

    End Sub

    Private Sub setInformation()Fullname = txtName.TextAddress = txtAddress.TextBirthday = dateBday.ValueContact = txtContact.TextUsername = txtUsername.TextPassword = txtPassword.Text

  • 7/27/2019 MELJUN CORTES VB Ordering System Documetation (FULL & COMPLETE)

    23/43

    Programming Language

    Ordering System

    Page 23

    Figure IV.3

    Profile Form

    Email = txtEmail.TextEnd SubPrivate Sub disableFields()

    txtName.Enabled = FalsetxtAddress.Enabled = False

    cboxMale.Enabled = FalsecboxFemale.Enabled = FalsedateBday.Enabled = FalsetxtContact.Enabled = FalsetxtUsername.Enabled = FalsetxtPassword.Enabled = FalsetxtEmail.Enabled = False

    End SubPrivate Sub enableFields()

    txtName.Enabled = TruetxtAddress.Enabled = TruecboxMale.Enabled = TruecboxFemale.Enabled = TruedateBday.Enabled = TruetxtContact.Enabled = TruetxtUsername.Enabled = TruetxtPassword.Enabled = TruetxtEmail.Enabled = True

    End SubEnd Class

  • 7/27/2019 MELJUN CORTES VB Ordering System Documetation (FULL & COMPLETE)

    24/43

    Programming Language

    Ordering System

    Page 24

    Figure V.1

    Main Form

    Imports System.Data.OleDbPublic Class MainForm

    Private Sub MainForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.LoadCall selectSql("Select * from Account where custName= '" & EmpName & "' ")Call shipOrder()

    Call itemOrder()Call viewDetails()

    End SubPrivate Sub MainForm_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs)

    Handles Me.FormClosingds.Clear()itemData.DataSource = ds

    End SubPrivate Sub btnProfile_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles

    btnProfile.ClickMe.Close()ProfileForm.Show()

    End SubPrivate Sub btnLogout_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles

    btnLogout.ClickMe.Close()LoginForm.Show()

    End SubPrivate Sub btnOrder_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOrder.Click

    Me.Close()ProductForm.Show()

    End SubPrivate Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click

    If txtAddress1.Text = "" Or txtAddress2.Text = "" Or txtCity.Text = "" Or txtCountry.Text = "" OrtxtStreet.Text = "" Or cboxVia.Text = "" Then

    MsgBox("Complete the fields.", MsgBoxStyle.OkOnly, "ProgLanguage")Else

    EmpName = custName.TextAddress1 = txtAddress1.TextAddress2 = txtAddress2.TextShipCity = txtCity.TextShipStreet = txtStreet.TextShipCountry = txtCountry.TextPaidInfo = cboxVia.Text

    sql = "SELECT EmpName from ShipOrder where EmpName = '" & EmpName & "'"cmd = New OleDbCommand(sql, con)con.Open()

  • 7/27/2019 MELJUN CORTES VB Ordering System Documetation (FULL & COMPLETE)

    25/43

    Programming Language

    Ordering System

    Page 25

    Figure V.2

    Main Form

    rdr = cmd.ExecuteReaderIf rdr.HasRows Then

    rdr.Read()CustomerName = rdr("EmpName")

    End If

    con.Close()If Not custName.Text = CustomerName Then

    sql = "INSERT INTO ShipOrder(EmpName, Address1, Address2, ShipCity, ShipStreet, ShipCountry,PaidInfo) VALUES ('" _

    & EmpName & "', '" & Address1 & "', '" & Address2 & "', '" & ShipCity _& "', '" & ShipStreet & "', '" & ShipCountry _& "', '" & PaidInfo & "')"

    con.Open()cmd = New OleDbCommand(sql, con)cmd.ExecuteNonQuery()con.Close()

    Elsesql = "UPDATE ShipOrder SET Address1 = '" & Address1 & _

    "' , Address2 = '" & Address2 & _"', ShipCity = '" & ShipCity & _"', ShipStreet = '" & ShipStreet & _"', ShipCountry = '" & ShipCountry & _"', PaidInfo = '" & PaidInfo & "' WHERE EmpName = '" & EmpName & "'"

    con.Open()cmd = New OleDbCommand(sql, con)cmd.ExecuteNonQuery()con.Close()

    End IfEnd If

    End SubPrivate Sub shipOrder()

    sql = "Select * from ShipOrder where EmpName= '" & EmpName & "' "

    cmd = New OleDbCommand(sql, con)con.Open()Try

    rdr = cmd.ExecuteReaderIf rdr.HasRows Then

    rdr.Read()

  • 7/27/2019 MELJUN CORTES VB Ordering System Documetation (FULL & COMPLETE)

    26/43

    Programming Language

    Ordering System

    Page 26

    Figure V.3

    Main Form

    Address1 = rdr("Address1")Address2 = rdr("Address2")ShipCity = rdr("ShipCity")ShipStreet = rdr("ShipStreet")ShipCountry = rdr("ShipCountry")

    PaidInfo = rdr("PaidInfo")txtAddress1.Text = Address1txtAddress2.Text = Address2txtCity.Text = ShipCitytxtStreet.Text = ShipStreettxtCountry.Text = ShipCountrycboxVia.Text = PaidInfo

    End IfCatchEnd Trycon.Close()

    End SubPrivate Sub itemOrder()

    sql = "Select * from ItemOrder where custName= '" & EmpName & "' "da = New OleDbDataAdapter(sql, con)da.Fill(ds, "Order")dt = ds.Tables("Order")itemData.DataSource = dt

    End SubPrivate Sub viewDetails()

    If Account < 10 ThencustNumber.Text = "0000-000" & Account

    ElseIf Account < 100 ThencustNumber.Text = "0000-00" & Account

    ElseIf Account < 1000 ThencustNumber.Text = "0000-0" & Account

    ElseIf Account < 10000 Then

    custNumber.Text = "0000-" & AccountEnd IfcustName.Text = EmpName

    End SubPrivate Sub letterOnly(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles

    txtCountry.KeyPress, txtCity.KeyPress' A - Z, a - zIf (e.KeyChar < Chr(65) Or e.KeyChar > Chr(90)) _And (e.KeyChar < Chr(97) Or e.KeyChar > Chr(122)) Then

    If (e.KeyChar Chr(32)) Then 'Space

  • 7/27/2019 MELJUN CORTES VB Ordering System Documetation (FULL & COMPLETE)

    27/43

    Programming Language

    Ordering System

    Page 27

    Figure V.4

    Main Form

    e.Handled = TrueEnd If

    End IfIf e.KeyChar = Chr(8) Then ' Backspace

    e.Handled = False

    End IfEnd SubPrivate Sub keyDisable(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles

    cboxVia.KeyPresse.Handled = True

    End SubEnd Class

  • 7/27/2019 MELJUN CORTES VB Ordering System Documetation (FULL & COMPLETE)

    28/43

    Programming Language

    Ordering System

    Page 28

    Figure VI

    Module

    Imports System.Data.OleDbModule Module

    Public dbProvider, dbSource As StringPublic sql As StringPublic Account, Firstname, Lastname, Fullname, Address, Birthday, Contact, Username, Password, Email, Gender

    As StringPublic ItemNumber, ItemName, ItemType, ItemPrice, ItemQuantity, TotalPrice As StringPublic Address1, Address2, ShipCity, ShipStreet, ShipCountry, PaidInfo, CustomerName As StringPublic NoAcc, NoPas As StringPublic EmpName As StringPublic returnType As IntegerPublic con As New OleDbConnectionPublic da As New OleDbDataAdapterPublic ds As New DataSetPublic dt As New DataTablePublic cmd As OleDbCommandPublic rdr As OleDbDataReaderPublic Sub selectSql(ByVal sqlCode As String)

    sql = sqlCodecmd = New OleDbCommand(sql, con)con.Open()rdr = cmd.ExecuteReaderIf rdr.HasRows Then

    rdr.Read()Fullname = rdr("custName")Address = rdr("custAddress")Gender = rdr("custGender")Birthday = rdr("custBirthday")Contact = rdr("custContact")Username = rdr("custUsername")Password = rdr("custPassword")Email = rdr("custEmail")

    End Ifcon.Close()End SubPublic Sub updateSql(ByVal sqlCode As String)

    sql = sqlCodecon.Open()cmd = New OleDbCommand(sql, con)cmd.ExecuteNonQuery()con.Close()

    End SubEnd Module

  • 7/27/2019 MELJUN CORTES VB Ordering System Documetation (FULL & COMPLETE)

    29/43

    Programming Language

    Ordering System

    Page 29

    Figure VII.1

    Product Form

    Public Class ProductFormPrivate Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles

    cboxItem.SelectedIndexChangedIf cboxItem.Text = "Pizza" Then

    Call Pizza()ElseIf cboxItem.Text = "Coffee" Then

    Call Coffee()ElseIf cboxItem.Text = "Ice Cream" Then

    Call iceCream()End If

    End SubPrivate Sub cboxItem_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles

    cboxItem.KeyPresse.Handled = True

    End SubPrivate Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click

    Me.Close()MainForm.Show()

    End SubPrivate Sub Pizza()

    pic1.BackgroundImage = ProgLanguage.My.Resources.Resources.Anchovy_Lovers_Pizza

    pic2.BackgroundImage = ProgLanguage.My.Resources.Resources.Barbecue_Pizzapic3.BackgroundImage = ProgLanguage.My.Resources.Resources.Cheese_Pizzapic4.BackgroundImage = ProgLanguage.My.Resources.Resources.Chicago_Pizzapic5.BackgroundImage = ProgLanguage.My.Resources.Resources.Four_Seasons_Pizzapic6.BackgroundImage = ProgLanguage.My.Resources.Resources.Garden_Special_Pizzapic7.BackgroundImage = ProgLanguage.My.Resources.Resources.Hawaiian_Pizzapic8.BackgroundImage = ProgLanguage.My.Resources.Resources.New_York_Pizzapic9.BackgroundImage = ProgLanguage.My.Resources.Resources.Pepperoni___Mushroom_PizzaCall lblVisible()Call lblText("Anchovy Lovers Pizza", "Barbecue Pizza", "Cheese Pizza", "Chicago Pizza", "Four Seasons Pizza", "Garden

    Special Pizza", "Hawaiian Pizza", "New York Pizza", "Pepperoni & Mushroom Pizza")End SubPrivate Sub Coffee()

    pic1.BackgroundImage = ProgLanguage.My.Resources.Resources.Caff_Mistopic2.BackgroundImage = ProgLanguage.My.Resources.Resources.Double_Chocolaty_Chip_Frappuccino_Blended_Beverage

    pic3.BackgroundImage = ProgLanguage.My.Resources.Resources.Hot_Chocolatepic4.BackgroundImage = ProgLanguage.My.Resources.Resources.Iced_Coffee_with_Milkpic5.BackgroundImage = ProgLanguage.My.Resources.Resources.Mocha_Coconut_Light_Frappuccino_Blended_Beveragepic6.BackgroundImage = ProgLanguage.My.Resources.Resources.Salted_Caramel_Hot_Chocolatepic7.BackgroundImage = ProgLanguage.My.Resources.Resources.Strawberries___Crme_Frappuccino_Blended_Beveragepic8.BackgroundImage = ProgLanguage.My.Resources.Resources.White_Hot_Chocolatepic9.BackgroundImage = ProgLanguage.My.Resources.Resources.Vanilla_Bean_Crme_Frappuccino_Blended_BeverageCall lblVisible()Call lblText("Caff Misto", "Double Chocolaty Chip Frappuccino Blended Beverage", "Hot Chocolate", "Iced Coffee with

    Milk", "Mocha Coconut Light Frappuccino Blended Beverage", "Salted Caramel Hot Chocolate", "Strawberries & Crme FrappuccinoBlended Beverage", "White Hot Chocolate", "Vanilla Bean Crme Frappuccino Blended Beverage")

    End Sub

  • 7/27/2019 MELJUN CORTES VB Ordering System Documetation (FULL & COMPLETE)

    30/43

    Programming Language

    Ordering System

    Page 30

    Figure VII.2

    Product Form

    Private Sub iceCream()pic1.BackgroundImage = ProgLanguage.My.Resources.Resources.Nestle_Chocolate_Indulgencepic2.BackgroundImage = ProgLanguage.My.Resources.Resources.Nestle_Chuckiepic3.BackgroundImage = ProgLanguage.My.Resources.Resources.Nestle_Coffee_Creampic4.BackgroundImage = ProgLanguage.My.Resources.Resources.Nestle_Drumstickpic5.BackgroundImage = ProgLanguage.My.Resources.Resources.Nestle_Heaven_Cookiepic6.BackgroundImage = ProgLanguage.My.Resources.Resources.Nestle_Kimmy_Krazypic7.BackgroundImage = ProgLanguage.My.Resources.Resources.Nestle_Pinoy_Sorbetespic8.BackgroundImage = ProgLanguage.My.Resources.Resources.Nestle_Popspic9.BackgroundImage = ProgLanguage.My.Resources.Resources.Nestle_TemptationsCall lblVisible()Call lblText("Nestle Chocolate Indulgence", "Nestle Chuckie", "Nestle Coffee Cream", "Nestle Drumstick", "Nestle Heaven

    Cookie", "Nestle Kimmy Krazy", "Nestle Pinoy Sorbetes", "Nestle Pops", "Nestle Temptations")End SubPrivate Sub lblVisible()

    Label1.Visible = TrueLabel2.Visible = TrueLabel3.Visible = TrueLabel4.Visible = TrueLabel5.Visible = TrueLabel6.Visible = True

    Label7.Visible = TrueLabel8.Visible = TrueLabel9.Visible = True

    End SubPrivate Sub lblText(ByVal one As String, ByVal two As String, ByVal three As String, ByVal four As String, ByVal five As

    String, ByVal six As String, ByVal seven As String, ByVal eight As String, ByVal nine As String)Label1.Text = oneLabel2.Text = twoLabel3.Text = threeLabel4.Text = fourLabel5.Text = fiveLabel6.Text = sixLabel7.Text = sevenLabel8.Text = eightLabel9.Text = nine

    End SubPrivate Sub pic1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles pic1.ClickIf cboxItem.Text = "Pizza" Then

    OrderForm.pic1.BackgroundImage = pic1.BackgroundImageOrderForm.txtNumber.Text = "P00-001"OrderForm.txtName.Text = "Anchovy Lovers Pizza"OrderForm.cboxType.Items.Add("10 ''")OrderForm.cboxType.Items.Add("14 ''")OrderForm.cboxType.Items.Add("18 ''")Me.Close()OrderForm.Show()

  • 7/27/2019 MELJUN CORTES VB Ordering System Documetation (FULL & COMPLETE)

    31/43

    Programming Language

    Ordering System

    Page 31

    Figure VII.3

    Product Form

    ElseIf cboxItem.Text = "Coffee" ThenOrderForm.pic1.BackgroundImage = pic1.BackgroundImageOrderForm.txtNumber.Text = "C00-001"OrderForm.txtName.Text = "Caff Misto"OrderForm.cboxType.Items.Add("Tall")OrderForm.cboxType.Items.Add("Grande")

    OrderForm.cboxType.Items.Add("Venti")Me.Close()OrderForm.Show()

    ElseIf cboxItem.Text = "Ice Cream" ThenOrderForm.pic1.BackgroundImage = pic1.BackgroundImageOrderForm.txtNumber.Text = "IC0-001"OrderForm.txtName.Text = "Nestle Chocolate Indulgence"OrderForm.cboxType.Items.Add("Crunch")OrderForm.cboxType.Items.Add("Kit-Kat")OrderForm.cboxType.Items.Add("Butterfinger")Me.Close()OrderForm.Show()

    End IfEnd SubPrivate Sub pic2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles pic2.Click

    If cboxItem.Text = "Pizza" ThenOrderForm.pic1.BackgroundImage = pic2.BackgroundImageOrderForm.txtNumber.Text = "P00-002"OrderForm.txtName.Text = "Barbecue Pizza"OrderForm.cboxType.Items.Add("10 ''")OrderForm.cboxType.Items.Add("14 ''")OrderForm.cboxType.Items.Add("18 ''")Me.Close()OrderForm.Show()

    ElseIf cboxItem.Text = "Coffee" ThenOrderForm.pic1.BackgroundImage = pic2.BackgroundImageOrderForm.txtNumber.Text = "C00-002"OrderForm.txtName.Text = "Double Chocolaty Chip Frappuccino Blended Beverage"OrderForm.cboxType.Items.Add("Tall")OrderForm.cboxType.Items.Add("Grande")

    OrderForm.cboxType.Items.Add("Venti")Me.Close()OrderForm.Show()

    ElseIf cboxItem.Text = "Ice Cream" ThenOrderForm.pic1.BackgroundImage = pic2.BackgroundImageOrderForm.txtNumber.Text = "IC0-002"OrderForm.txtName.Text = "Nestle Chuckie"OrderForm.cboxType.Items.Add("Small")OrderForm.cboxType.Items.Add("Medium")OrderForm.cboxType.Items.Add("Large")Me.Close()OrderForm.Show()

  • 7/27/2019 MELJUN CORTES VB Ordering System Documetation (FULL & COMPLETE)

    32/43

    Programming Language

    Ordering System

    Page 32

    Figure VII.4

    Product Form

    End IfEnd SubPrivate Sub pic3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles pic3.Click

    If cboxItem.Text = "Pizza" ThenOrderForm.pic1.BackgroundImage = pic3.BackgroundImageOrderForm.txtNumber.Text = "P00-003"

    OrderForm.txtName.Text = "Cheese Pizza"OrderForm.cboxType.Items.Add("10 ''")OrderForm.cboxType.Items.Add("14 ''")OrderForm.cboxType.Items.Add("18 ''")Me.Close()OrderForm.Show()

    ElseIf cboxItem.Text = "Coffee" ThenOrderForm.pic1.BackgroundImage = pic3.BackgroundImageOrderForm.txtNumber.Text = "C00-003"OrderForm.txtName.Text = "Hot Chocolate"OrderForm.cboxType.Items.Add("Tall")OrderForm.cboxType.Items.Add("Grande")OrderForm.cboxType.Items.Add("Venti")Me.Close()OrderForm.Show()

    ElseIf cboxItem.Text = "Ice Cream" ThenOrderForm.pic1.BackgroundImage = pic3.BackgroundImageOrderForm.txtNumber.Text = "IC0-002"OrderForm.txtName.Text = "Nestle Coffee Cream"OrderForm.cboxType.Items.Add("80mL")OrderForm.cboxType.Items.Add("1.5L")OrderForm.cboxType.Items.Add("3L")Me.Close()OrderForm.Show()

    End IfEnd SubPrivate Sub pic4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles pic4.Click

    If cboxItem.Text = "Pizza" ThenOrderForm.pic1.BackgroundImage = pic4.BackgroundImageOrderForm.txtNumber.Text = "P00-004"

    OrderForm.txtName.Text = "Chicago Pizza"OrderForm.cboxType.Items.Add("10 ''")OrderForm.cboxType.Items.Add("14 ''")OrderForm.cboxType.Items.Add("18 ''")Me.Close()OrderForm.Show()

    ElseIf cboxItem.Text = "Coffee" ThenOrderForm.pic1.BackgroundImage = pic4.BackgroundImageOrderForm.txtNumber.Text = "C00-004"OrderForm.txtName.Text = "Iced Coffee with Milk"OrderForm.cboxType.Items.Add("Tall")OrderForm.cboxType.Items.Add("Grande")

  • 7/27/2019 MELJUN CORTES VB Ordering System Documetation (FULL & COMPLETE)

    33/43

    Programming Language

    Ordering System

    Page 33

    Figure VII.5

    Product Form

    OrderForm.cboxType.Items.Add("Venti")Me.Close()OrderForm.Show()

    ElseIf cboxItem.Text = "Ice Cream" ThenOrderForm.pic1.BackgroundImage = pic4.BackgroundImageOrderForm.txtNumber.Text = "IC0-004"

    OrderForm.txtName.Text = "Nestle Drumstick"OrderForm.cboxType.Items.Add("80mL")OrderForm.cboxType.Items.Add("1.5L")OrderForm.cboxType.Items.Add("3L")Me.Close()OrderForm.Show()

    End IfEnd SubPrivate Sub pic5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles pic5.Click

    If cboxItem.Text = "Pizza" ThenOrderForm.pic1.BackgroundImage = pic5.BackgroundImageOrderForm.txtNumber.Text = "P00-005"OrderForm.txtName.Text = "Four Seasons Pizza"OrderForm.cboxType.Items.Add("10 ''")OrderForm.cboxType.Items.Add("14 ''")

    OrderForm.cboxType.Items.Add("18 ''")Me.Close()OrderForm.Show()

    ElseIf cboxItem.Text = "Coffee" ThenOrderForm.pic1.BackgroundImage = pic5.BackgroundImageOrderForm.txtNumber.Text = "C00-005"OrderForm.txtName.Text = "Mocha Coconut Light Frappuccino Blended Beverage"OrderForm.cboxType.Items.Add("Tall")OrderForm.cboxType.Items.Add("Grande")OrderForm.cboxType.Items.Add("Venti")Me.Close()OrderForm.Show()

    ElseIf cboxItem.Text = "Ice Cream" ThenOrderForm.pic1.BackgroundImage = pic5.BackgroundImageOrderForm.txtNumber.Text = "IC0-005"

    OrderForm.txtName.Text = "Nestle Heaven Cookie"OrderForm.cboxType.Items.Add("80mL")OrderForm.cboxType.Items.Add("1.5L")OrderForm.cboxType.Items.Add("3L")Me.Close()OrderForm.Show()

    End IfEnd SubPrivate Sub pic6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles pic6.Click

    If cboxItem.Text = "Pizza" ThenOrderForm.pic1.BackgroundImage = pic6.BackgroundImageOrderForm.txtNumber.Text = "P00-006"

  • 7/27/2019 MELJUN CORTES VB Ordering System Documetation (FULL & COMPLETE)

    34/43

    Programming Language

    Ordering System

    Page 34

    Figure VII.6

    Product Form

    OrderForm.txtName.Text = "Garden Special Pizza"OrderForm.cboxType.Items.Add("10 ''")OrderForm.cboxType.Items.Add("14 ''")OrderForm.cboxType.Items.Add("18 ''")Me.Close()OrderForm.Show()

    ElseIf cboxItem.Text = "Coffee" ThenOrderForm.pic1.BackgroundImage = pic6.BackgroundImageOrderForm.txtNumber.Text = "C00-006"OrderForm.txtName.Text = "Salted Caramel Hot Chocolate"OrderForm.cboxType.Items.Add("Tall")OrderForm.cboxType.Items.Add("Grande")OrderForm.cboxType.Items.Add("Venti")Me.Close()OrderForm.Show()

    ElseIf cboxItem.Text = "Ice Cream" ThenOrderForm.pic1.BackgroundImage = pic6.BackgroundImageOrderForm.txtNumber.Text = "IC0-006"OrderForm.txtName.Text = "Nestle Kimmy Krazy"OrderForm.cboxType.Items.Add("Vanilla")OrderForm.cboxType.Items.Add("Chocolate")

    OrderForm.cboxType.Items.Add("Banana")Me.Close()OrderForm.Show()

    End IfEnd SubPrivate Sub pic7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles pic7.Click

    If cboxItem.Text = "Pizza" ThenOrderForm.pic1.BackgroundImage = pic7.BackgroundImageOrderForm.txtNumber.Text = "P00-007"OrderForm.txtName.Text = "Hawaiian Pizza"OrderForm.cboxType.Items.Add("10 ''")OrderForm.cboxType.Items.Add("14 ''")OrderForm.cboxType.Items.Add("18 ''")Me.Close()OrderForm.Show()

    ElseIf cboxItem.Text = "Coffee" ThenOrderForm.pic1.BackgroundImage = pic7.BackgroundImageOrderForm.txtNumber.Text = "C00-007"OrderForm.txtName.Text = "Strawberries & Crme Frappuccino Blended Beverage"OrderForm.cboxType.Items.Add("Tall")OrderForm.cboxType.Items.Add("Grande")OrderForm.cboxType.Items.Add("Venti")Me.Close()OrderForm.Show()

    ElseIf cboxItem.Text = "Ice Cream" ThenOrderForm.pic1.BackgroundImage = pic7.BackgroundImageOrderForm.txtNumber.Text = "IC0-007"

  • 7/27/2019 MELJUN CORTES VB Ordering System Documetation (FULL & COMPLETE)

    35/43

    Programming Language

    Ordering System

    Page 35

    Figure VII.7

    Product Form

    OrderForm.txtName.Text = "Nestle Pinoy Sorbetes"OrderForm.cboxType.Items.Add("80mL")OrderForm.cboxType.Items.Add("1.5L")OrderForm.cboxType.Items.Add("3L")Me.Close()OrderForm.Show()

    End IfEnd SubPrivate Sub pic8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles pic8.Click

    If cboxItem.Text = "Pizza" ThenOrderForm.pic1.BackgroundImage = pic8.BackgroundImageOrderForm.txtNumber.Text = "P00-008"OrderForm.txtName.Text = "New York Pizza"OrderForm.cboxType.Items.Add("10 ''")OrderForm.cboxType.Items.Add("14 ''")OrderForm.cboxType.Items.Add("18 ''")Me.Close()OrderForm.Show()

    ElseIf cboxItem.Text = "Coffee" ThenOrderForm.pic1.BackgroundImage = pic8.BackgroundImageOrderForm.txtNumber.Text = "C00-008"

    OrderForm.txtName.Text = "White Hot Chocolate"OrderForm.cboxType.Items.Add("Tall")OrderForm.cboxType.Items.Add("Grande")OrderForm.cboxType.Items.Add("Venti")Me.Close()OrderForm.Show()

    ElseIf cboxItem.Text = "Ice Cream" ThenOrderForm.pic1.BackgroundImage = pic8.BackgroundImageOrderForm.txtNumber.Text = "IC0-008"OrderForm.txtName.Text = "Nestle Pops"OrderForm.cboxType.Items.Add("Small")OrderForm.cboxType.Items.Add("Medium")OrderForm.cboxType.Items.Add("Large")Me.Close()OrderForm.Show()

    End IfEnd SubPrivate Sub pic9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles pic9.Click

    If cboxItem.Text = "Pizza" ThenOrderForm.pic1.BackgroundImage = pic9.BackgroundImageOrderForm.txtNumber.Text = "P00-009"OrderForm.txtName.Text = "Pepperoni & Mushroom Pizza"OrderForm.cboxType.Items.Add("10 ''")OrderForm.cboxType.Items.Add("14 ''")OrderForm.cboxType.Items.Add("18 ''")Me.Close()OrderForm.Show()

  • 7/27/2019 MELJUN CORTES VB Ordering System Documetation (FULL & COMPLETE)

    36/43

    Programming Language

    Ordering System

    Page 36

    Figure VII.8

    Product Form

    ElseIf cboxItem.Text = "Coffee" ThenOrderForm.pic1.BackgroundImage = pic9.BackgroundImageOrderForm.txtNumber.Text = "C00-009"OrderForm.txtName.Text = "Vanilla Bean Crme Frappuccino Blended Beverage"OrderForm.cboxType.Items.Add("Tall")OrderForm.cboxType.Items.Add("Grande")

    OrderForm.cboxType.Items.Add("Venti")Me.Close()OrderForm.Show()

    ElseIf cboxItem.Text = "Ice Cream" ThenOrderForm.pic1.BackgroundImage = pic9.BackgroundImageOrderForm.txtNumber.Text = "IC0-009"OrderForm.txtName.Text = "Nestle Temptations"OrderForm.cboxType.Items.Add("80mL")OrderForm.cboxType.Items.Add("1.5L")OrderForm.cboxType.Items.Add("3L")Me.Close()OrderForm.Show()

    End IfEnd Sub

    End Class

  • 7/27/2019 MELJUN CORTES VB Ordering System Documetation (FULL & COMPLETE)

    37/43

    Programming Language

    Ordering System

    Page 37

    Figure VIII.1

    Order Form

    Imports System.Data.OleDbPublic Class OrderForm

    Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.ClickMe.Close()ProductForm.Show()

    End Sub

    Private Sub keyDisable(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) HandlestxtNumber.KeyPress, txtName.KeyPress, txtPrice.KeyPress, txtTotal.KeyPress, cboxType.KeyPress, txtDiscount.KeyPress,txtTax.KeyPress

    e.Handled = TrueEnd SubPrivate Sub txtQuantity_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles

    txtQuantity.KeyPress' 0 - 9If Not Char.IsDigit(e.KeyChar) Then

    e.Handled = TrueEnd If

    If e.KeyChar = Chr(8) Then 'Backspacee.Handled = False

    End If

    End SubPrivate Sub txtQuantity_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtQuantity.TextChanged

    txtTotal.Text = Val(txtQuantity.Text) * (Val(txtPrice.Text) + (Val(txtPrice.Text) * 0.2))End SubPrivate Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click

    If cboxType.Text = "" ThenCall messageGen("Please choose the type.")

    ElseIf txtQuantity.Text = "" Then

    Call messageGen("Please enter an amount.")Else

    Call messageGen("")returnType = MsgBox("Are you sure?", MsgBoxStyle.YesNo, "ProgLanguage")If returnType = 6 Then

    ItemNumber = txtNumber.TextItemName = txtName.TextItemType = cboxType.TextItemPrice = txtPrice.TextItemQuantity = txtQuantity.TextTotalPrice = txtTotal.Textsql = "INSERT INTO ItemOrder(custName, itemNumber, itemType, itemName, itemPrice, itemQuantity, itemTotal)

    VALUES ('" _& EmpName _& "', '" & ItemNumber _& "', '" & ItemType _& "', '" & ItemName _& "', '" & ItemPrice _

  • 7/27/2019 MELJUN CORTES VB Ordering System Documetation (FULL & COMPLETE)

    38/43

    Programming Language

    Ordering System

    Page 38

    Figure VIII.2

    Order Form

    & "', '" & ItemQuantity _& "', '" & TotalPrice & "')"

    con.Open()cmd = New OleDbCommand(sql, con)cmd.ExecuteNonQuery()con.Close()

    returnType = MsgBox("Transaction success. Do you want to buy more?", MsgBoxStyle.YesNo, "ProgLanguage")If returnType = 7 Then

    Me.Close()ProductForm.Show()

    ElsetxtQuantity.Text = ""

    End IfEnd If

    End IfEnd If

    End SubPrivate Sub messageGen(ByVal message As String)

    lblMessage.Visible = TruelblMessage.Text = messagelblMessage.TextAlign = ContentAlignment.MiddleCenter

    End SubPrivate Sub cboxSize_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles

    cboxType.SelectedIndexChangedCall Pizza()Call Coffee()Call iceCream()

    End SubPrivate Sub Pizza()

    If txtName.Text = "Anchovy Lovers Pizza" ThenIf cboxType.Text = "10 ''" Then

    txtPrice.Text = "380.00"ElseIf cboxType.Text = "14 ''" Then

    txtPrice.Text = "610.00"Else

    txtPrice.Text = "820.00"End If

    ElseIf txtName.Text = "Barbecue Pizza" ThenIf cboxType.Text = "10 ''" Then

    txtPrice.Text = "350.00"ElseIf cboxType.Text = "14 ''" Then

    txtPrice.Text = "550.00"Else

    txtPrice.Text = "790.00"End If

    ElseIf txtName.Text = "Cheese Pizza" ThenIf cboxType.Text = "10 ''" Then

    txtPrice.Text = "250.00"

  • 7/27/2019 MELJUN CORTES VB Ordering System Documetation (FULL & COMPLETE)

    39/43

    Programming Language

    Ordering System

    Page 39

    Figure VIII.2

    Order Form

    ElseIf cboxType.Text = "14 ''" ThentxtPrice.Text = "420.00"

    ElsetxtPrice.Text = "630.00"

    End IfElseIf txtName.Text = "Chicago Pizza" Then

    If cboxType.Text = "10 ''" ThentxtPrice.Text = "300.00"

    ElseIf cboxType.Text = "14 ''" ThentxtPrice.Text = "600.00"

    ElsetxtPrice.Text = "800.00"

    End IfElseIf txtName.Text = "Four Seasons Pizza" Then

    If cboxType.Text = "10 ''" ThentxtPrice.Text = "380.00"

    ElseIf cboxType.Text = "14 ''" ThentxtPrice.Text = "610.00"

    ElsetxtPrice.Text = "820.00"

    End If

    ElseIf txtName.Text = "Garden Special Pizza" ThenIf cboxType.Text = "10 ''" Then

    txtPrice.Text = "330.00"ElseIf cboxType.Text = "14 ''" Then

    txtPrice.Text = "530.00"Else

    txtPrice.Text = "780.00"End If

    ElseIf txtName.Text = "Hawaiian Pizza" ThenIf cboxType.Text = "10 ''" Then

    txtPrice.Text = "320.00"ElseIf cboxType.Text = "14 ''" Then

    txtPrice.Text = "510.00"Else

    txtPrice.Text = "770.00"End If

    ElseIf txtName.Text = "New York Pizza" ThenIf cboxType.Text = "10 ''" Then

    txtPrice.Text = "380.00"ElseIf cboxType.Text = "14 ''" Then

    txtPrice.Text = "510.00"Else

    txtPrice.Text = "770.00"End If

    ElseIf txtName.Text = "Pepperoni & Mushroom Pizza" ThenIf cboxType.Text = "10 ''" Then

    txtPrice.Text = "330.00"

  • 7/27/2019 MELJUN CORTES VB Ordering System Documetation (FULL & COMPLETE)

    40/43

    Programming Language

    Ordering System

    Page 40

    Figure VIII.3

    Order Form

    ElseIf cboxType.Text = "14 ''" ThentxtPrice.Text = "530.00"

    ElsetxtPrice.Text = "780.00"

    End IfEnd If

    End SubPrivate Sub Coffee()

    If txtName.Text = "Caff Misto" ThenIf cboxType.Text = "Tall" Then

    txtPrice.Text = "70.00"ElseIf cboxType.Text = "Grande" Then

    txtPrice.Text = "90.00"Else

    txtPrice.Text = "120.00"End If

    ElseIf txtName.Text = "Double Chocolaty Chip Frappuccino Blended Beverage" ThenIf cboxType.Text = "Tall" Then

    txtPrice.Text = "90.00"ElseIf cboxType.Text = "Grande" Then

    txtPrice.Text = "120.00"

    ElsetxtPrice.Text = "150.00"End If

    ElseIf txtName.Text = "Hot Chocolate" ThenIf cboxType.Text = "Tall" Then

    txtPrice.Text = "55.00"ElseIf cboxType.Text = "Grande" Then

    txtPrice.Text = "75.00"Else

    txtPrice.Text = "90.00"End If

    ElseIf txtName.Text = "Iced Coffee with Milk" ThenIf cboxType.Text = "Tall" Then

    txtPrice.Text = "65.00"ElseIf cboxType.Text = "Grande" Then

    txtPrice.Text = "80.00"Else

    txtPrice.Text = "110.00"End If

    ElseIf txtName.Text = "Mocha Coconut Light Frappuccino Blended Beverage" ThenIf cboxType.Text = "Tall" Then

    txtPrice.Text = "90.00"ElseIf cboxType.Text = "Grande" Then

    txtPrice.Text = "120.00"Else

    txtPrice.Text = "150.00"End If

  • 7/27/2019 MELJUN CORTES VB Ordering System Documetation (FULL & COMPLETE)

    41/43

    Programming Language

    Ordering System

    Page 41

    Figure VIII.4

    Order Form

    ElseIf txtName.Text = "Salted Caramel Hot Chocolate" ThenIf cboxType.Text = "Tall" Then

    txtPrice.Text = "70.00"ElseIf cboxType.Text = "Grande" Then

    txtPrice.Text = "90.00"Else

    txtPrice.Text = "120.00"End If

    ElseIf txtName.Text = "Strawberries & Crme Frappuccino Blended Beverage" ThenIf cboxType.Text = "Tall" Then

    txtPrice.Text = "90.00"ElseIf cboxType.Text = "Grande" Then

    txtPrice.Text = "120.00"Else

    txtPrice.Text = "150.00"End If

    ElseIf txtName.Text = "White Hot Chocolate" ThenIf cboxType.Text = "Tall" Then

    txtPrice.Text = "60.00"ElseIf cboxType.Text = "Grande" Then

    txtPrice.Text = "80.00"

    ElsetxtPrice.Text = "110.00"End If

    ElseIf txtName.Text = "Vanilla Bean Crme Frappuccino Blended Beverage" ThenIf cboxType.Text = "Tall" Then

    txtPrice.Text = "90.00"ElseIf cboxType.Text = "Grande" Then

    txtPrice.Text = "120.00"Else

    txtPrice.Text = "150.00"End If

    End IfEnd SubPrivate Sub iceCream()

    If txtName.Text = "Nestle Chocolate Indulgence" ThenIf cboxType.Text = "Crunch" Then

    txtPrice.Text = "150.00"ElseIf cboxType.Text = "Kit-Kat" Then

    txtPrice.Text = "175.00"Else

    txtPrice.Text = "225.00"End If

    ElseIf txtName.Text = "Nestle Chuckie" ThenIf cboxType.Text = "Small" Then

    txtPrice.Text = "25.00"ElseIf cboxType.Text = "Medium" Then

    txtPrice.Text = "37.00"

  • 7/27/2019 MELJUN CORTES VB Ordering System Documetation (FULL & COMPLETE)

    42/43

    Programming Language

    Ordering System

    Page 42

    Figure VIII.5

    Order Form

    ElsetxtPrice.Text = "45.00"

    End IfElseIf txtName.Text = "Nestle Coffee Cream" Then

    If cboxType.Text = "80mL" ThentxtPrice.Text = "75.00"

    ElseIf cboxType.Text = "1.5L" ThentxtPrice.Text = "125.00"

    ElsetxtPrice.Text = "200.00"

    End IfElseIf txtName.Text = "Nestle Drumstick" Then

    If cboxType.Text = "80mL" ThentxtPrice.Text = "80.00"

    ElseIf cboxType.Text = "1.5L" ThentxtPrice.Text = "140.00"

    ElsetxtPrice.Text = "250.00"

    End IfElseIf txtName.Text = "Nestle Heaven Cookie" Then

    If cboxType.Text = "80mL" Then

    txtPrice.Text = "100.00"ElseIf cboxType.Text = "1.5L" ThentxtPrice.Text = "175.00"

    ElsetxtPrice.Text = "300.00"

    End IfElseIf txtName.Text = "Nestle Kimmy Krazy" Then

    If cboxType.Text = "Vanilla" ThentxtPrice.Text = "20.00"

    ElseIf cboxType.Text = "Chocolate" ThentxtPrice.Text = "20.00"

    ElsetxtPrice.Text = "25.00"

    End IfElseIf txtName.Text = "Nestle Pinoy Sorbetes" Then

    If cboxType.Text = "80mL" ThentxtPrice.Text = "60.00"

    ElseIf cboxType.Text = "1.5L" ThentxtPrice.Text = "125.00"

    ElsetxtPrice.Text = "175.00"

    End IfElseIf txtName.Text = "Nestle Pops" Then

    If cboxType.Text = "Small" ThentxtPrice.Text = "25.00"

    ElseIf cboxType.Text = "Medium" ThentxtPrice.Text = "37.00"

  • 7/27/2019 MELJUN CORTES VB Ordering System Documetation (FULL & COMPLETE)

    43/43

    Programming Language

    Ordering System

    Page 43

    Figure VIII.6

    Order Form

    ElsetxtPrice.Text = "60.00"

    End IfElseIf txtName.Text = "Nestle Temptations" Then

    If cboxType.Text = "80mL" ThentxtPrice.Text = "90.00"

    ElseIf cboxType.Text = "1.5L" ThentxtPrice.Text = "140.00"

    ElsetxtPrice.Text = "275.00"

    End IfEnd If

    End SubPrivate Sub OrderForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    Call selectSql("Select * from Account where custName= '" & EmpName & "' ")If Birthday.Substring(Birthday.Length - 4) < 1990 Then

    txtDiscount.Text = "Senior"Else

    txtDiscount.Text = "No Discount"End If

    End Sub

    End Class