LOGIN CODES
Dim username As String = [Link]
Dim password As String = [Link]
Dim found As Boolean = False
If [Link] = "" And [Link] <> "" Then
MsgBox("Enter Username Pliz!", [Link], "Opps!")
ElseIf [Link] <> "" And [Link] = "" Then
MsgBox("Enter Password Pliz!", [Link], "Opps!")
ElseIf [Link] = "" Or [Link] = "" Then
MsgBox("Pliz fill in all the information!", [Link],
"Opps!")
[Link]()
Else
[Link]()
dbCmd = New OleDbCommand("Select * from `LOGIN` where [Name]='" &
username & "' and [Password]='" & password & "'", DbCon)
read = [Link]
If IsNumeric([Link]) = False Then
username = IsNumeric([Link])
Else
MsgBox("Please enter a valid username format")
[Link]()
[Link]()
End If
While [Link]
found = True
End While
If found = True Then
MsgBox("Welcome to Wholesale and Retail Shopping Center",
[Link], "Login Successful")
[Link]()
[Link]()
frmMAIN_MENU.Show()
If frmMAIN_MENU.Visible Then
[Link]()
[Link]()
End If
Else
MsgBox("WRONG USERNAME OR PASSWORD!")
[Link]()
If attempts = 4 Then
MsgBox("Number of attempts(4), program will close")
Close()
Else
MsgBox("Password incorrect, please reEnter, the number of
trials attempted are" & attempts & " of 4")
attempts = attempts + 1
[Link]()
[Link]()
End If
End If
End If
SAVE CODES
Dim full_name As String = txtFull_name.Text
Dim surname As String = [Link]
Dim Customer_ID As Integer = Val(txtCustomer_ID.Text)
Dim phone_number As Integer = Val(txtPhone_number.Text)
Dim Address As String = [Link]
Dim book_number As Integer = Val(txtBook_number.Text)
Dim book_title As String = txtBook_title.Text
Dim Amount_paid As Decimal = Val(txtAmount_paid.Text)
[Link]()
Dim str As String
str = "Insert into `CUSTOMERS FORM`(Name],[Surname],[CustomerID],
[Phonenumber],[Address],[Gender],[Date of Delivery],[Date],[Amountpaid]) Values
(?,?,?,?,?,?,?,?,?)"
Dim DbCmd As OleDbCommand = New OleDbCommand(str, DbCon)
If IsNumeric(txtFull_name.Text) = False Then
full_name = IsNumeric(txtFull_name.Text)
Else
MsgBox("Format invalid for fullname entry")
txtFull_name.Clear()
txtFull_name.Focus()
End If
If IsNumeric([Link]) = False Then
surname = IsNumeric([Link])
Else
MsgBox("Format invalid for surname entry")
[Link]()
[Link]()
End If
If IsNumeric(txtCustomer_ID.Text) Then
Customer_ID = IsNumeric(txtCustomer_ID.Text)
Else
MsgBox("Format for CustomerID entry")
txtCustomer_ID.Clear()
txtCustomer_ID.Focus()
End If
If IsNumeric(txtPhone_number.Text) Then
phone_number = IsNumeric(txtPhone_number.Text)
Else
MsgBox("Format invalid for phone number entry")
txtPhone_number.Clear()
txtPhone_number.Focus()
End If
If IsNumeric(txtBook_number.Text) Then
book_number = IsNumeric(txtBook_number.Text)
Else
MsgBox("Format invalid for book number entry")
txtBook_number.Clear()
txtBook_number.Focus()
End If
If IsNumeric(txtAmount_paid.Text) Then
Amount_paid = IsNumeric(txtAmount_paid.Text)
Else
MsgBox("Format invalid for amount paid entry")
txtAmount_paid.Clear()
txtAmount_paid.Focus()
End If
[Link](New OleDbParameter("Fullname",
CType(txtFull_name.Text, String)))
[Link](New OleDbParameter("Surname", CType([Link],
String)))
[Link](New OleDbParameter("CustomerID",
CType(txtCustomer_ID.Text, String)))
[Link](New OleDbParameter("Phonenumber",
CType(txtPhone_number.Text, String)))
[Link](New OleDbParameter("Address", CType([Link],
String)))
[Link](New OleDbParameter("Booknumber",
CType(txtBook_number.Text, String)))
[Link](New OleDbParameter("Booktitle",
CType(txtBook_title.Text, String)))
[Link](New OleDbParameter("Date", CType([Link],
String)))
[Link](New OleDbParameter("Amountpaid",
CType(txtAmount_paid.Text, String)))
Try
[Link]()
Call CUSTOMERS()
[Link]()
MsgBox("Details submitted", [Link], "CUSTOMER
REGISTERED")
[Link]()
txtAmount_paid.Clear()
txtBook_number.Clear()
txtBook_title.Clear()
txtCustomer_ID.Clear()
txtFull_name.Clear()
txtPhone_number.Clear()
[Link]()
Catch ex As Exception
MsgBox("Execution failed!", [Link], "Error while saving
data")
End Try
[Link]()
SEARCH CODES
[Link]()
Dim cmd As New OleDbCommand("Select * from `CUSTOMERS FORM` where
[CustomerID]=@ID", DbCon)
[Link]("@ID", [Link])
Dim found As Boolean = False
Dim adapter As New OleDbDataAdapter(cmd)
Dim dataset As New DataSet
[Link](dataset)
CUSTOMERS_FORMDataGridView.DataSource = [Link](0)
[Link]()
DELETE CODES
[Link]()
Dim DbCmd As New OleDbCommand("Select * from `CUSTOMERS FORM` where
[CustomerID]=@ID", DbCon)
[Link]("@ID", txtCustomer_ID.Text)
Dim datareader As OleDbDataReader
Dim found As Boolean = False
datareader = [Link]
While [Link]
found = True
End While
If found = True Then
DbCmd = New OleDbCommand("Delete from `CUSTOMERS FORM` where
[CustomerID]=@ID", DbCon)
[Link]("@ID", txtCustomer_ID.Text)
[Link]()
Call CUSTOMERS()
MsgBox("Successfully deleted!")
Else
MsgBox("That record is not found!")
End If
[Link]()
UPDATE CODES
[Link]()
Dim str As String
str = "UPDATE [BOOK BORROWED FORM] set [Fullname]= '" & txtFull_name.Text &
"',[Surname]=' " & [Link] & "',[Booknumber]='" & txtBook_number.Text & "',
[Booktitle]='" & txtBook_title.Text & "',[Date of Borrowing]='" &
txtDate_of_Borrowing.Text & "',[Date of return]='" & txtDate_of_returned.Text & "',
[Amountpaid]='" & txtAmount_paid.Text & "' Where [Signature]='" & [Link]
& "'"
Dim cmd As OleDbCommand = New OleDbCommand(str, DbCon)
Dim adapter As New OleDbDataAdapter(cmd)
Dim dataset As New DataSet
[Link](dataset)
BOOK_BORROWED_FORMDataGridView.DataSource = [Link](0)
Try
[Link]()
Call booksborrowed()
[Link]()
MsgBox("Successfully updated")
[Link]()
Catch ex As Exception
MsgBox([Link])
End Try