Technical
Solution
ModuleGlobal;
Code;
Imports System.IO
Imports MySql.Data.MySqlClient
Imports System.Security.Cryptography
Imports System.Text
Module ModuleGlobal
'Module is used to store all of the global functions and subroutines that are required for the program
Dim Connect As New MySqlConnection
'declares the connection to the database
Dim Path As String = (Application.StartupPath & Convert.ToString("\DatabaseSettings.txt"))
'path points to where database settings are kept
Try
Dim COMMAND As MySqlCommand
Dim Query As String
'declares the variables required to execute queries
Query = "CREATE TABLE tbl_Login ( Username VARCHAR(25) NOT NULL PRIMARY KEY,
Password VARCHAR(35) NOT NULL, StaffID(10) NOT NULL, Admin BIT(1) NOT NULL )"
COMMAND = New MySqlCommand(Query, Connect)
COMMAND.ExecuteNonQuery()
COMMAND.Dispose()
'creates the login table
Query = "CREATE TABLE tbl_StaffInfo ( StaffID VARCHAR (10) NOT NULL PRIMARY KEY,
Forename VARCHAR(25) NOT NULL, Surname VARCHAR(35) NOT NULL, Position VARCHAR (35) )"
COMMAND = New MySqlCommand(Query, Connect)
COMMAND.ExecuteNonQuery()
COMMAND.Dispose()
'creates staff info table
Query = "CREATE TABLE tbl_ChildInfo (ChildID VARCHAR(10) NOT NULL PRIMARY KEY,
Forename VARCHAR(25) NOT NULL, Surname VARCHAR(35) NOT NULL, ChildMedicalNeeds
VARCHAR(40) NOT NULL, MedicineNeeded VARCHAR(40) "
COMMAND = New MySqlCommand(Query, Connect)
COMMAND.ExecuteNonQuery()
COMMAND.Dispose()
'creates child info table
Connect.Close()
'closes connection to the database
MessageBox.Show("There has been an error while creating the tables.", "Database Creation
Error.", MessageBoxButtons.OK)
'shows error to the user
MessageBox.Show(ex.Message)
End Try
Try
Catch ex As Exception
MessageBox.Show("Error. Failure occurred whilst connecting to the database.", "Database
Connection Error.", MessageBoxButtons.OK)
MessageBox.Show(ex.Message)
End Try
End Sub
End Module
FormLogin;
Screenshot;
Form Code;
Imports MySql.Data.MySqlClient
Public Class FormLogin
Dim Connect As New MySqlConnection
Dim DatabaseName As String
Dim ServerIp As String
Dim ServerUsername As String
Dim ServerPassword As String
Public UserExit As Boolean
'variables
'Connect is a MySqlConnection, queries will be passed through here
'if the user answers yes then the tables are set up by calling a subroutine in the global
module
MessageBox.Show("Program Exiting, this program cannot run without a database
connection.", "Program requires a database.", MessageBoxButtons.OK)
'tells user that program cannot run without a database connection
Close()
End If
End If
End Sub
Username = TxtUsername.Text
Password = TxtPassword.Text
ValidConnection = ValidateConnect()
'assigns the variable 'validconnection' the returned value from subroutine ValidateConnect
MessageBox.Show("The database connection has failed, please ensure database settings are
correct ", "Database connection error has occurred.")
FormDbInfo.ShowDialog()
'if there is not a valid database connection present then the program prompts user
End If
Else
'if correct details weren't provided
TxtUsername.Text = ""
TxtPassword.Text = ""
MessageBox.Show("Your username or password is incorrect, please try again.",
"Username/Password error.", MessageBoxButtons.OK)
End If
End Sub
Do While READER.Read
CheckPassword = READER("Password")
'assigns the password string to the CheckPassword variable
Loop
Connect.Close()
Catch ex As Exception
MessageBox.Show("Connection to the database has failed. Please check that the information
is correct.", "Error connecting to the database.", MessageBoxButtons.OK)
End Try
Return LoginSuccess
End Function
Designer Code;
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class FormLogin
Inherits System.Windows.Forms.Form
'
Me.TxtUsername.Location = New System.Drawing.Point(128, 172)
Me.TxtUsername.Name = "TxtUsername"
Me.TxtUsername.Size = New System.Drawing.Size(146, 20)
Me.TxtUsername.TabIndex = 5
'
'TxtPassword
'
Me.TxtPassword.Location = New System.Drawing.Point(128, 212)
Me.TxtPassword.Name = "TxtPassword"
Me.TxtPassword.Size = New System.Drawing.Size(146, 20)
Me.TxtPassword.TabIndex = 6
Me.TxtPassword.UseSystemPasswordChar = True
'
'BtnLogin
'
Me.BtnLogin.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
Me.BtnLogin.Location = New System.Drawing.Point(151, 253)
Me.BtnLogin.Name = "BtnLogin"
Me.BtnLogin.Size = New System.Drawing.Size(75, 23)
Me.BtnLogin.TabIndex = 7
Me.BtnLogin.Text = "Login "
Me.BtnLogin.UseVisualStyleBackColor = True
'
'BtnDatabaseInfo
'
Me.BtnDatabaseInfo.Location = New System.Drawing.Point(12, 328)
Me.BtnDatabaseInfo.Name = "BtnDatabaseInfo"
Me.BtnDatabaseInfo.Size = New System.Drawing.Size(89, 23)
Me.BtnDatabaseInfo.TabIndex = 8
Me.BtnDatabaseInfo.Text = "Database Info"
Me.BtnDatabaseInfo.UseVisualStyleBackColor = True
'
'FormLogin
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(366, 363)
Me.Controls.Add(Me.BtnDatabaseInfo)
Me.Controls.Add(Me.BtnLogin)
Me.Controls.Add(Me.TxtPassword)
Me.Controls.Add(Me.TxtUsername)
Me.Controls.Add(Me.LblPassword)
Me.Controls.Add(Me.LblUsername)
Me.Controls.Add(Me.LblLogin)
Me.Controls.Add(Me.ImgLogo)
Me.Name = "FormLogin"
Me.RightToLeftLayout = True
Me.Text = "Login"
CType(Me.ImgLogo, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents ImgLogo As System.Windows.Forms.PictureBox
Friend WithEvents LblLogin As System.Windows.Forms.Label
Friend WithEvents LblUsername As System.Windows.Forms.Label
Friend WithEvents LblPassword As System.Windows.Forms.Label
Friend WithEvents TxtUsername As System.Windows.Forms.TextBox
Friend WithEvents TxtPassword As System.Windows.Forms.TextBox
Friend WithEvents BtnLogin As System.Windows.Forms.Button
Friend WithEvents BtnDatabaseInfo As System.Windows.Forms.Button
End Class
FormDbInfo;
Screenshot;
Form Code;
Imports System.IO
Imports MySql.Data.MySqlClient
Public Class FormDbInfo
Me.Close()
Else
MessageBox.Show("Connection has not been made. Ensure you have entered the right
details.", "Connection error.", MessageBoxButtons.OK)
End If
End Sub
Try
'tries to connect to the server
Connect.Open()
'opens the connection to the server
ValidConnection = True
'if this succeeds then the variable is assigned the value 'true'
Catch ex As Exception
ValidConnection = False
'a false value is assigned to the variable
MessageBox.Show("Valid Connection = False")
MessageBox.Show(ex.Message)
End Try
Connect.Close()
'connection is closed
Return ValidConnection
End Function
End Class
Designer Code;
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class FormDbInfo
Inherits System.Windows.Forms.Form
'
Me.LblDatabaseName.AutoSize = True
Me.LblDatabaseName.Location = New System.Drawing.Point(23, 155)
Me.LblDatabaseName.Name = "LblDatabaseName"
Me.LblDatabaseName.Size = New System.Drawing.Size(87, 13)
Me.LblDatabaseName.TabIndex = 15
Me.LblDatabaseName.Text = "Database Name:"
'
'LblUsername
'
Me.LblUsername.AutoSize = True
Me.LblUsername.Location = New System.Drawing.Point(23, 192)
Me.LblUsername.Name = "LblUsername"
Me.LblUsername.Size = New System.Drawing.Size(61, 13)
Me.LblUsername.TabIndex = 16
Me.LblUsername.Text = "Username: "
'
'LblPassword
'
Me.LblPassword.AutoSize = True
Me.LblPassword.Location = New System.Drawing.Point(23, 231)
Me.LblPassword.Name = "LblPassword"
Me.LblPassword.Size = New System.Drawing.Size(56, 13)
Me.LblPassword.TabIndex = 17
Me.LblPassword.Text = "Password:"
'
'TxtServerIP
'
Me.TxtServerIP.Location = New System.Drawing.Point(26, 132)
Me.TxtServerIP.Name = "TxtServerIP"
Me.TxtServerIP.Size = New System.Drawing.Size(244, 20)
Me.TxtServerIP.TabIndex = 18
'
'TxtDatabaseName
'
Me.TxtDatabaseName.Location = New System.Drawing.Point(26, 171)
Me.TxtDatabaseName.Name = "TxtDatabaseName"
Me.TxtDatabaseName.Size = New System.Drawing.Size(244, 20)
Me.TxtDatabaseName.TabIndex = 19
'
'TxtUsername
'
Me.TxtUsername.Location = New System.Drawing.Point(26, 208)
Me.TxtUsername.Name = "TxtUsername"
Me.TxtUsername.Size = New System.Drawing.Size(244, 20)
Me.TxtUsername.TabIndex = 20
'
'TxtPassword
'
Me.TxtPassword.Location = New System.Drawing.Point(26, 247)
Me.TxtPassword.Name = "TxtPassword"
End Sub
Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox
Friend WithEvents LblDbConnectionInfo As System.Windows.Forms.Label
Friend WithEvents LblServerIP As System.Windows.Forms.Label
Friend WithEvents LblDatabaseName As System.Windows.Forms.Label
Friend WithEvents LblUsername As System.Windows.Forms.Label
Friend WithEvents LblPassword As System.Windows.Forms.Label
Friend WithEvents TxtServerIP As System.Windows.Forms.TextBox
Friend WithEvents TxtDatabaseName As System.Windows.Forms.TextBox
Friend WithEvents TxtUsername As System.Windows.Forms.TextBox
Friend WithEvents TxtPassword As System.Windows.Forms.TextBox
Friend WithEvents BtnConfirm As System.Windows.Forms.Button
End Class
FormMainMenu;
Screenshot;
Form Code;
Public Class FormMainMenu
End Sub
Designer Code;
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class FormMainMenu
Inherits System.Windows.Forms.Form
End Sub
Friend WithEvents LblWelcome As System.Windows.Forms.Label
Friend WithEvents ImgBunnies As System.Windows.Forms.PictureBox
Friend WithEvents BtnRecords As System.Windows.Forms.Button
Friend WithEvents BtnQuit As System.Windows.Forms.Button
Friend WithEvents LblInfo1 As System.Windows.Forms.Label
Friend WithEvents LblUser As System.Windows.Forms.Label
Friend WithEvents BtnSettings As System.Windows.Forms.Button
Friend WithEvents LblInfo2 As System.Windows.Forms.Label
Friend WithEvents LblCreateBill As System.Windows.Forms.Label
Friend WithEvents BtnCreateBill As System.Windows.Forms.Button
End Class
FormRecords;
Screenshot;
Form Code;
Public Class FormRecords
Private Sub BtnAddNewStaffMember_Click(sender As Object, e As EventArgs) Handles
BtnAddNewStaffMember.Click
'runs when add new staff member button is clicked
Hide()
FormAddStaffMember.Show()
End Sub
Private Sub BtnAddNewChild_Click(sender As Object, e As EventArgs) Handles
BtnAddNewChild.Click
'runs when add new child button is clicked
Hide()
FormAddNewChild.Show()
End Sub
Private Sub BtnEditStaffMember_Click(sender As Object, e As EventArgs) Handles
BtnEditStaffMember.Click
'runs when edit staff member button is clicked
Hide()
FormEditStaffMember.Show()
End Sub
Private Sub BtnEditChild_Click(sender As Object, e As EventArgs) Handles BtnEditChild.Click
'runs when edit child button is clicked
Hide()
FormEditChildRecord.Show()
End Sub
Private Sub BtnRemoveStaffMember_Click(sender As Object, e As EventArgs) Handles
BtnRemoveStaffMember.Click
Designer Code;
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class FormRecords
Inherits System.Windows.Forms.Form
'Lbl_Records
'
Me.Lbl_Records.AutoSize = True
Me.Lbl_Records.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!,
System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Lbl_Records.Location = New System.Drawing.Point(142, 25)
Me.Lbl_Records.Name = "Lbl_Records"
Me.Lbl_Records.Size = New System.Drawing.Size(69, 20)
Me.Lbl_Records.TabIndex = 0
Me.Lbl_Records.Text = "Records"
'
'ImgBunnies
'
Me.ImgBunnies.Image = CType(resources.GetObject("ImgBunnies.Image"),
System.Drawing.Image)
Me.ImgBunnies.Location = New System.Drawing.Point(2, 1)
Me.ImgBunnies.Name = "ImgBunnies"
Me.ImgBunnies.Size = New System.Drawing.Size(102, 65)
Me.ImgBunnies.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.ImgBunnies.TabIndex = 2
Me.ImgBunnies.TabStop = False
'
'BtnExit
'
Me.BtnExit.Location = New System.Drawing.Point(251, 269)
Me.BtnExit.Name = "BtnExit"
Me.BtnExit.Size = New System.Drawing.Size(75, 23)
Me.BtnExit.TabIndex = 6
Me.BtnExit.Text = "Exit"
Me.BtnExit.UseVisualStyleBackColor = True
'
'BtnAddNewChild
'
Me.BtnAddNewChild.Location = New System.Drawing.Point(130, 108)
Me.BtnAddNewChild.Name = "BtnAddNewChild"
Me.BtnAddNewChild.Size = New System.Drawing.Size(108, 23)
Me.BtnAddNewChild.TabIndex = 8
Me.BtnAddNewChild.Text = "Add New Child"
Me.BtnAddNewChild.UseVisualStyleBackColor = True
'
'BtnAddNewStaffMember
'
Me.BtnAddNewStaffMember.Location = New System.Drawing.Point(115, 79)
Me.BtnAddNewStaffMember.Name = "BtnAddNewStaffMember"
Me.BtnAddNewStaffMember.Size = New System.Drawing.Size(137, 23)
Me.BtnAddNewStaffMember.TabIndex = 9
Me.BtnAddNewStaffMember.Text = "Add New Staff Member"
Me.BtnAddNewStaffMember.UseVisualStyleBackColor = True
'
'BtnEditChild
'
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents Lbl_Records As System.Windows.Forms.Label
Friend WithEvents ImgBunnies As System.Windows.Forms.PictureBox
Friend WithEvents BtnExit As System.Windows.Forms.Button
Friend WithEvents BtnAddNewChild As System.Windows.Forms.Button
Friend WithEvents BtnAddNewStaffMember As System.Windows.Forms.Button
Friend WithEvents BtnEditChild As System.Windows.Forms.Button
Friend WithEvents BtnEditStaffMember As System.Windows.Forms.Button
Friend WithEvents BtnRemoveChild As System.Windows.Forms.Button
Friend WithEvents BtnRemoveStaffMember As System.Windows.Forms.Button
End Class
FormAddStaffMember;
Screenshot;
Form Code;
Imports MySql.Data.MySqlClient
Public Class FormAddStaffMember
'imports the required assemblies needed to create MySql Connections
Else
QueryStaffMember = "INSERT INTO tbl_StaffInfo (StaffID, Forename, Surname, Position)
VALUES ('" & TxtStaffID.Text & "','" & TxtForename.Text & "','" & TxtSurname.Text & "','" &
TxtPosition.Text & ")"
End If
'Checks to see if the query requires the position of the employee to be included
QueryLogin = "INSERT INTO tbl_LoginInfo ( Username, Password, StaffID, Admin ) VALUES ('" &
TxtUsername.Text & "','" & UseCipher(TxtPassword.Text) & "','" & TxtStaffID.Text & "','" & AdminChar &
")"
'assigns the query for entering data into login info table
Try
Connect.Open()
COMMAND = New MySqlCommand(Query, Connect)
COMMAND = ExecuteNonQuery()
COMMAND.Dispose()
'executes the query that adds information to tbl_LoginInfo
COMMAND = New MySqlCommand(QueryStaffMember, Connect)
COMMAND = ExecuteNonQuery()
COMMAND.Dispose()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
Connect.close()
MessageBox.Show("New Staff Member has been successfully added, they will now be able to log
onto the system.", "New Staff Member successfully added", MessageBoxButtons.OK)
Close()
End Sub
End Class
Designer Code;
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class FormAddStaffMember
Inherits System.Windows.Forms.Form
Me.LblAddNewStaff.TabIndex = 5
Me.LblAddNewStaff.Text = "Add New Staff Member"
'
'LblStaffID
'
Me.LblStaffID.AutoSize = True
Me.LblStaffID.Location = New System.Drawing.Point(65, 127)
Me.LblStaffID.Name = "LblStaffID"
Me.LblStaffID.Size = New System.Drawing.Size(46, 13)
Me.LblStaffID.TabIndex = 6
Me.LblStaffID.Text = "Staff ID:"
'
'Lbl_Forename
'
Me.Lbl_Forename.AutoSize = True
Me.Lbl_Forename.Location = New System.Drawing.Point(59, 165)
Me.Lbl_Forename.Name = "Lbl_Forename"
Me.Lbl_Forename.Size = New System.Drawing.Size(57, 13)
Me.Lbl_Forename.TabIndex = 7
Me.Lbl_Forename.Text = "Forename:"
'
'LblSurname
'
Me.LblSurname.AutoSize = True
Me.LblSurname.Location = New System.Drawing.Point(59, 205)
Me.LblSurname.Name = "LblSurname"
Me.LblSurname.Size = New System.Drawing.Size(52, 13)
Me.LblSurname.TabIndex = 8
Me.LblSurname.Text = "Surname:"
'
'LblPosition
'
Me.LblPosition.AutoSize = True
Me.LblPosition.Location = New System.Drawing.Point(57, 244)
Me.LblPosition.Name = "LblPosition"
Me.LblPosition.Size = New System.Drawing.Size(50, 13)
Me.LblPosition.TabIndex = 9
Me.LblPosition.Text = "Position: "
'
'LblAdmin
'
Me.LblAdmin.AutoSize = True
Me.LblAdmin.Location = New System.Drawing.Point(205, 126)
Me.LblAdmin.Name = "LblAdmin"
Me.LblAdmin.Size = New System.Drawing.Size(39, 13)
Me.LblAdmin.TabIndex = 10
Me.LblAdmin.Text = "Admin:"
'
'LblUsername
'
Me.LblUsername.AutoSize = True
Me.RadBtnYes.Text = "Yes"
Me.RadBtnYes.UseVisualStyleBackColor = True
'
'RadBtnNo
'
Me.RadBtnNo.AutoSize = True
Me.RadBtnNo.Location = New System.Drawing.Point(269, 143)
Me.RadBtnNo.Name = "RadBtnNo"
Me.RadBtnNo.Size = New System.Drawing.Size(39, 17)
Me.RadBtnNo.TabIndex = 18
Me.RadBtnNo.TabStop = True
Me.RadBtnNo.Text = "No"
Me.RadBtnNo.UseVisualStyleBackColor = True
'
'TxtUsername
'
Me.TxtUsername.Location = New System.Drawing.Point(208, 182)
Me.TxtUsername.Name = "TxtUsername"
Me.TxtUsername.Size = New System.Drawing.Size(100, 20)
Me.TxtUsername.TabIndex = 19
'
'TxtPassword
'
Me.TxtPassword.Location = New System.Drawing.Point(208, 221)
Me.TxtPassword.Name = "TxtPassword"
Me.TxtPassword.Size = New System.Drawing.Size(100, 20)
Me.TxtPassword.TabIndex = 20
'
'BtnCancel
'
Me.BtnCancel.Location = New System.Drawing.Point(60, 319)
Me.BtnCancel.Name = "BtnCancel"
Me.BtnCancel.Size = New System.Drawing.Size(75, 23)
Me.BtnCancel.TabIndex = 21
Me.BtnCancel.Text = "Cancel "
Me.BtnCancel.UseVisualStyleBackColor = True
'
'BtnConfirm
'
Me.BtnConfirm.Location = New System.Drawing.Point(233, 319)
Me.BtnConfirm.Name = "BtnConfirm"
Me.BtnConfirm.Size = New System.Drawing.Size(75, 23)
Me.BtnConfirm.TabIndex = 22
Me.BtnConfirm.Text = "Confirm"
Me.BtnConfirm.UseVisualStyleBackColor = True
'
'FormAddStaffMember
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(407, 376)
Me.Controls.Add(Me.BtnConfirm)
Me.Controls.Add(Me.BtnCancel)
Me.Controls.Add(Me.TxtPassword)
Me.Controls.Add(Me.TxtUsername)
Me.Controls.Add(Me.RadBtnNo)
Me.Controls.Add(Me.RadBtnYes)
Me.Controls.Add(Me.TxtPosition)
Me.Controls.Add(Me.TxtSurname)
Me.Controls.Add(Me.TxtForename)
Me.Controls.Add(Me.TxtStaffID)
Me.Controls.Add(Me.LblPassword)
Me.Controls.Add(Me.LblUsername)
Me.Controls.Add(Me.LblAdmin)
Me.Controls.Add(Me.LblPosition)
Me.Controls.Add(Me.LblSurname)
Me.Controls.Add(Me.Lbl_Forename)
Me.Controls.Add(Me.LblStaffID)
Me.Controls.Add(Me.LblAddNewStaff)
Me.Controls.Add(Me.ImgBunnies)
Me.Name = "FormAddStaffMember"
Me.Text = "Add New Staff Member"
CType(Me.ImgBunnies, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents ImgBunnies As System.Windows.Forms.PictureBox
Friend WithEvents LblAddNewStaff As System.Windows.Forms.Label
Friend WithEvents LblStaffID As System.Windows.Forms.Label
Friend WithEvents Lbl_Forename As System.Windows.Forms.Label
Friend WithEvents LblSurname As System.Windows.Forms.Label
Friend WithEvents LblPosition As System.Windows.Forms.Label
Friend WithEvents LblAdmin As System.Windows.Forms.Label
Friend WithEvents LblUsername As System.Windows.Forms.Label
Friend WithEvents LblPassword As System.Windows.Forms.Label
Friend WithEvents TxtStaffID As System.Windows.Forms.TextBox
Friend WithEvents TxtForename As System.Windows.Forms.TextBox
Friend WithEvents TxtSurname As System.Windows.Forms.TextBox
Friend WithEvents TxtPosition As System.Windows.Forms.TextBox
Friend WithEvents RadBtnYes As System.Windows.Forms.RadioButton
Friend WithEvents RadBtnNo As System.Windows.Forms.RadioButton
Friend WithEvents TxtUsername As System.Windows.Forms.TextBox
Friend WithEvents TxtPassword As System.Windows.Forms.TextBox
Friend WithEvents BtnCancel As System.Windows.Forms.Button
Friend WithEvents BtnConfirm As System.Windows.Forms.Button
End Class
FormEditStaffMember;
Screenshot;
Form Code;
Imports MySql.Data.MySqlClient
Public Class FormEditStaffMember
While READER.Read()
TxtPosition.Text = READER("Position")
TxtStaffID.Text = READER("StaffID")
StaffID = TxtStaffID.Text
AdminChar = READER("Admin")
'reads in data to matching textboxes
Else
Admin = False
'assigns a boolean value based on the value that is read in
'allows radio button to be set correctly
End If
RadBtnYes.Checked = Admin
RadBtnNo.Checked = Not Admin
TxtUsername.Text = READER("Username")
TxtForenameChange.Text = TxtForenameChange.Text
TxtSurnameChange.Text = TxtSurnameChange.Text
'assigns the correct values for the radio buttons
End While
READER.Close()
COMMAND.Dispose()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
Connect.Close()
End Sub
Try
Connect.Open()
Catch ex As Exception
End Try
Query = "Select * from tbl_StaffInfo, tbl_LoginInfo where tbl_StaffInfo.Forename = '" & Forename
& "' AND tbl_StaffInfo.Surname = '" & Surname & "' AND tbl_LoginInfo.StaffID = tbl_StaffInfo.StaffID"
COMMAND = New MySqlCommand(Query, Connect)
READER = COMMAND.ExecuteReader
While READER.Read()
CheckForename = READER("Forename")
CheckSurname = READER("Surname")
CheckPosition = READER("Position")
CheckStaffID = READER("StaffID")
CheckUsername = READER("Username")
CheckAdmin = READER("Admin")
Else
CheckAdmin = "1"
End If
Try
Query = "UPDATE tbl_LoginInfo SET Admin" & CheckAdmin & " WHERE StaffID = '" &
TxtStaffID.Text & "'"
COMMAND = New MySqlCommand(Query, Connect)
COMMAND.ExecuteNonQuery()
COMMAND.Dispose()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Select
End Try
End Select
'select cases used to check each piece of information to see whether it is
'the same as information already stored
'if it isn't then command is executed in order to update the info
PopulateInfo(TxtForename.Text, TxtSurname.Text)
'calls populateinfo to pass on staff member forename and surname to the subroutine
End Sub
Private Sub UpdateSpecific(ByRef Table As String, ByVal Column As String, ByVal Text As String,
ByVal ConstColumn As String, ByVal ConstText As String)
'update specific routine, used to automate large amount of update commands
If ConstColumn = "" Then
ConstColumn = "StaffID"
'used for default, if the constcolumn is not specified then StaffID used
End Class
Designer Code;
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class FormEditStaffMember
Inherits System.Windows.Forms.Form
CType(Me.ImgBunnies, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'ImgBunnies
'
Me.ImgBunnies.Image = CType(resources.GetObject("ImgBunnies.Image"),
System.Drawing.Image)
Me.ImgBunnies.Location = New System.Drawing.Point(0, 0)
Me.ImgBunnies.Name = "ImgBunnies"
Me.ImgBunnies.Size = New System.Drawing.Size(102, 65)
Me.ImgBunnies.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.ImgBunnies.TabIndex = 3
Me.ImgBunnies.TabStop = False
'
'LblEditStaffMember
'
Me.LblEditStaffMember.AutoSize = True
Me.LblEditStaffMember.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!,
System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.LblEditStaffMember.Location = New System.Drawing.Point(105, 74)
Me.LblEditStaffMember.Name = "LblEditStaffMember"
Me.LblEditStaffMember.Size = New System.Drawing.Size(181, 16)
Me.LblEditStaffMember.TabIndex = 6
Me.LblEditStaffMember.Text = "Edit Staff Member Information"
'
'LblForename
'
Me.LblForename.AutoSize = True
Me.LblForename.Location = New System.Drawing.Point(50, 126)
Me.LblForename.Name = "LblForename"
Me.LblForename.Size = New System.Drawing.Size(57, 13)
Me.LblForename.TabIndex = 7
Me.LblForename.Text = "Forename:"
'
'LblSurname
'
Me.LblSurname.AutoSize = True
Me.LblSurname.Location = New System.Drawing.Point(211, 126)
Me.LblSurname.Name = "LblSurname"
Me.LblSurname.Size = New System.Drawing.Size(55, 13)
Me.LblSurname.TabIndex = 8
Me.LblSurname.Text = "Surname: "
'
'LblForenameChange
'
Me.LblForenameChange.AutoSize = True
Me.LblForenameChange.Location = New System.Drawing.Point(50, 225)
Me.LblForenameChange.Name = "LblForenameChange"
Me.LblForenameChange.Size = New System.Drawing.Size(57, 13)
Me.LblForenameChange.TabIndex = 9
Me.LblForenameChange.Text = "Forename:"
'
'LblSurnameChange
'
Me.LblSurnameChange.AutoSize = True
Me.LblSurnameChange.Location = New System.Drawing.Point(211, 225)
Me.LblSurnameChange.Name = "LblSurnameChange"
Me.LblSurnameChange.Size = New System.Drawing.Size(55, 13)
Me.LblSurnameChange.TabIndex = 10
Me.LblSurnameChange.Text = "Surname: "
'
'LblPosition
'
Me.LblPosition.AutoSize = True
Me.LblPosition.Location = New System.Drawing.Point(50, 264)
Me.LblPosition.Name = "LblPosition"
Me.LblPosition.Size = New System.Drawing.Size(50, 13)
Me.LblPosition.TabIndex = 11
Me.LblPosition.Text = "Position: "
'
'LblStaffID
'
Me.LblStaffID.AutoSize = True
Me.LblStaffID.Location = New System.Drawing.Point(50, 304)
Me.LblStaffID.Name = "LblStaffID"
Me.LblStaffID.Size = New System.Drawing.Size(49, 13)
Me.LblStaffID.TabIndex = 12
Me.LblStaffID.Text = "Staff ID: "
'
'LblUsername
'
Me.LblUsername.AutoSize = True
Me.LblUsername.Location = New System.Drawing.Point(208, 264)
Me.LblUsername.Name = "LblUsername"
Me.LblUsername.Size = New System.Drawing.Size(58, 13)
Me.LblUsername.TabIndex = 13
Me.LblUsername.Text = "Username:"
'
'LblAdmin
'
Me.LblAdmin.AutoSize = True
Me.LblAdmin.Location = New System.Drawing.Point(211, 304)
Me.LblAdmin.Name = "LblAdmin"
Me.LblAdmin.Size = New System.Drawing.Size(42, 13)
Me.LblAdmin.TabIndex = 14
Me.LblAdmin.Text = "Admin: "
'
'BtnSearch
'
Me.BtnSearch.Location = New System.Drawing.Point(141, 187)
Me.BtnSearch.Name = "BtnSearch"
Me.BtnSearch.Size = New System.Drawing.Size(87, 23)
Me.BtnSearch.TabIndex = 15
Me.BtnSearch.Text = "Search"
Me.BtnSearch.UseVisualStyleBackColor = True
'
'BtnExit
'
Me.BtnExit.Location = New System.Drawing.Point(283, 359)
Me.BtnExit.Name = "BtnExit"
Me.BtnExit.Size = New System.Drawing.Size(75, 23)
Me.BtnExit.TabIndex = 16
Me.BtnExit.Text = "Exit"
Me.BtnExit.UseVisualStyleBackColor = True
'
'TxtForename
'
Me.TxtForename.Location = New System.Drawing.Point(53, 144)
Me.TxtForename.Name = "TxtForename"
Me.TxtForename.Size = New System.Drawing.Size(100, 20)
Me.TxtForename.TabIndex = 17
'
'TxtSurname
'
Me.TxtSurname.Location = New System.Drawing.Point(214, 144)
Me.TxtSurname.Name = "TxtSurname"
Me.TxtSurname.Size = New System.Drawing.Size(100, 20)
Me.TxtSurname.TabIndex = 18
'
'TxtForenameChange
'
Me.TxtForenameChange.Location = New System.Drawing.Point(53, 241)
Me.TxtForenameChange.Name = "TxtForenameChange"
Me.TxtForenameChange.Size = New System.Drawing.Size(100, 20)
Me.TxtForenameChange.TabIndex = 19
'
'TxtSurnameChange
'
Me.TxtSurnameChange.Location = New System.Drawing.Point(214, 241)
Me.TxtSurnameChange.Name = "TxtSurnameChange"
Me.TxtSurnameChange.Size = New System.Drawing.Size(100, 20)
Me.TxtSurnameChange.TabIndex = 20
'
'TxtPosition
'
Me.TxtPosition.Location = New System.Drawing.Point(53, 281)
Me.TxtPosition.Name = "TxtPosition"
Me.TxtPosition.Size = New System.Drawing.Size(100, 20)
Me.TxtPosition.TabIndex = 21
'
'TxtUsername
'
Me.TxtUsername.Location = New System.Drawing.Point(214, 281)
Me.TxtUsername.Name = "TxtUsername"
Me.TxtUsername.Size = New System.Drawing.Size(100, 20)
Me.TxtUsername.TabIndex = 22
'
'TxtStaffID
'
Me.TxtStaffID.Location = New System.Drawing.Point(53, 320)
Me.TxtStaffID.Name = "TxtStaffID"
Me.TxtStaffID.Size = New System.Drawing.Size(100, 20)
Me.TxtStaffID.TabIndex = 23
'
'RadBtnYes
'
Me.RadBtnYes.AutoSize = True
Me.RadBtnYes.Location = New System.Drawing.Point(211, 323)
Me.RadBtnYes.Name = "RadBtnYes"
Me.RadBtnYes.Size = New System.Drawing.Size(46, 17)
Me.RadBtnYes.TabIndex = 24
Me.RadBtnYes.TabStop = True
Me.RadBtnYes.Text = "Yes "
Me.RadBtnYes.UseVisualStyleBackColor = True
'
'RadBtnNo
'
Me.RadBtnNo.AutoSize = True
Me.RadBtnNo.Location = New System.Drawing.Point(272, 323)
Me.RadBtnNo.Name = "RadBtnNo"
Me.RadBtnNo.Size = New System.Drawing.Size(42, 17)
Me.RadBtnNo.TabIndex = 25
Me.RadBtnNo.TabStop = True
Me.RadBtnNo.Text = "No "
Me.RadBtnNo.UseVisualStyleBackColor = True
'
'BtnEdit
'
Me.BtnEdit.Location = New System.Drawing.Point(141, 359)
Me.BtnEdit.Name = "BtnEdit"
Me.BtnEdit.Size = New System.Drawing.Size(75, 23)
Me.BtnEdit.TabIndex = 26
Me.BtnEdit.Text = "Update"
Me.BtnEdit.UseVisualStyleBackColor = True
'
'FormEditStaffMember
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(370, 394)
Me.Controls.Add(Me.BtnEdit)
Me.Controls.Add(Me.RadBtnNo)
Me.Controls.Add(Me.RadBtnYes)
Me.Controls.Add(Me.TxtStaffID)
Me.Controls.Add(Me.TxtUsername)
Me.Controls.Add(Me.TxtPosition)
Me.Controls.Add(Me.TxtSurnameChange)
Me.Controls.Add(Me.TxtForenameChange)
Me.Controls.Add(Me.TxtSurname)
Me.Controls.Add(Me.TxtForename)
Me.Controls.Add(Me.BtnExit)
Me.Controls.Add(Me.BtnSearch)
Me.Controls.Add(Me.LblAdmin)
Me.Controls.Add(Me.LblUsername)
Me.Controls.Add(Me.LblStaffID)
Me.Controls.Add(Me.LblPosition)
Me.Controls.Add(Me.LblSurnameChange)
Me.Controls.Add(Me.LblForenameChange)
Me.Controls.Add(Me.LblSurname)
Me.Controls.Add(Me.LblForename)
Me.Controls.Add(Me.LblEditStaffMember)
Me.Controls.Add(Me.ImgBunnies)
Me.Name = "FormEditStaffMember"
Me.Text = "Edit Staff Member"
CType(Me.ImgBunnies, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents ImgBunnies As System.Windows.Forms.PictureBox
Friend WithEvents LblEditStaffMember As System.Windows.Forms.Label
Friend WithEvents LblForename As System.Windows.Forms.Label
Friend WithEvents LblSurname As System.Windows.Forms.Label
Friend WithEvents LblForenameChange As System.Windows.Forms.Label
Friend WithEvents LblSurnameChange As System.Windows.Forms.Label
Friend WithEvents LblPosition As System.Windows.Forms.Label
Friend WithEvents LblStaffID As System.Windows.Forms.Label
Friend WithEvents LblUsername As System.Windows.Forms.Label
Friend WithEvents LblAdmin As System.Windows.Forms.Label
Friend WithEvents BtnSearch As System.Windows.Forms.Button
Friend WithEvents BtnExit As System.Windows.Forms.Button
Friend WithEvents TxtForename As System.Windows.Forms.TextBox
Friend WithEvents TxtSurname As System.Windows.Forms.TextBox
Friend WithEvents TxtForenameChange As System.Windows.Forms.TextBox
Friend WithEvents TxtSurnameChange As System.Windows.Forms.TextBox
Friend WithEvents TxtPosition As System.Windows.Forms.TextBox
Friend WithEvents TxtUsername As System.Windows.Forms.TextBox
Friend WithEvents TxtStaffID As System.Windows.Forms.TextBox
Friend WithEvents RadBtnYes As System.Windows.Forms.RadioButton
Friend WithEvents RadBtnNo As System.Windows.Forms.RadioButton
Friend WithEvents BtnEdit As System.Windows.Forms.Button
End Class
FormRemoveStaffMember;
Screenshot;
Form Code;
Imports MySql.Data.MySqlClient
Public Class FormRemoveStaffMember
Dim Connect As New MySqlConnection
Dim Query As String
Dim READER As MySqlDataReader
Dim COMMAND As MySqlCommand
Dim ServerIP As String
Dim ServerUsername As String
Dim ServerPassword As String
Dim DatabaseName As String
'variables
While READER.Read
ComBoxForename.Items.Add(READER("Forename"))
'populares the combobox
End While
READER.Close()
COMMAND.Dispose()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
Try
Connect.Open()
While READER.Read
ComBoxSurname.Items.Add(READER("Surname"))
'populares the combobox
End While
READER.Close()
COMMAND.Dispose()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
Connect.Close()
End Sub
Private Sub BtnRemove_Click(sender As Object, e As EventArgs) Handles BtnRemove.Click
'runs when user clicks the remove button, deletes the selected Staff's record
Dim StaffID As String
Query = "Delete from tbl_StaffInfo where Forename = '" & ComBoxForename.Text & "where
Surname = " & ComBoxSurname.Text & "'"
COMMAND = New MySqlCommand(Query, Connect)
COMMAND.ExecuteNonQuery()
COMMAND.Dispose()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
End Class
Designer Code;
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class FormRemoveStaffMember
Inherits System.Windows.Forms.Form
'LblForename
'
Me.LblForename.AutoSize = True
Me.LblForename.Location = New System.Drawing.Point(56, 125)
Me.LblForename.Name = "LblForename"
Me.LblForename.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.LblForename.Size = New System.Drawing.Size(60, 13)
Me.LblForename.TabIndex = 14
Me.LblForename.Text = "Forename: "
'
'LblRemoveStaffMember
'
Me.LblRemoveStaffMember.AutoSize = True
Me.LblRemoveStaffMember.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!,
System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.LblRemoveStaffMember.Location = New System.Drawing.Point(96, 69)
Me.LblRemoveStaffMember.Name = "LblRemoveStaffMember"
Me.LblRemoveStaffMember.Size = New System.Drawing.Size(169, 20)
Me.LblRemoveStaffMember.TabIndex = 13
Me.LblRemoveStaffMember.Text = "Remove Staff Member"
'
'ImgBunnies
'
Me.ImgBunnies.Image = CType(resources.GetObject("ImgBunnies.Image"),
System.Drawing.Image)
Me.ImgBunnies.Location = New System.Drawing.Point(-1, 1)
Me.ImgBunnies.Name = "ImgBunnies"
Me.ImgBunnies.Size = New System.Drawing.Size(102, 65)
Me.ImgBunnies.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.ImgBunnies.TabIndex = 19
Me.ImgBunnies.TabStop = False
'
'FormRemoveStaffMember
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(334, 263)
Me.Controls.Add(Me.ImgBunnies)
Me.Controls.Add(Me.BtnRemove)
Me.Controls.Add(Me.ComBoxSurname)
Me.Controls.Add(Me.ComBoxForename)
Me.Controls.Add(Me.LblSurname)
Me.Controls.Add(Me.LblForename)
Me.Controls.Add(Me.LblRemoveStaffMember)
Me.Name = "FormRemoveStaffMember"
Me.Text = "FormRemoveStaffMember"
CType(Me.ImgBunnies, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
FormAddNewChild;
Screenshot;
Form Code;
Imports MySql.Data.SqlClient
Public Class FormAddNewChild
'imports the required assemblies needed in order to use MySQL Connection
Public Class FormAddNewChild
Dim Connect As New MySqlConnection
Dim Query As String
Dim READER As MySqlDataReader
Dim COMMAND As MySqlCommand
Dim ServerIP As String
Dim ServerUsername As String
Dim ServerPassword As String
Dim DatabaseName As String
'These are the class variables used throughout the class
'so they are declared at the top
'not accessible anywhere else in program
Designer Code;
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class FormAddNewChild
Inherits System.Windows.Forms.Form
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'
'LblForename
'
Me.LblForename.AutoSize = True
Me.LblForename.Location = New System.Drawing.Point(48, 159)
Me.LblForename.Name = "LblForename"
Me.LblForename.Size = New System.Drawing.Size(39, 13)
Me.LblForename.TabIndex = 13
Me.LblForename.Text = "LblForename"
'
'LblSurname
'
Me.LblSurname.AutoSize = True
Me.LblSurname.Location = New System.Drawing.Point(48, 197)
Me.LblSurname.Name = "LblSurname"
Me.LblSurname.Size = New System.Drawing.Size(39, 13)
Me.LblSurname.TabIndex = 14
Me.LblSurname.Text = "LblSurname"
'
'LblDateOfBirth
'
Me.LblDateOfBirth.AutoSize = True
Me.LblDateOfBirth.Location = New System.Drawing.Point(48, 235)
Me.LblDateOfBirth.Name = "LblDateOfBirth"
Me.LblDateOfBirth.Size = New System.Drawing.Size(39, 13)
Me.LblDateOfBirth.TabIndex = 15
Me.LblDateOfBirth.Text = "LblDateOfBirth"
'
'LblChildMedicalNeeds
'
Me.LblChildMedicalNeeds.AutoSize = True
Me.LblChildMedicalNeeds.Location = New System.Drawing.Point(220, 122)
Me.LblChildMedicalNeeds.Name = "LblChildMedicalNeeds"
Me.LblChildMedicalNeeds.Size = New System.Drawing.Size(39, 13)
Me.LblChildMedicalNeeds.TabIndex = 16
Me.LblChildMedicalNeeds.Text = "LblChildMedicalNeeds"
'
'LblMedicineNeeded
'
Me.LblMedicineNeeded.AutoSize = True
Me.LblMedicineNeeded.Location = New System.Drawing.Point(220, 159)
Me.LblMedicineNeeded.Name = "LblMedicineNeeded"
Me.LblMedicineNeeded.Size = New System.Drawing.Size(39, 13)
Me.LblMedicineNeeded.TabIndex = 17
Me.LblMedicineNeeded.Text = "LblMedicineNeeded"
'
'LblAddNewChild
'
Me.LblAddNewChild.AutoSize = True
Me.LblAddNewChild.Location = New System.Drawing.Point(165, 78)
Me.LblAddNewChild.Name = "LblAddNewChild"
End Sub
Friend WithEvents ImgBunnies As System.Windows.Forms.PictureBox
Friend WithEvents LblAddNewChild As System.Windows.Forms.Label
Friend WithEvents LblChildID As System.Windows.Forms.Label
Friend WithEvents LblForename As System.Windows.Forms.Label
Friend WithEvents LblSurname As System.Windows.Forms.Label
Friend WithEvents LblChildMedicalNeeds As System.Windows.Forms.Label
Friend WithEvents LblMedicineNeeded As System.Windows.Forms.Label
Friend WithEvents TxtChildID As System.Windows.Forms.TextBox
Friend WithEvents TxtForename As System.Windows.Forms.TextBox
Friend WithEvents TxtSurname As System.Windows.Forms.TextBox
Friend WithEvents TxtChildMedicalNeeds As System.Windows.Forms.TextBox
Friend WithEvents TxtMedicineNeeded As System.Windows.Forms.TextBox
Friend WithEvents LblDateOfBirth As System.Windows.Forms.Label
Friend WithEvents TxtDateOfBirth As System.Windows.Forms.TextBox
Friend WithEvents Exit_Button As System.Windows.Forms.Button
Friend WithEvents Confirm_Button As System.Windows.Forms.Button
Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox
Friend WithEvents LblChildID As System.Windows.Forms.Label
Friend WithEvents LblForename As System.Windows.Forms.Label
Friend WithEvents LblSurname As System.Windows.Forms.Label
Friend WithEvents LblDateOfBirth As System.Windows.Forms.Label
Friend WithEvents LblChildMedicalNeeds As System.Windows.Forms.Label
Friend WithEvents LblMedicineNeeded As System.Windows.Forms.Label
Friend WithEvents LblAddNewChild As System.Windows.Forms.Label
End Class
FormEditChildRecord;
Screenshot;
Form Code;
Imports MySql.Data.MySqlClient
TxtSurname.Text = READER("Surname")
TxtChildMedicalNeeds.Text = READER("ChildMedicalNeeds")
TxtMedicineNeeded.Text = READER("MedicineNeeded")
End While
READER.Close()
COMMAND.Dispose()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
'reads in info and assigns it to textboxes
End Sub
Query = ("UPDATE tbl_ChildInfo SET ChildID = '" & TxtChildID.Text & "' WHERE
Forename = '" & ComBoxChild.Text & "'")
COMMAND = New MySqlCommand(Query, Connect)
COMMAND.ExecuteNonQuery()
COMMAND.Dispose()
'case statement to check whether the data in textboxes
'is the same as the check data
'if it isn't, command executes in order to update
Catch ex As Exception
MessageBox.Show("The record for child has been updated successfully, the
appropriate database(s) has been amended.", "Record updated successfully.",
MessageBoxButtons.OK)
End Try
Case Else
End Select
'do nothing
Catch ex As Exception
End Try
Select Case CheckForename
Case Is <> TxtForename.Text
Try
Query = ("UPDATE tbl_ChildInfo SET Forename = '" & TxtForename.Text & "' WHERE
Forename = '" & ComBoxChild.Text & "'")
COMMAND = New MySqlCommand(Query, Connect)
COMMAND.ExecuteNonQuery()
COMMAND.Dispose()
'case statement to check whether the data in textboxes
'is the same as the check data
'if it isn't, command executes in order to update
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
Case Else
End Select
'do nothing
Select Case CheckSurname
Case Is <> TxtSurname.Text
Try
Query = ("UPDATE tbl_ChildInfo SET Surname = '" & TxtSurname.Text & "' WHERE
Forename = '" & ComBoxChild.Text & "'")
COMMAND = New MySqlCommand(Query, Connect)
COMMAND.ExecuteNonQuery()
COMMAND.Dispose()
'case statement to check whether the data in textboxes
'is the same as the check data
'if it isn't, command executes in order to update
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
Case Else
End Select
'do nothing
Select Case CheckChildMedicalNeeds
Case Is <> TxtChildMedicalNeeds.Text
Try
Query = ("UPDATE tbl_ChildInfo SET ChildMedicalNeeds = '" &
TxtChildMedicalNeeds.Text & "' WHERE Forename = '" & ComBoxChild.Text & "'")
COMMAND = New MySqlCommand(Query, Connect)
COMMAND.ExecuteNonQuery()
COMMAND.Dispose()
'case statement to check whether the data in textboxes
'is the same as the check data
'if it isn't, command executes in order to update
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
Case Else
End Select
'do nothing
Select Case CheckMedicineNeeded
Case Is <> TxtMedicineNeeded.Text
Try
Query = ("UPDATE tbl_ChildInfo SET MedicineNeeded = '" & TxtMedicineNeeded.Text
& "' WHERE Forename = '" & ComBoxChild.Text & "'")
COMMAND = New MySqlCommand(Query, Connect)
COMMAND.ExecuteNonQuery()
COMMAND.Dispose()
'case statement to check whether the data in textboxes
'is the same as the check data
'if it isn't, command executes in order to update
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
Case Else
End Select
Try
'do nothing
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
Connect.Close()
Else
MessageBox.Show("Please make amendments to the boxes so that the string limit is not
exceeded.")
End If
End Sub
End Class
Designer Code;
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Me.ImgBunnies.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.ImgBunnies.TabIndex = 4
Me.ImgBunnies.TabStop = False
'
'LblEditChildRecord
'
Me.LblEditChildRecord.AutoSize = True
Me.LblEditChildRecord.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!,
System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.LblEditChildRecord.Location = New System.Drawing.Point(164, 52)
Me.LblEditChildRecord.Name = "LblEditChildRecord"
Me.LblEditChildRecord.Size = New System.Drawing.Size(112, 16)
Me.LblEditChildRecord.TabIndex = 5
Me.LblEditChildRecord.Text = "Edit Child Record"
'
'LblChild
'
Me.LblChild.AutoSize = True
Me.LblChild.Location = New System.Drawing.Point(64, 107)
Me.LblChild.Name = "LblChild"
Me.LblChild.Size = New System.Drawing.Size(36, 13)
Me.LblChild.TabIndex = 6
Me.LblChild.Text = "Child: "
'
'LblChildID
'
Me.LblChildID.AutoSize = True
Me.LblChildID.Location = New System.Drawing.Point(46, 159)
Me.LblChildID.Name = "LblChildID"
Me.LblChildID.Size = New System.Drawing.Size(44, 13)
Me.LblChildID.TabIndex = 7
Me.LblChildID.Text = "ChildID:"
'
'LblForename
'
Me.LblForename.AutoSize = True
Me.LblForename.Location = New System.Drawing.Point(47, 231)
Me.LblForename.Name = "LblForename"
Me.LblForename.Size = New System.Drawing.Size(60, 13)
Me.LblForename.TabIndex = 8
Me.LblForename.Text = "Forename: "
'
'LblSurname
'
Me.LblSurname.AutoSize = True
Me.LblSurname.Location = New System.Drawing.Point(47, 281)
Me.LblSurname.Name = "LblSurname"
Me.LblSurname.Size = New System.Drawing.Size(55, 13)
Me.LblSurname.TabIndex = 9
Me.LblSurname.Text = "Surname: "
'
'LblChildMedicalNeeds
'
Me.LblChildMedicalNeeds.AutoSize = True
Me.LblChildMedicalNeeds.Location = New System.Drawing.Point(209, 159)
Me.LblChildMedicalNeeds.Name = "LblChildMedicalNeeds"
Me.LblChildMedicalNeeds.Size = New System.Drawing.Size(110, 13)
Me.LblChildMedicalNeeds.TabIndex = 10
Me.LblChildMedicalNeeds.Text = "Child Medical Needs: "
'
'LblMedicineNeeded
'
Me.LblMedicineNeeded.AutoSize = True
Me.LblMedicineNeeded.Location = New System.Drawing.Point(209, 231)
Me.LblMedicineNeeded.Name = "LblMedicineNeeded"
Me.LblMedicineNeeded.Size = New System.Drawing.Size(97, 13)
Me.LblMedicineNeeded.TabIndex = 11
Me.LblMedicineNeeded.Text = "Medicine Needed: "
'
'TxtChildID
'
Me.TxtChildID.Location = New System.Drawing.Point(49, 175)
Me.TxtChildID.Name = "TxtChildID"
Me.TxtChildID.Size = New System.Drawing.Size(100, 20)
Me.TxtChildID.TabIndex = 12
'
'TxtForename
'
Me.TxtForename.Location = New System.Drawing.Point(49, 247)
Me.TxtForename.Name = "TxtForename"
Me.TxtForename.Size = New System.Drawing.Size(135, 20)
Me.TxtForename.TabIndex = 13
'
'TxtSurname
'
Me.TxtSurname.Location = New System.Drawing.Point(49, 297)
Me.TxtSurname.Name = "TxtSurname"
Me.TxtSurname.Size = New System.Drawing.Size(135, 20)
Me.TxtSurname.TabIndex = 14
'
'TxtChildMedicalNeeds
'
Me.TxtChildMedicalNeeds.Location = New System.Drawing.Point(212, 175)
Me.TxtChildMedicalNeeds.Name = "TxtChildMedicalNeeds"
Me.TxtChildMedicalNeeds.Size = New System.Drawing.Size(163, 20)
Me.TxtChildMedicalNeeds.TabIndex = 15
'
'TxtMedicineNeeded
'
Me.TxtMedicineNeeded.Location = New System.Drawing.Point(212, 247)
Me.TxtMedicineNeeded.Name = "TxtMedicineNeeded"
Me.TxtMedicineNeeded.Size = New System.Drawing.Size(163, 20)
Me.TxtMedicineNeeded.TabIndex = 16
'
'BtnUpdate
'
Me.BtnUpdate.Location = New System.Drawing.Point(284, 320)
Me.BtnUpdate.Name = "BtnUpdate"
Me.BtnUpdate.Size = New System.Drawing.Size(75, 23)
Me.BtnUpdate.TabIndex = 17
Me.BtnUpdate.Text = "Update"
Me.BtnUpdate.UseVisualStyleBackColor = True
'
'ComBoxChild
'
Me.ComBoxChild.FormattingEnabled = True
Me.ComBoxChild.Location = New System.Drawing.Point(106, 107)
Me.ComBoxChild.Name = "ComBoxChild"
Me.ComBoxChild.Size = New System.Drawing.Size(121, 21)
Me.ComBoxChild.TabIndex = 18
'
'BtnSelect
'
Me.BtnSelect.Location = New System.Drawing.Point(264, 107)
Me.BtnSelect.Name = "BtnSelect"
Me.BtnSelect.Size = New System.Drawing.Size(75, 23)
Me.BtnSelect.TabIndex = 19
Me.BtnSelect.Text = "Select"
Me.BtnSelect.UseVisualStyleBackColor = True
'
'FormEditChildRecord
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(405, 355)
Me.Controls.Add(Me.BtnSelect)
Me.Controls.Add(Me.ComBoxChild)
Me.Controls.Add(Me.BtnUpdate)
Me.Controls.Add(Me.TxtMedicineNeeded)
Me.Controls.Add(Me.TxtChildMedicalNeeds)
Me.Controls.Add(Me.TxtSurname)
Me.Controls.Add(Me.TxtForename)
Me.Controls.Add(Me.TxtChildID)
Me.Controls.Add(Me.LblMedicineNeeded)
Me.Controls.Add(Me.LblChildMedicalNeeds)
Me.Controls.Add(Me.LblSurname)
Me.Controls.Add(Me.LblForename)
Me.Controls.Add(Me.LblChildID)
Me.Controls.Add(Me.LblChild)
Me.Controls.Add(Me.LblEditChildRecord)
Me.Controls.Add(Me.ImgBunnies)
Me.Name = "FormEditChildRecord"
Me.Text = "Edit Child Record"
CType(Me.ImgBunnies, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents ImgBunnies As System.Windows.Forms.PictureBox
Friend WithEvents LblEditChildRecord As System.Windows.Forms.Label
Friend WithEvents LblChild As System.Windows.Forms.Label
Friend WithEvents LblChildID As System.Windows.Forms.Label
Friend WithEvents LblForename As System.Windows.Forms.Label
Friend WithEvents LblSurname As System.Windows.Forms.Label
Friend WithEvents LblChildMedicalNeeds As System.Windows.Forms.Label
Friend WithEvents LblMedicineNeeded As System.Windows.Forms.Label
Friend WithEvents TxtChildID As System.Windows.Forms.TextBox
Friend WithEvents TxtForename As System.Windows.Forms.TextBox
Friend WithEvents TxtSurname As System.Windows.Forms.TextBox
Friend WithEvents TxtChildMedicalNeeds As System.Windows.Forms.TextBox
Friend WithEvents TxtMedicineNeeded As System.Windows.Forms.TextBox
Friend WithEvents BtnUpdate As System.Windows.Forms.Button
Friend WithEvents ComBoxChild As System.Windows.Forms.ComboBox
Friend WithEvents BtnSelect As System.Windows.Forms.Button
End Class
FormRemoveChildRecord;
Screenshot;
Form Code;
Imports MySql.Data.MySqlClient
Public Class FormRemoveChildRecord
Dim Connect As New MySqlConnection
Dim Query As String
Dim READER As MySqlDataReader
Dim COMMAND As MySqlCommand
Dim ServerIP As String
Dim ServerUsername As String
Dim ServerPassword As String
Dim DatabaseName As String
'variables
While READER.Read
ComBoxForename.Items.Add(READER("Forename"))
'populares the combobox
End While
READER.Close()
COMMAND.Dispose()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
Try
Connect.Open()
While READER.Read
ComBoxSurname.Items.Add(READER("Surname"))
'populares the combobox
End While
READER.Close()
COMMAND.Dispose()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
Connect.Close()
End Sub
Query = "Delete from tbl_ChildInfo where Forename = '" & ComBoxForename.Text & "where
Surname = " & ComBoxSurname.Text & "'"
COMMAND = New MySqlCommand(Query, Connect)
COMMAND.ExecuteNonQuery()
COMMAND.Dispose()
Catch ex As Exception
MessageBox.Show("The record for child has been deleted successfully, the record has been
removed from the appropriate database(s).", "Record deleted successfully.", MessageBoxButtons.OK)
End Try
End Sub
End Class
Designer Code;
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class FormRemoveChildRecord
Inherits System.Windows.Forms.Form
End Sub
Friend WithEvents ImgBunnies As System.Windows.Forms.PictureBox
Friend WithEvents LblRemoveChildRecord As System.Windows.Forms.Label
Friend WithEvents LblForename As System.Windows.Forms.Label
Friend WithEvents LblSurname As System.Windows.Forms.Label
Friend WithEvents ComBoxForename As System.Windows.Forms.ComboBox
Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox
Friend WithEvents ComBoxSurname As System.Windows.Forms.ComboBox
Friend WithEvents BtnRemove As System.Windows.Forms.Button
End Class
FormSettings;
Screenshot;
Form Code;
Public Class FormSettings
Designer Code;
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class FormSettings
Inherits System.Windows.Forms.Form
End Sub
Friend WithEvents ImgBunnies As System.Windows.Forms.PictureBox
Friend WithEvents LblSettings As System.Windows.Forms.Label
Friend WithEvents BtnChangeUsername As System.Windows.Forms.Button
Friend WithEvents BtnChangePassword As System.Windows.Forms.Button
End Class
FormChangeUsername;
Screenshot;
Form Code;
Imports MySql.Data.MySqlClient
Public Class FormChangeUsername
Private Sub BtnChange_Click(sender As Object, e As EventArgs) Handles BtnChange.Click
'runs when change button is clicked by user
Dim Query As String = ""
Dim DatabaseName As String = ""
Dim ServerIP As String = ""
Query = "UPDATE tbl_LoginInfo SET Username = '" & TxtNewUsername.Text & "'WHERE
Username = '" & TxtOldUsername.Text & "'"
'updates the new password
ChangeComplete = True
'if everything matches, then change is successfully
Catch ex As Exception
ChangeComplete = False
MessageBox.Show("Your username has not been changed.", "Error Occurred.",
MessageBoxButtons.OK)
'if not then change will not occur
End Try
If ChangeComplete = True Then
MessageBox.Show("Your username has been successfully changed.", "Username Change
successfully.", MessageBoxButtons.OK)
'message displayed to user to tell them their username has been changed
Close()
End If
End Sub
End Class
Designer Code;
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class FormChangeUsername
Inherits System.Windows.Forms.Form
Me.SuspendLayout()
'
'BtnChange
'
Me.BtnChange.Location = New System.Drawing.Point(118, 190)
Me.BtnChange.Name = "BtnChange"
Me.BtnChange.Size = New System.Drawing.Size(75, 23)
Me.BtnChange.TabIndex = 0
Me.BtnChange.Text = "Change"
Me.BtnChange.UseVisualStyleBackColor = True
'
'ImgBunnies
'
Me.ImgBunnies.Image = CType(resources.GetObject("ImgBunnies.Image"),
System.Drawing.Image)
Me.ImgBunnies.Location = New System.Drawing.Point(1, 1)
Me.ImgBunnies.Name = "ImgBunnies"
Me.ImgBunnies.Size = New System.Drawing.Size(102, 65)
Me.ImgBunnies.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.ImgBunnies.TabIndex = 5
Me.ImgBunnies.TabStop = False
'
'TxtOldUsername
'
Me.TxtOldUsername.Location = New System.Drawing.Point(89, 93)
Me.TxtOldUsername.Name = "TxtOldUsername"
Me.TxtOldUsername.Size = New System.Drawing.Size(165, 20)
Me.TxtOldUsername.TabIndex = 6
'
'TxtNewUsername
'
Me.TxtNewUsername.Location = New System.Drawing.Point(89, 142)
Me.TxtNewUsername.Name = "TxtNewUsername"
Me.TxtNewUsername.Size = New System.Drawing.Size(165, 20)
Me.TxtNewUsername.TabIndex = 7
'
'LblOldUsername
'
Me.LblOldUsername.AutoSize = True
Me.LblOldUsername.Location = New System.Drawing.Point(86, 77)
Me.LblOldUsername.Name = "LblOldUsername"
Me.LblOldUsername.Size = New System.Drawing.Size(80, 13)
Me.LblOldUsername.TabIndex = 8
Me.LblOldUsername.Text = "Old Username: "
'
'LblNewUsername
'
Me.LblNewUsername.AutoSize = True
Me.LblNewUsername.Location = New System.Drawing.Point(86, 126)
Me.LblNewUsername.Name = "LblNewUsername"
Me.LblNewUsername.Size = New System.Drawing.Size(86, 13)
Me.LblNewUsername.TabIndex = 9
Me.LblNewUsername.Text = "New Username: "
'
'FormChangeUsername
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(317, 246)
Me.Controls.Add(Me.LblNewUsername)
Me.Controls.Add(Me.LblOldUsername)
Me.Controls.Add(Me.TxtNewUsername)
Me.Controls.Add(Me.TxtOldUsername)
Me.Controls.Add(Me.ImgBunnies)
Me.Controls.Add(Me.BtnChange)
Me.Name = "FormChangeUsername"
Me.Text = "Change Username"
CType(Me.ImgBunnies, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents BtnChange As System.Windows.Forms.Button
Friend WithEvents ImgBunnies As System.Windows.Forms.PictureBox
Friend WithEvents TxtOldUsername As System.Windows.Forms.TextBox
Friend WithEvents TxtNewUsername As System.Windows.Forms.TextBox
Friend WithEvents LblOldUsername As System.Windows.Forms.Label
Friend WithEvents LblNewUsername As System.Windows.Forms.Label
End Class
FormChangePassword;
Screenshot;
Form Code;
Imports MySql.Data.MySqlClient
Public Class FormChangePassword
Private Sub BtnChange_Click(sender As Object, e As EventArgs) Handles BtnChange.Click
'runs when change button is clicked by user
Dim Query As String = ""
Dim DatabaseName As String = ""
Dim ServerIP As String = ""
Query = "UPDATE tbl_LoginInfo SET Password = '" & TxtNewPassword.Text & "'WHERE
Password = '" & TxtOldPassword.Text & "'"
'updates the new password
Designer Code;
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class FormChangePassword
Inherits System.Windows.Forms.Form
'
'LblNewPassword
'
Me.LblNewPassword.AutoSize = True
Me.LblNewPassword.Location = New System.Drawing.Point(85, 123)
Me.LblNewPassword.Name = "LblNewPassword"
Me.LblNewPassword.Size = New System.Drawing.Size(81, 13)
Me.LblNewPassword.TabIndex = 15
Me.LblNewPassword.Text = "New Password:"
'
'LblOldPassword
'
Me.LblOldPassword.AutoSize = True
Me.LblOldPassword.Location = New System.Drawing.Point(85, 74)
Me.LblOldPassword.Name = "LblOldPassword"
Me.LblOldPassword.Size = New System.Drawing.Size(75, 13)
Me.LblOldPassword.TabIndex = 14
Me.LblOldPassword.Text = "Old Password:"
'
'TxtNewPassword
'
Me.TxtNewPassword.Location = New System.Drawing.Point(88, 139)
Me.TxtNewPassword.Name = "TxtNewPassword"
Me.TxtNewPassword.Size = New System.Drawing.Size(165, 20)
Me.TxtNewPassword.TabIndex = 13
Me.TxtNewPassword.UseSystemPasswordChar = True
'
'TxtOldPassword
'
Me.TxtOldPassword.Location = New System.Drawing.Point(88, 90)
Me.TxtOldPassword.Name = "TxtOldPassword"
Me.TxtOldPassword.Size = New System.Drawing.Size(165, 20)
Me.TxtOldPassword.TabIndex = 12
Me.TxtOldPassword.UseSystemPasswordChar = True
'
'ImgBunnies
'
Me.ImgBunnies.Image = CType(resources.GetObject("ImgBunnies.Image"),
System.Drawing.Image)
Me.ImgBunnies.Location = New System.Drawing.Point(0, -2)
Me.ImgBunnies.Name = "ImgBunnies"
Me.ImgBunnies.Size = New System.Drawing.Size(102, 65)
Me.ImgBunnies.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.ImgBunnies.TabIndex = 11
Me.ImgBunnies.TabStop = False
'
'BtnChange
'
Me.BtnChange.Location = New System.Drawing.Point(117, 187)
Me.BtnChange.Name = "BtnChange"
Me.BtnChange.Size = New System.Drawing.Size(75, 23)
Me.BtnChange.TabIndex = 10
Me.BtnChange.Text = "Change"
Me.BtnChange.UseVisualStyleBackColor = True
'
'FormChangePassword
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(336, 214)
Me.Controls.Add(Me.LblNewPassword)
Me.Controls.Add(Me.LblOldPassword)
Me.Controls.Add(Me.TxtNewPassword)
Me.Controls.Add(Me.TxtOldPassword)
Me.Controls.Add(Me.ImgBunnies)
Me.Controls.Add(Me.BtnChange)
Me.Name = "FormChangePassword"
Me.Text = "FormChangePassword"
CType(Me.ImgBunnies, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents LblNewPassword As System.Windows.Forms.Label
Friend WithEvents LblOldPassword As System.Windows.Forms.Label
Friend WithEvents TxtNewPassword As System.Windows.Forms.TextBox
Friend WithEvents TxtOldPassword As System.Windows.Forms.TextBox
Friend WithEvents ImgBunnies As System.Windows.Forms.PictureBox
Friend WithEvents BtnChange As System.Windows.Forms.Button
End Class
FormCreateBill;
Screenshot;
Form Code;
Imports MySql.Data.MySqlClient
Public Class FormCreateBill
Dim Connect As New MySqlConnection
Dim Query As String
Dim READER As MySqlDataReader
Dim COMMAND As MySqlCommand
Dim ServerIP As String
Dim ServerUsername As String
Dim ServerPassword As String
Dim DatabaseName As String
'variables
While READER.Read
ComBoxForename.Items.Add(READER("Forename"))
'populares the combobox
End While
READER.Close()
COMMAND.Dispose()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
Try
Connect.Open()
While READER.Read
ComBoxSurname.Items.Add(READER("Surname"))
'populares the combobox
End While
READER.Close()
COMMAND.Dispose()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
Connect.Close()
End Sub
'if government funding is true the 1/4 of the total amount to pay is removed
Else
TxtAmountToPay.Text = TotalAmountToPay.Text
'if there is no government funding then parent must pay total amount
End If
End Sub
Try
Connect.Open()
Query = "SELECT ChildID, Forename, Surname from tbl_ChildInfo where Name ='" &
ComBoxForename.Text & ComBoxSurname.Text & "'"
COMMAND = New MySqlCommand(Query, Connect)
READER = COMMAND.ExecuteReader()
'selects the information from database related to selected child
'so it can be displayed to user
While READER.Read()
ComBoxForename.Text = READER("Forename")
ComBoxSurname.Text = READER("Surname")
End While
READER.Close()
COMMAND.Dispose()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
'reads in info and assigns it to textboxes
End Sub
End Class
Designer Code;
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class FormCreateBill
Inherits System.Windows.Forms.Form
End Sub
'BtnEmail
'
Me.BtnEmail.Location = New System.Drawing.Point(58, 384)
Me.BtnEmail.Name = "BtnEmail"
Me.BtnEmail.Size = New System.Drawing.Size(94, 23)
Me.BtnEmail.TabIndex = 14
Me.BtnEmail.Text = "Email"
Me.BtnEmail.UseVisualStyleBackColor = True
'
'BtnPrint
'
Me.BtnPrint.Location = New System.Drawing.Point(249, 384)
Me.BtnPrint.Name = "BtnPrint"
Me.BtnPrint.Size = New System.Drawing.Size(105, 23)
Me.BtnPrint.TabIndex = 15
Me.BtnPrint.Text = "Print and Post"
Me.BtnPrint.UseVisualStyleBackColor = True
'
'TxtHoursAttended
'
Me.TxtHoursAttended.Location = New System.Drawing.Point(76, 227)
Me.TxtHoursAttended.Name = "TxtHoursAttended"
Me.TxtHoursAttended.Size = New System.Drawing.Size(100, 20)
Me.TxtHoursAttended.TabIndex = 18
'
'TxtParentForename
'
Me.TxtParentForename.Location = New System.Drawing.Point(76, 306)
Me.TxtParentForename.Name = "TxtParentForename"
Me.TxtParentForename.Size = New System.Drawing.Size(121, 20)
Me.TxtParentForename.TabIndex = 19
'
'TxtParentSurname
'
Me.TxtParentSurname.Location = New System.Drawing.Point(225, 306)
Me.TxtParentSurname.Name = "TxtParentSurname"
Me.TxtParentSurname.Size = New System.Drawing.Size(121, 20)
Me.TxtParentSurname.TabIndex = 20
'
'TxtAmountToPay
'
Me.TxtAmountToPay.Location = New System.Drawing.Point(196, 340)
Me.TxtAmountToPay.Name = "TxtAmountToPay"
Me.TxtAmountToPay.Size = New System.Drawing.Size(100, 20)
Me.TxtAmountToPay.TabIndex = 21
'
'RadBtnYes
'
Me.RadBtnYes.AutoSize = True
Me.RadBtnYes.Location = New System.Drawing.Point(229, 228)
Me.RadBtnYes.Name = "RadBtnYes"
Me.Controls.Add(Me.LblParentSurname)
Me.Controls.Add(Me.LblParentForename)
Me.Controls.Add(Me.LblParent)
Me.Controls.Add(Me.BtnSearch)
Me.Controls.Add(Me.LblChildSurname)
Me.Controls.Add(Me.LblChildForename)
Me.Controls.Add(Me.LblChild)
Me.Controls.Add(Me.LblCreateBill)
Me.Controls.Add(Me.ImgBunnies)
Me.Name = "FormCreateBill"
Me.Text = "FormCreateBill"
CType(Me.ImgBunnies, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents ImgBunnies As System.Windows.Forms.PictureBox
Friend WithEvents LblCreateBill As System.Windows.Forms.Label
Friend WithEvents LblChild As System.Windows.Forms.Label
Friend WithEvents LblChildForename As System.Windows.Forms.Label
Friend WithEvents LblChildSurname As System.Windows.Forms.Label
Friend WithEvents BtnSearch As System.Windows.Forms.Button
Friend WithEvents LblParent As System.Windows.Forms.Label
Friend WithEvents LblParentForename As System.Windows.Forms.Label
Friend WithEvents LblParentSurname As System.Windows.Forms.Label
Friend WithEvents LblHoursAttended As System.Windows.Forms.Label
Friend WithEvents LblGvnmtFunding As System.Windows.Forms.Label
Friend WithEvents LblAmountToPay As System.Windows.Forms.Label
Friend WithEvents BtnEmail As System.Windows.Forms.Button
Friend WithEvents BtnPrint As System.Windows.Forms.Button
Friend WithEvents TxtHoursAttended As System.Windows.Forms.TextBox
Friend WithEvents TxtParentForename As System.Windows.Forms.TextBox
Friend WithEvents TxtParentSurname As System.Windows.Forms.TextBox
Friend WithEvents TxtAmountToPay As System.Windows.Forms.TextBox
Friend WithEvents RadBtnYes As System.Windows.Forms.RadioButton
Friend WithEvents RadBtnNo As System.Windows.Forms.RadioButton
Friend WithEvents ComBoxForename As System.Windows.Forms.ComboBox
Friend WithEvents ComBoxSurname As System.Windows.Forms.ComboBox
End Class
I have completed this objective by creating forms that allow the user to input the information
they need in order to create a new record for either a child or a staff member. The boxes and
buttons are clearly labelled which would help to reduce confusion and allow users to
complete the task with ease.
Evidence;
I have completed this objective by creating forms that allow the user to input the information
they need in order to edit an existing record for either a child or a staff member. The boxes
and buttons are clearly labelled which would help to reduce confusion and allow users to
complete the task with ease.
Evidence;
I have completed this objective by creating forms that allow the user to input the information
they need in order to delete an existing record for either a child or a staff member. The boxes
and buttons are clearly labelled which would help to reduce confusion and allow users to
complete the task with ease.
Evidence;
I have completed this objective by designing and including a login screen which requires
users to enter their username and password. This will help to make the program more
secure and unauthorised people should not be able to get past this if the users keep their
usernames and passwords secure.
Evidence;
I have completed this objective by ensuring that each of forms has a user interface that is
simple and easy to understand. I also made sure that this was consistent throughout my
project so that the user would be able to navigate the program efficiently and have a sense of
familiarity with each form they use.
Evidence;
I feel that I achieved this objective by having the calculations that need to be done written into
the code. This means that each time a calculation is performed, the program will perform the
same calculation with whatever variable value has been entered. I also aimed to improve the
integrity and accuracy of my databases by including verification methods, such as making
sure important fields are ‘not null’.
Evidence;
Query = "CREATE TABLE tbl_Login ( Username VARCHAR(25) NOT NULL PRIMARY KEY,
Password VARCHAR(35) NOT NULL, StaffID(10) NOT NULL, Admin BIT(1) NOT NULL )"
‘Section of code from ModuleGlobal that creates a table and uses the verification method ‘NOT NULL’
I have achieved this objective by writing the calculations into the code. As the computer will
have to perform them, this means that the outcomes will be returned almost instantly. I have
also ensured that the interface allows the user to know the results of any calculations.
Evidence;
I have achieved this by creating a simplistic UI which is easy to navigate through. Each of
the buttons are clearly labelled and allow the user to move from one form to the next. For
example, the ‘Records’ button shown in the image below would allow the user to open the
form that deals with the records.
Evidence;
I have completed this objective by designing a login form as well as forms that allow the user
to change their username and password. This means that the user can regularly change
their username and password to help improve the security of the system. Having a logon
screen means that only authorised people can access the program.
Evidence;