Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

QUEZON CITY UNIVERSITY

COLLEGE OF COMPUTER SCIENCE AND INFORMATION TECHNOLOGY

PF101 – OBJECT ORIENTED PROGRAMMING


LABORATORY EXAMINATION
NAME: DANIELI C. ESCABAS SCORE PERCENTAGE

STUDENT NO: 20-1366


YEAR/SECTION: BAIT 2B
DATE: 12/15/2021

INSTRUCTIONS:

Design and develop an application system using ADO hard code for LOGIN and Data source Wizard for
ADMIN sub menu. Your application has Preview – Printable copy for your database record. Follow the given
below in designing and developing the application program.

• Authentication
Login (sub menu)
Logout (sub menu)

• Records
Admin (sub menu)
Print (sub menu)

• TestII
BasicPOS (sub menu)

Refer to the sample output below for your reference:

Figure 1.0 – Form 1 (ParentForm)


QUEZON CITY UNIVERSITY
COLLEGE OF COMPUTER SCIENCE AND INFORMATION TECHNOLOGY

Figure 1.1 – Admin Sub menu

Figure 1.2 – print(sub menu)


QUEZON CITY UNIVERSITY
COLLEGE OF COMPUTER SCIENCE AND INFORMATION TECHNOLOGY

TestII: Create basic POS that will accept price-input from the user. Then your program will continuously
accept enter price. The results will be displayed on the screen such as prices of an item(inside the listbox)
and total price(will be displayed in Label Control)

textbox

listbox

label

Figure 1.3 – BasicPOS Submenu

Source Code:

Public Class Form1


Private Sub LoginToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles
LoginToolStripMenuItem.Click
loginform.ShowDialog()
End Sub

Private Sub AdminToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles


AdminToolStripMenuItem.Click
adminsubmenu.ShowDialog()
End Sub

Private Sub LogoutToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles


LogoutToolStripMenuItem.Click
RecordsToolStripMenuItem.Enabled = False
MessageBox.Show("Byee <3")
End Sub

Private Sub PrintToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles


PrintToolStripMenuItem.Click
QUEZON CITY UNIVERSITY
COLLEGE OF COMPUTER SCIENCE AND INFORMATION TECHNOLOGY

Dim newprintform As New PrintForm


newprintform.MdiParent = Me
newprintform.Show()
End Sub

Private Sub TestIIToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles


TestIIToolStripMenuItem.Click
test2.ShowDialog()
End Sub
End Class

Public Class loginform


'ado.net
Dim con1 As SqlClient.SqlConnection
Dim da1 As SqlClient.SqlDataAdapter
Dim cb1 As SqlClient.SqlCommandBuilder
Dim ds1 As DataSet
Dim sql1 As String
Dim rescount As Byte

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

Try
con1 = New SqlClient.SqlConnection
con1.ConnectionString = "Data Source=DANIELIII\SQLSERVER;Initial Catalog=login1;User
ID=sa;Password=123"
con1.Open()

Dim username1, password1 As String


username1 = TextBox1.Text.Trim()
password1 = TextBox2.Text.Trim()

sql1 = "select * from admin where username='" & username1 & "'
and password='" & password1 & " ' "

da1 = New SqlClient.SqlDataAdapter(sql1, con1)


cb1 = New SqlClient.SqlCommandBuilder(da1)
ds1 = New DataSet

da1.Fill(ds1, "login1")
rescount = ds1.Tables(0).Rows.Count
If rescount > 0 Then
Form1.RecordsToolStripMenuItem.Enabled = True
MessageBox.Show("Welcome " & username1.ToUpper())
Me.Close()
Else
Form1.RecordsToolStripMenuItem.Enabled = False
MessageBox.Show("Invalid Login")
End If

'burst'
con1.Close()
TextBox1.Clear()
TextBox2.Clear()

Catch ex As Exception
MessageBox.Show(ex.ToString)
End Try

End Sub
End Class

Public Class adminsubmenu


Private Sub adminsubmenu_Load(sender As Object, e As EventArgs) Handles MyBase.Load
QUEZON CITY UNIVERSITY
COLLEGE OF COMPUTER SCIENCE AND INFORMATION TECHNOLOGY

'TODO: This line of code loads data into the 'Login1DataSet.admin' table. You
can move, or remove it, as needed.
Me.AdminTableAdapter.Fill(Me.Login1DataSet.admin)

End Sub

Private Sub AdminBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs) Handles


AdminBindingNavigatorSaveItem.Click
Me.Validate()
Me.AdminBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.Login1DataSet)

End Sub
End Class

Paste the screenshot of your output here. (And upload your whole project(winrar) on Google Classroom so
that your professor can validate your work)
QUEZON CITY UNIVERSITY
COLLEGE OF COMPUTER SCIENCE AND INFORMATION TECHNOLOGY

You might also like