You are on page 1of 115

Amara Maiden

Technical
Solution

Playgroup System - Technical Solution


Amara Maiden

Technical Solution - Code

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

Public Sub CreateTables()


'subroutine is called when program is started up by user, used to setup database
Dim DatabaseName As String = ""
Dim ServerIP As String = ""
Dim ServerUsername As String = ""
Dim ServerPassword As String = ""

GetDatabaseInformation(ServerIP, ServerUsername, ServerPassword, DatabaseName)


'calls subroutine
If Not Connect Is Nothing Then Connect.Close()
'checks to see whether there is any existing database connections
'if there is then they are closed
Connect.ConnectionString = String.Format("Server={0}; StaffID={1}; Password={2};
Database={3}; pooling=false", ServerIP, ServerUsername, ServerPassword, DatabaseName)
'sets the format of the connection string
Try
Connect.Open()
'opens database connection
MessageBox.Show("Connection established, the tables will now be created.", "Connection has
been made.", MessageBoxButtons.OK)

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 = "INSERT INTO tbl_Login ( Username, Password, StaffID, Admin ) VALUES (


'Username' , '" & "' Password', 'Staff01', 1 )"

Playgroup System - Technical Solution


Amara Maiden

COMMAND = New MySqlCommand(Query, Connect)


COMMAND.ExecuteNonQuery()
COMMAND.Dispose()
'inserts test/default values into 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 = "INSERT INTO tbl_StaffInfo ( StaffID, Forename, Surname, Position ) VALUES (


'Staff01', 'John', 'Smith', 'Test' )"
COMMAND = New MySqlCommand(Query, Connect)
COMMAND.ExecuteNonQuery()
COMMAND.Dispose()
'inserts test/default values into the 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

Query = "INSERT INTO tbl_ChildInfo (ChildID, Forename, Surname, ChildMedicalNeeds,


MedicineNeeded) VALUES ( 'ChildO1' , 'Sarah', 'Smith', 'Asthma', 'Inhaler' ) "
COMMAND = New MySqlCommand(Query, Connect)
COMMAND.ExecuteNonQuery()
COMMAND.Dispose()
'inserts test/default values into the child info table

Query = "CREATE TABLE tbl_PaymentInfo (HoursAttended SINGLE(00.0),


GvmntFundingEligibility BIT(1), TotalToPay CURRENCY(000.00), AmountCoveredByGvmnt
CURRENCY(000.00), AmountToPayByParent CURRENCY(000.00) ) "
COMMAND = New MySqlCommand(Query, Connect)
COMMAND.ExecuteNonQuery()
COMMAND.Dispose()
'inserts test/default values into the child info table

Query = "INSERT INTO tbl_PaymentInfo (HoursAttended, GvmntFundingEligibility,


TotalToPay, AmountCoveredByGvmnt, AmountToPayByParent) VALUES ( 15.5, 1, 450.00, 200.00,
250.00 )"
COMMAND = New MySqlCommand(Query, Connect)
COMMAND.ExecuteNonQuery()
COMMAND.Dispose()
'inserts test/default values into the payment info table

Playgroup System - Technical Solution


Amara Maiden

Query = "CREATE TABLE tbl_BillingInfo ( ParentForename VARCHAR(25) ,


ParentSurname VARCHAR(35) , ContactNumber VARCHAR(11), ParentAddress VARCHAR (70),
ParentEmail VARCHAR(40) ) "
COMMAND = New MySqlCommand(Query, Connect)
COMMAND.ExecuteNonQuery()
COMMAND.Dispose()
'inserts test/default values into the billing info table

Query = "INSERT INTO tbl_BillingInfo ( ParentForename, ParentSurname, ContactNumber,


ParentAddress, ParentEmail ) VALUES ( 'John', 'Smith', '12345678912', '21 Testroad, Testown, TE12
ST9', 'johnsmith@test.com' )"
COMMAND = New MySqlCommand(Query, Connect)
COMMAND.ExecuteNonQuery()
COMMAND.Dispose()
'inserts test/default values into the billing info table

Connect.Close()
'closes connection to the database

Messagebox.Show("Database Created.", "Database.", MessageBoxButtons.OK)


Catch ex As Exception
'exception handlers user to stop the program from crashing

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

Public Sub GetDatabaseInformation(ByRef ServerIP As String, ByRef ServerUsername As String,


ByRef ServerPassword As String, ByRef DatabaseName As String)
'gets and assigns the database connection string information
Using StreamReader As StreamReader = New StreamReader
ServerIP = StreamReader.ReadLine()
DatabaseName = StreamReader.ReadLine()
ServerUsername = StreamReader.ReadLine()
ServerPassword = StreamReader.ReadLine()
End Using
End Sub

End Module

Playgroup System - Technical Solution


Amara Maiden

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

Private Sub FormLogin_Load(sender As Object, e As EventArgs) Handles MyBase.Load


'this subroutine runs when the form first loads
TxtUsername.Focus()
'makes the username textbox the focus
Dim Setup As Boolean
Dim Query As String
Dim COMMAND As MySqlCommand
Dim Tables As Integer
'Declares the variables that will be needed for the initial SQL query
'checks whether the database has been set up

Playgroup System - Technical Solution


Amara Maiden

ModuleGlobal.GetDatabaseInformation(ServerIp, ServerUsername, ServerPassword,


DatabaseName)
'gets info for database connection
If ServerIp = "" And ServerPassword = "" And ServerUsername = "" And DatabaseName = ""
Then
'checks to see whether the variables for database connection have been set
'if they have not then the database information form is displayed
'so user can input correct info
MessageBox.Show("Database information not found, please enter the right information",
"Database settings error", MessageBoxButtons.OK)
FormDbInfo.ShowDialog()
End If

If Not Connect Is Nothing Then Connect.Close()


Connect.ConnectionString = String.Format("server = {0}; user id = {1}; password = {2}; database
= {3}; pooling = false", ServerIp, ServerUsername, ServerPassword, DatabaseName)
Try
Connect.Open()
'opens the connection to the database

Query = "select count(*) from information_schema.tables where table_type = 'BASE TABLE'


and table_schema = '" & DatabaseName & "';"
COMMAND = New MySqlCommand(Query, Connect)
Tables = COMMAND.ExecuteScalar
'sets query to check for tables in database

If Tables > 0 Then


Setup = True
Else
Setup = False
End If
'if no tables are found then value of setup is set to true
Catch ex As Exception
MessageBox.Show(ex.Message)
Setup = False
FormDbInfo.ShowDialog()
End Try
'the exception handler is used to show an error message to the user
'as well as database connection info form
'if query fails
Connect.Close()
'closes the connection

If Setup = False Then


'takes correct action due to value assigned to setup
Dim Result = MessageBox.Show("The database has not been setup, would you like to run the
installation process?", "Create the database?", MessageBoxButtons.YesNo)
'asks the user if they want to set up a new database tables
If Result = Windows.Forms.DialogResult.Yes Then
ModuleGlobal.CreateTables()
Else

Playgroup System - Technical Solution


Amara Maiden

'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

Private Sub BtnLogin_Click(sender As Object, e As EventArgs) Handles BtnLogin.Click


'subroutine runs when the button is clicked

Dim Username, Password As String


Dim ValidConnection As Boolean
Dim ValidCredentials As Boolean

Username = TxtUsername.Text
Password = TxtPassword.Text
ValidConnection = ValidateConnect()
'assigns the variable 'validconnection' the returned value from subroutine ValidateConnect

If ValidConnection = True Then


ValidCredentials = VerifyLogin(Username, Password)
'assigns the returned value from the verifylogin subroutine to the validcredentials variable
Else

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

If ValidCredentials = True Then


'happens if user enters correct username and password
TxtUsername.Text = ""
TxtPassword.Text = ""
FormMainMenu.LoggedInUser = Username
TxtUsername.Focus()
Hide()
FormMainMenu.Show()
'resets textbox contents so that someone cannot get into the system too easily

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

Playgroup System - Technical Solution


Amara Maiden

Public Function ValidateConnect()


'runs when called
'tests connection to database server, returns value based on whether successful or not
Dim ValidConnection As Boolean
ModuleGlobal.GetDatabaseInformation(ServerIp, ServerUsername, ServerPassword,
DatabaseName)
If Not Connect Is Nothing Then Connect.Close()
Connect.ConnectionString = String.Format("server = {0}; user id = {1}; password = {2}; database
= {3}; pooling = false", ServerIp, ServerUsername, ServerPassword, DatabaseName)
'formats database info
Try
Connect.Open()
'tries to connect to database server
ValidConnection = True
Catch ex As Exception
MessageBox.Show(ex.Message)
ValidConnection = False
'if cannot connect then message is shown
End Try
Connect.Close()
'closes connection
End Function

Public Function VerifyLogin(ByVal Username As String, ByVal Password As String)


'function runs when it is called
'tests to see whether username and password entered are correct
'boolean value states whether it has been successful or not
Dim LoginSuccess As Boolean
Dim Query As String
Dim COMMAND As MySqlCommand
Dim READER As MySqlReader
Dim CheckPassword As String = ""

If Not Connect Is Nothing Then Connect.Close()


Connect.ConnectionString = String.Format("server = {0}; user id = {1}; password = {2}; database
= {3}; pooling = false", ServerIp, ServerUsername, ServerPassword, DatabaseName)
Try
Connect.Open()
Query = "SELECT Password FROM tbl_LoginInfo WHERE Username = '" & Username & "'"
COMMAND = New MySqlCommand(Query, Connect)
READER = COMMAND.ExecuteReader

Do While READER.Read
CheckPassword = READER("Password")
'assigns the password string to the CheckPassword variable
Loop

If CheckPassword = UseCipher(TxtPassword.Text) Then


LoginSuccess = True
'this compares the value in the database to the value in the textbox

Playgroup System - Technical Solution


Amara Maiden

'if they're the same then login is successful


End If

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

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


BtnDatabaseInfo.Click
'subroutine runs when database info button is clicked
FormDbInfo.ShowDialog()
End Sub
End Class

Designer Code;

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class FormLogin
Inherits System.Windows.Forms.Form

'Form overrides dispose to clean up the component list.


<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

'Required by the Windows Form Designer


Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer


'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New
System.ComponentModel.ComponentResourceManager(GetType(FormLogin))
Me.ImgLogo = New System.Windows.Forms.PictureBox()
Me.LblLogin = New System.Windows.Forms.Label()
Me.LblUsername = New System.Windows.Forms.Label()
Me.LblPassword = New System.Windows.Forms.Label()

Playgroup System - Technical Solution


Amara Maiden

Me.TxtUsername = New System.Windows.Forms.TextBox()


Me.TxtPassword = New System.Windows.Forms.TextBox()
Me.BtnLogin = New System.Windows.Forms.Button()
Me.BtnDatabaseInfo = New System.Windows.Forms.Button()
CType(Me.ImgLogo, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'ImgLogo
'
Me.ImgLogo.Image = CType(resources.GetObject("ImgLogo.Image"), System.Drawing.Image)
Me.ImgLogo.Location = New System.Drawing.Point(39, -2)
Me.ImgLogo.Name = "ImgLogo"
Me.ImgLogo.Size = New System.Drawing.Size(283, 126)
Me.ImgLogo.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.ImgLogo.TabIndex = 1
Me.ImgLogo.TabStop = False
'
'LblLogin
'
Me.LblLogin.AutoSize = True
Me.LblLogin.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!,
System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.LblLogin.Location = New System.Drawing.Point(93, 136)
Me.LblLogin.Name = "LblLogin"
Me.LblLogin.Size = New System.Drawing.Size(193, 20)
Me.LblLogin.TabIndex = 2
Me.LblLogin.Text = "Please login to continue... "
'
'LblUsername
'
Me.LblUsername.AutoSize = True
Me.LblUsername.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!,
System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.LblUsername.Location = New System.Drawing.Point(45, 176)
Me.LblUsername.Name = "LblUsername"
Me.LblUsername.Size = New System.Drawing.Size(77, 16)
Me.LblUsername.TabIndex = 3
Me.LblUsername.Text = "Username: "
'
'LblPassword
'
Me.LblPassword.AutoSize = True
Me.LblPassword.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!,
System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.LblPassword.Location = New System.Drawing.Point(48, 212)
Me.LblPassword.Name = "LblPassword"
Me.LblPassword.Size = New System.Drawing.Size(74, 16)
Me.LblPassword.TabIndex = 4
Me.LblPassword.Text = "Password: "
'
'TxtUsername

Playgroup System - Technical Solution


Amara Maiden

'
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)

Playgroup System - Technical Solution


Amara Maiden

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

Playgroup System - Technical Solution


Amara Maiden

FormDbInfo;

Screenshot;

Form Code;
Imports System.IO
Imports MySql.Data.MySqlClient
Public Class FormDbInfo

Private Sub BtnConfirm_Click(sender As Object, e As EventArgs) Handles BtnConfirm.Click


'runs when confirm button is pressed by the user
'assigns text from text boxes to variables
Dim Connect As New MySqlConnection
Dim ValidConnection As Boolean = Connect(TxtServerIP.Text, TxtDatabaseName.Text,
TxtUsername.Text, TxtPassword.Text)
If ValidConnection = True Then
Using StreamWriter As StreamWriter = New StreamWriter
StreamWriter.WriteLine(TxtServerIP.Text)
StreamWriter.WriteLine(TxtDatabaseName.Text)
StreamWriter.WriteLine(TxtPassword.Text)
End Using

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

Playgroup System - Technical Solution


Amara Maiden

Public Function Connect(ByVal ServerIP As String, ByVal DatabaseName As String, ByVal


ServerUsername As String, ByVal ServerPassword As String)
'this function runs when it is called
'tests the connection to the database server and returns a boolean value
Dim ValidConnection As Boolean
If Not Connect Is Nothing Then Connect.Close()
Connect.ConnectionString = String.Format("Server={0}; StaffID={1}; Password={2};
Database={3}; pooling=false", ServerIP, ServerUsername, ServerPassword, DatabaseName)
'sets the format of the connection string

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

'Form overrides dispose to clean up the component list.


<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

'Required by the Windows Form Designer


Private component As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer


'It can be modified using the Windows Form Designer.

Playgroup System - Technical Solution


Amara Maiden

'Do not modify it using the code editor.


<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New
System.ComponentModel.ComponentResourceManager(GetType(FormDbInfo))
Me.PictureBox1 = New System.Windows.Forms.PictureBox()
Me.LblDbConnectionInfo = New System.Windows.Forms.Label()
Me.LblServerIP = New System.Windows.Forms.Label()
Me.LblDatabaseName = New System.Windows.Forms.Label()
Me.LblUsername = New System.Windows.Forms.Label()
Me.LblPassword = New System.Windows.Forms.Label()
Me.TxtServerIP = New System.Windows.Forms.TextBox()
Me.TxtDatabaseName = New System.Windows.Forms.TextBox()
Me.TxtUsername = New System.Windows.Forms.TextBox()
Me.TxtPassword = New System.Windows.Forms.TextBox()
Me.BtnConfirm = New System.Windows.Forms.Button()
CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'PictureBox1
'
Me.PictureBox1.Image = CType(resources.GetObject("PictureBox1.Image"),
System.Drawing.Image)
Me.PictureBox1.Location = New System.Drawing.Point(0, -1)
Me.PictureBox1.Name = "PictureBox1"
Me.PictureBox1.Size = New System.Drawing.Size(101, 60)
Me.PictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.PictureBox1.TabIndex = 12
Me.PictureBox1.TabStop = False
'
'LblDbConnectionInfo
'
Me.LblDbConnectionInfo.AutoSize = True
Me.LblDbConnectionInfo.Font = New System.Drawing.Font("Microsoft Sans Serif", 11.25!,
System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.LblDbConnectionInfo.Location = New System.Drawing.Point(52, 72)
Me.LblDbConnectionInfo.Name = "LblDbConnectionInfo"
Me.LblDbConnectionInfo.Size = New System.Drawing.Size(229, 18)
Me.LblDbConnectionInfo.TabIndex = 13
Me.LblDbConnectionInfo.Text = "Database Connection Information"
'
'LblServerIP
'
Me.LblServerIP.AutoSize = True
Me.LblServerIP.Location = New System.Drawing.Point(23, 116)
Me.LblServerIP.Name = "LblServerIP"
Me.LblServerIP.Size = New System.Drawing.Size(57, 13)
Me.LblServerIP.TabIndex = 14
Me.LblServerIP.Text = "Server IP: "
'
'LblDatabaseName

Playgroup System - Technical Solution


Amara Maiden

'
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"

Playgroup System - Technical Solution


Amara Maiden

Me.TxtPassword.Size = New System.Drawing.Size(244, 20)


Me.TxtPassword.TabIndex = 21
'
'BtnConfirm
'
Me.BtnConfirm.Location = New System.Drawing.Point(206, 291)
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
'
'FormDbInfo
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(321, 335)
Me.Controls.Add(Me.BtnConfirm)
Me.Controls.Add(Me.TxtPassword)
Me.Controls.Add(Me.TxtUsername)
Me.Controls.Add(Me.TxtDatabaseName)
Me.Controls.Add(Me.TxtServerIP)
Me.Controls.Add(Me.LblPassword)
Me.Controls.Add(Me.LblUsername)
Me.Controls.Add(Me.LblDatabaseName)
Me.Controls.Add(Me.LblServerIP)
Me.Controls.Add(Me.LblDbConnectionInfo)
Me.Controls.Add(Me.PictureBox1)
Me.Name = "FormDbInfo"
Me.Text = "Database Info"
CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()

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

Playgroup System - Technical Solution


Amara Maiden

FormMainMenu;

Screenshot;

Form Code;
Public Class FormMainMenu

Public LoggedInUser As String


'public variable

Private Sub FormMainMenu_Load(sender As Object, e As EventArgs) Handles MyBase.Load


'subroutine runs when form is launched
LblUser.Text = "Welcome, " & LoggedInUser & "."
'assigns the value of logged in user to label text
End Sub

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


Me.FormClosing
'this subroutines function is to close the form
FormLogin.Show()
'shows login form
End Sub

Private Sub BtnSettings_Click(sender As Object, e As EventArgs) Handles BtnSettings.Click


'runs when settings button is clicked
FormSettings.Show()

Playgroup System - Technical Solution


Amara Maiden

End Sub

Private Sub BtnRecords_Click(Sender As Object, e As EventArgs) Handles BtnRecords.Click


'runs when record option is chosen from main menu
Hide()
FormRecords.Show()
End Sub

Private Sub BtnCreateBill_Click(sender As Object, e As EventArgs)


'runs when create bill button is clicked
Hide()
FormCreateBill.Show()
End Sub
End Class

Designer Code;
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class FormMainMenu
Inherits System.Windows.Forms.Form

'Form overrides dispose to clean up the component list.


<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

'Required by the Windows Form Designer


Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer


'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New
System.ComponentModel.ComponentResourceManager(GetType(FormMainMenu))
Me.LblWelcome = New System.Windows.Forms.Label()
Me.ImgBunnies = New System.Windows.Forms.PictureBox()
Me.BtnRecords = New System.Windows.Forms.Button()
Me.BtnQuit = New System.Windows.Forms.Button()
Me.LblInfo1 = New System.Windows.Forms.Label()
Me.LblUser = New System.Windows.Forms.Label()
Me.BtnSettings = New System.Windows.Forms.Button()
Me.LblInfo2 = New System.Windows.Forms.Label()
Me.LblCreateBill = New System.Windows.Forms.Label()

Playgroup System - Technical Solution


Amara Maiden

Me.BtnCreateBill = New System.Windows.Forms.Button()


CType(Me.ImgBunnies, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'LblWelcome
'
Me.LblWelcome.AutoSize = True
Me.LblWelcome.Font = New System.Drawing.Font("Microsoft Sans Serif", 14.25!,
System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.LblWelcome.Location = New System.Drawing.Point(91, 111)
Me.LblWelcome.Name = "LblWelcome"
Me.LblWelcome.Size = New System.Drawing.Size(247, 24)
Me.LblWelcome.TabIndex = 0
Me.LblWelcome.Text = "Welcome to the main menu!"
'
'ImgBunnies
'
Me.ImgBunnies.Image = CType(resources.GetObject("ImgBunnies.Image"),
System.Drawing.Image)
Me.ImgBunnies.Location = New System.Drawing.Point(-1, -4)
Me.ImgBunnies.Name = "ImgBunnies"
Me.ImgBunnies.Size = New System.Drawing.Size(133, 89)
Me.ImgBunnies.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.ImgBunnies.TabIndex = 1
Me.ImgBunnies.TabStop = False
'
'BtnRecords
'
Me.BtnRecords.Location = New System.Drawing.Point(136, 138)
Me.BtnRecords.Name = "BtnRecords"
Me.BtnRecords.Size = New System.Drawing.Size(130, 37)
Me.BtnRecords.TabIndex = 2
Me.BtnRecords.Text = "Records"
Me.BtnRecords.UseVisualStyleBackColor = True
'
'BtnQuit
'
Me.BtnQuit.Location = New System.Drawing.Point(305, 337)
Me.BtnQuit.Name = "BtnQuit"
Me.BtnQuit.Size = New System.Drawing.Size(75, 23)
Me.BtnQuit.TabIndex = 5
Me.BtnQuit.Text = "Quit"
Me.BtnQuit.UseVisualStyleBackColor = True
'
'LblInfo1
'
Me.LblInfo1.AutoSize = True
Me.LblInfo1.Location = New System.Drawing.Point(120, 178)
Me.LblInfo1.Name = "LblInfo1"
Me.LblInfo1.Size = New System.Drawing.Size(155, 13)
Me.LblInfo1.TabIndex = 6

Playgroup System - Technical Solution


Amara Maiden

Me.LblInfo1.Text = "(Add, edit and remove records) "


'
'LblUser
'
Me.LblUser.AutoSize = True
Me.LblUser.Location = New System.Drawing.Point(155, 86)
Me.LblUser.Name = "LblUser"
Me.LblUser.Size = New System.Drawing.Size(58, 13)
Me.LblUser.TabIndex = 7
Me.LblUser.Text = "Welcome, "
'
'BtnSettings
'
Me.BtnSettings.Location = New System.Drawing.Point(136, 279)
Me.BtnSettings.Name = "BtnSettings"
Me.BtnSettings.Size = New System.Drawing.Size(129, 37)
Me.BtnSettings.TabIndex = 8
Me.BtnSettings.Text = "Settings"
Me.BtnSettings.UseVisualStyleBackColor = True
'
'LblInfo2
'
Me.LblInfo2.AutoSize = True
Me.LblInfo2.Location = New System.Drawing.Point(103, 319)
Me.LblInfo2.Name = "LblInfo2"
Me.LblInfo2.Size = New System.Drawing.Size(191, 13)
Me.LblInfo2.TabIndex = 9
Me.LblInfo2.Text = "(Change your username and password)"
'
'LblCreateBill
'
Me.LblCreateBill.AutoSize = True
Me.LblCreateBill.Location = New System.Drawing.Point(103, 249)
Me.LblCreateBill.Name = "LblCreateBill"
Me.LblCreateBill.Size = New System.Drawing.Size(201, 13)
Me.LblCreateBill.TabIndex = 11
Me.LblCreateBill.Text = "(Create a bill to send to the child's parent)"
'
'BtnCreateBill
'
Me.BtnCreateBill.Location = New System.Drawing.Point(136, 209)
Me.BtnCreateBill.Name = "BtnCreateBill"
Me.BtnCreateBill.Size = New System.Drawing.Size(129, 37)
Me.BtnCreateBill.TabIndex = 10
Me.BtnCreateBill.Text = "Create Bill"
Me.BtnCreateBill.UseVisualStyleBackColor = True
'
'FormMainMenu
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font

Playgroup System - Technical Solution


Amara Maiden

Me.ClientSize = New System.Drawing.Size(404, 384)


Me.Controls.Add(Me.LblCreateBill)
Me.Controls.Add(Me.BtnCreateBill)
Me.Controls.Add(Me.LblInfo2)
Me.Controls.Add(Me.BtnSettings)
Me.Controls.Add(Me.LblUser)
Me.Controls.Add(Me.LblInfo1)
Me.Controls.Add(Me.BtnQuit)
Me.Controls.Add(Me.BtnRecords)
Me.Controls.Add(Me.ImgBunnies)
Me.Controls.Add(Me.LblWelcome)
Me.Name = "FormMainMenu"
Me.Text = "Main Menu "
CType(Me.ImgBunnies, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()

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

Playgroup System - Technical Solution


Amara Maiden

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

Playgroup System - Technical Solution


Amara Maiden

'runs when remove staff member button is clicked


Hide()
FormRemoveStaffMember.Show()
End Sub
Private Sub BtnRemoveChild_Click(sender As Object, e As EventArgs) Handles
BtnRemoveChild.Click
'rumns when remove child record button is clicked
Hide()
FormRemoveChildRecord.Show()
End Sub
End Class

Designer Code;
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class FormRecords
Inherits System.Windows.Forms.Form

'Form overrides dispose to clean up the component list.


<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

'Required by the Windows Form Designer


Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer


'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New
System.ComponentModel.ComponentResourceManager(GetType(FormRecords))
Me.Lbl_Records = New System.Windows.Forms.Label()
Me.ImgBunnies = New System.Windows.Forms.PictureBox()
Me.BtnExit = New System.Windows.Forms.Button()
Me.BtnAddNewChild = New System.Windows.Forms.Button()
Me.BtnAddNewStaffMember = New System.Windows.Forms.Button()
Me.BtnEditChild = New System.Windows.Forms.Button()
Me.BtnEditStaffMember = New System.Windows.Forms.Button()
Me.BtnRemoveChild = New System.Windows.Forms.Button()
Me.BtnRemoveStaffMember = New System.Windows.Forms.Button()
CType(Me.ImgBunnies, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'

Playgroup System - Technical Solution


Amara Maiden

'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
'

Playgroup System - Technical Solution


Amara Maiden

Me.BtnEditChild.Location = New System.Drawing.Point(130, 166)


Me.BtnEditChild.Name = "BtnEditChild"
Me.BtnEditChild.Size = New System.Drawing.Size(108, 23)
Me.BtnEditChild.TabIndex = 10
Me.BtnEditChild.Text = "Edit Child"
Me.BtnEditChild.UseVisualStyleBackColor = True
'
'BtnEditStaffMember
'
Me.BtnEditStaffMember.Location = New System.Drawing.Point(115, 137)
Me.BtnEditStaffMember.Name = "BtnEditStaffMember"
Me.BtnEditStaffMember.Size = New System.Drawing.Size(137, 23)
Me.BtnEditStaffMember.TabIndex = 11
Me.BtnEditStaffMember.Text = "Edit Staff Member"
Me.BtnEditStaffMember.UseVisualStyleBackColor = True
'
'BtnRemoveChild
'
Me.BtnRemoveChild.Location = New System.Drawing.Point(130, 224)
Me.BtnRemoveChild.Name = "BtnRemoveChild"
Me.BtnRemoveChild.Size = New System.Drawing.Size(108, 23)
Me.BtnRemoveChild.TabIndex = 12
Me.BtnRemoveChild.Text = "Remove Child"
Me.BtnRemoveChild.UseVisualStyleBackColor = True
'
'BtnRemoveStaffMember
'
Me.BtnRemoveStaffMember.Location = New System.Drawing.Point(115, 195)
Me.BtnRemoveStaffMember.Name = "BtnRemoveStaffMember"
Me.BtnRemoveStaffMember.Size = New System.Drawing.Size(137, 23)
Me.BtnRemoveStaffMember.TabIndex = 13
Me.BtnRemoveStaffMember.Text = "Remove Staff Member"
Me.BtnRemoveStaffMember.UseVisualStyleBackColor = True
'
'FormRecords
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(353, 318)
Me.Controls.Add(Me.BtnRemoveStaffMember)
Me.Controls.Add(Me.BtnRemoveChild)
Me.Controls.Add(Me.BtnEditStaffMember)
Me.Controls.Add(Me.BtnEditChild)
Me.Controls.Add(Me.BtnAddNewStaffMember)
Me.Controls.Add(Me.BtnAddNewChild)
Me.Controls.Add(Me.BtnExit)
Me.Controls.Add(Me.ImgBunnies)
Me.Controls.Add(Me.Lbl_Records)
Me.Name = "FormRecords"
Me.Text = "Records"
CType(Me.ImgBunnies, System.ComponentModel.ISupportInitialize).EndInit()

Playgroup System - Technical Solution


Amara Maiden

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

Playgroup System - Technical Solution


Amara Maiden

FormAddStaffMember;

Screenshot;

Form Code;
Imports MySql.Data.MySqlClient
Public Class FormAddStaffMember
'imports the required assemblies needed to create MySql Connections

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


Me.FormClosing
'subroutine runs when the form is exited,
' resets the key information in the textboxes
TxtForename.Focus()
TxtForename.Text = ""
TxtStaffID.Text = ""
TxtSurname.Text = ""
TxtPosition.Text = ""
RadBtnYes.Checked = False
RadBtnNo.Checked = False
TxtUsername.Text = ""
TxtPassword.Text = ""
End Sub

Private Sub BtnCancel_Click(sender As Object, e As EventArgs) Handles BtnCancel.Click


'runs when Cancel button clicked by user
Close()
'closes the form
End Sub

Private Sub BtnConfirm_Click(sender As Object, e As EventArgs) Handles BtnConfirm.Click


'runs when confirm button clicked by user

Playgroup System - Technical Solution


Amara Maiden

Dim Accepted As Boolean


Dim Admin As Boolean = RadBtnYes.Checked
Dim AdminChar As Char = ""
Dim QueryStaffMember As String = ""
Dim QueryLogin As String = ""
Dim DatabaseName As String = ""
Dim ServerIP As String = ""
Dim ServerUsername As String = ""
Dim ServerPassword As String = ""
Dim Connect As New MySqlConnection
Dim COMMAND As MySqlCommand
'variables

If TxtForename.Text = "" Or TxtSurname.Text = "" Or TxtStaffID.Text = "" Or TxtUsername.Text


= "" Or TxtPassword.Text = "" Then
Accepted = False
ElseIf RadBtnYes.Checked = False And RadBtnNo.Checked = False Then
Accepted = False
Else
Accepted = True
End If
'Checks to ensure that a value has been entered for all fields
'none of these fields should be left blank

If TxtPosition.Text = "" Then


QueryStaffMember = "INSERT INTO tbl_StaffInfo (StaffID, Forename, Surname) VALUES ('"
& TxtStaffID.Text & "','" & TxtForename.Text & "','" & TxtSurname.Text & ")"

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

If Admin = True Then


MessageBox.Show("In order to set up a user as an admin, the request needs to be approved
by an admin user.", "Admin Validation is Required", MessageBoxButtons.OK)
AdminChar = "1"
ElseIf Admin = False Then
MessageBox.Show("Error, admin account details incorrect. You will be returned to the Add
Staff Member Screen.", "There has been an admin validation error.", MessageBoxButtons.OK)
RadBtnYes.Checked = False
RadBtnNo.Checked = True
Exit Sub
Else
AdminChar = "0"
End If
'assigns a value to be used in SQL statement
'based on whether user is an admin or not

Playgroup System - Technical Solution


Amara Maiden

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

ModuleGlobal.GetDatabaseInformation(ServerIP, ServerUsername, ServerPassword,


DatabaseName)
If Not Connect Is Nothing Then Connect.close()
Connect.connectionstring = String.Format("Server={0}; StaffID={1}; Password={2};
Database={3}; pooling=false", ServerIP, ServerUsername, ServerPassword, DatabaseName)
'checks to see whether there is an existing database connection

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

'Form overrides dispose to clean up the component list.


<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

Playgroup System - Technical Solution


Amara Maiden

'Required by the Windows Form Designer


Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer


'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New
System.ComponentModel.ComponentResourceManager(GetType(FormAddStaffMember))
Me.ImgBunnies = New System.Windows.Forms.PictureBox()
Me.LblAddNewStaff = New System.Windows.Forms.Label()
Me.LblStaffID = New System.Windows.Forms.Label()
Me.Lbl_Forename = New System.Windows.Forms.Label()
Me.LblSurname = New System.Windows.Forms.Label()
Me.LblPosition = New System.Windows.Forms.Label()
Me.LblAdmin = New System.Windows.Forms.Label()
Me.LblUsername = New System.Windows.Forms.Label()
Me.LblPassword = New System.Windows.Forms.Label()
Me.TxtStaffID = New System.Windows.Forms.TextBox()
Me.TxtForename = New System.Windows.Forms.TextBox()
Me.TxtSurname = New System.Windows.Forms.TextBox()
Me.TxtPosition = New System.Windows.Forms.TextBox()
Me.RadBtnYes = New System.Windows.Forms.RadioButton()
Me.RadBtnNo = New System.Windows.Forms.RadioButton()
Me.TxtUsername = New System.Windows.Forms.TextBox()
Me.TxtPassword = New System.Windows.Forms.TextBox()
Me.BtnCancel = New System.Windows.Forms.Button()
Me.BtnConfirm = New System.Windows.Forms.Button()
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(2, 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 = 4
Me.ImgBunnies.TabStop = False
'
'LblAddNewStaff
'
Me.LblAddNewStaff.AutoSize = True
Me.LblAddNewStaff.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!,
System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.LblAddNewStaff.Location = New System.Drawing.Point(118, 74)
Me.LblAddNewStaff.Name = "LblAddNewStaff"
Me.LblAddNewStaff.Size = New System.Drawing.Size(174, 20)

Playgroup System - Technical Solution


Amara Maiden

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

Playgroup System - Technical Solution


Amara Maiden

Me.LblUsername.Location = New System.Drawing.Point(205, 166)


Me.LblUsername.Name = "LblUsername"
Me.LblUsername.Size = New System.Drawing.Size(58, 13)
Me.LblUsername.TabIndex = 11
Me.LblUsername.Text = "Username:"
'
'LblPassword
'
Me.LblPassword.AutoSize = True
Me.LblPassword.Location = New System.Drawing.Point(205, 205)
Me.LblPassword.Name = "LblPassword"
Me.LblPassword.Size = New System.Drawing.Size(59, 13)
Me.LblPassword.TabIndex = 12
Me.LblPassword.Text = "Password: "
'
'TxtStaffID
'
Me.TxtStaffID.Location = New System.Drawing.Point(68, 142)
Me.TxtStaffID.Name = "TxtStaffID"
Me.TxtStaffID.Size = New System.Drawing.Size(100, 20)
Me.TxtStaffID.TabIndex = 13
'
'TxtForename
'
Me.TxtForename.Location = New System.Drawing.Point(68, 182)
Me.TxtForename.Name = "TxtForename"
Me.TxtForename.Size = New System.Drawing.Size(100, 20)
Me.TxtForename.TabIndex = 14
'
'TxtSurname
'
Me.TxtSurname.Location = New System.Drawing.Point(68, 221)
Me.TxtSurname.Name = "TxtSurname"
Me.TxtSurname.Size = New System.Drawing.Size(100, 20)
Me.TxtSurname.TabIndex = 15
'
'TxtPosition
'
Me.TxtPosition.Location = New System.Drawing.Point(68, 260)
Me.TxtPosition.Name = "TxtPosition"
Me.TxtPosition.Size = New System.Drawing.Size(100, 20)
Me.TxtPosition.TabIndex = 16
'
'RadBtnYes
'
Me.RadBtnYes.AutoSize = True
Me.RadBtnYes.Location = New System.Drawing.Point(215, 142)
Me.RadBtnYes.Name = "RadBtnYes"
Me.RadBtnYes.Size = New System.Drawing.Size(43, 17)
Me.RadBtnYes.TabIndex = 17
Me.RadBtnYes.TabStop = True

Playgroup System - Technical Solution


Amara Maiden

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)

Playgroup System - Technical Solution


Amara Maiden

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

Playgroup System - Technical Solution


Amara Maiden

FormEditStaffMember;

Screenshot;

Form Code;
Imports MySql.Data.MySqlClient
Public Class FormEditStaffMember

Dim Forename As String


Dim Surname As String
Dim StaffID As String
Dim Position As String
Dim Count As Integer = 1

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


MyBase.Load
HideElement()
'calls the subroutine
TxtForename.Focus()
End Sub

Private Sub PopulateInfo(ByVal Forename As String, ByVal Surname As String)


'subroutine runs when called
Dim Admin As Boolean
Dim AdminChar As String = ""
Dim Query As String = ""
Dim DatabaseName As String = ""
Dim ServerIP As String = ""
Dim ServerUsername As String = ""
Dim ServerPassword As String = ""

Playgroup System - Technical Solution


Amara Maiden

Dim Connect As New MySqlConnection


Dim COMMAND As MySqlCommand
Dim READER As MySqlReader
'declares the variables

ModuleGlobal.GetDatabaseInformation(ServerIP, ServerUsername, ServerPassword,


DatabaseName)
'gets info to connect to database
ShowElement()
'calls elementshow subroutine
If Not Connect Is Nothing Then Connect.Close()
'checks for existing connection
Connect.connectionstring = String.Format("Server={0}; StaffID={1}; Password={2};
Database={3}; pooling=false", ServerIP, ServerUsername, ServerPassword, DatabaseName)
'sets format and values
Try
Connect.Open()
Query = "Select * from tbl_StaffInfo, tbl_LoginInfo where tbl_StaffInfo.Forename =' " &
Forename & "'AND tbl_StaffInfo.Surname = '" & Surname & "' tbl_LoginInfo.StaffID =
tbl_StaffInfo.StaffID"
'selects all from both the login and staff table
'where the users input match forename and surname
COMMAND = New MySqlCommand(Query, Connect)
READER = COMMAND.ExecuteReader

While READER.Read()
TxtPosition.Text = READER("Position")
TxtStaffID.Text = READER("StaffID")
StaffID = TxtStaffID.Text
AdminChar = READER("Admin")
'reads in data to matching textboxes

If AdminChar = "1" Then


Admin = True

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)

Playgroup System - Technical Solution


Amara Maiden

End Try
Connect.Close()
End Sub

Private Sub HideElement()


'this subroutine runs when called
'hides elements on the form that are not needed
TxtPosition.Text = ""
TxtStaffID.Text = ""
TxtForenameChange.Hide()
LblForenameChange.Hide()
TxtSurnameChange.Hide()
LblSurnameChange.Hide()
TxtPosition.Hide()
LblPosition.Hide()
TxtStaffID.Hide()
LblStaffID.Hide()
RadBtnYes.Hide()
RadBtnNo.Hide()
LblAdmin.Hide()
TxtUsername.Hide()
LblUsername.Hide()
End Sub

Private Sub ShowElement()


'runs when called
'shows all the elements containing existing staff data
TxtForenameChange.Show()
LblForenameChange.Show()
TxtSurnameChange.Show()
LblSurnameChange.Show()
TxtPosition.Show()
LblPosition.Show()
TxtStaffID.Show()
LblStaffID.Show()
RadBtnYes.Show()
RadBtnNo.Show()
LblAdmin.Show()
TxtUsername.Show()
LblUsername.Show()
BtnEdit.Show()
End Sub

Private Sub UpdateInfo()


'runs when call
'updates all the information that is different to store info
'for the chosen staff member

Dim CheckForename, CheckSurname, CheckPosition, CheckStaffID, CheckUsername As String


Dim CheckAdmin As String = ""
Dim CheckAdminBool As Boolean

Playgroup System - Technical Solution


Amara Maiden

Dim Query As String = ""


Dim DatabaseName As String = ""
Dim ServerIP As String = ""
Dim ServerUsername As String = ""
Dim ServerPassword As String = ""
Dim Connect As New MySqlConnection
Dim COMMAND As MySqlCommand
Dim READER As MySqlDataReader
'variables

ModuleGlobal.GetDatabaseInformation(ServerIP, ServerUsername, ServerPassword,


DatabaseName)
'gets database info

If Not Connect Is Nothing Then Connect.close()


Connect.connectionstring = String.Format("Server={0}; StaffID={1}; Password={2};
Database={3}; pooling=false", ServerIP, ServerUsername, ServerPassword, DatabaseName)
'checks to see whether there is an existing database connection

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")

'gets current info for the chosen staff member


'assigns it to check variable for comparison
End While
READER.Close()
COMMAND.Dispose()

If CheckAdmin = "1" Then


CheckAdminBool = True
Else
CheckAdminBool = False
End If

Select Case RadBtnYes.Checked


Case Is <> CheckAdminBool
If CheckAdmin = "1" Then

Playgroup System - Technical Solution


Amara Maiden

CheckAdmin = "0"
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

Select Case CheckForename


Case Is <> TxtForenameChange.Text
Try
Query = "UPDATE tbl_LoginInfo SET Forename" & TxtForenameChange.Text & "
WHERE Forename = '" & Forename & "' AND Surname = '" & Surname & "'"
COMMAND = New MySqlCommand(Query, Connect)
COMMAND.ExecuteNonQuery()
COMMAND.Dispose()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Select

Select Case CheckSurname


Case Is <> TxtSurnameChange.Text
Try
Query = "UPDATE tbl_LoginInfo SET Forename" & TxtSurnameChange.Text & "
WHERE Forename = '" & Forename & "' AND Surname = '" & Surname & "'"
COMMAND = New MySqlCommand(Query, Connect)
COMMAND.ExecuteNonQuery()
COMMAND.Dispose()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Select

Select Case CheckForename


Case Is <> TxtForenameChange.Text
Try
Query = "UPDATE tbl_LoginInfo SET Forename" & TxtForenameChange.Text & "
WHERE Forename = '" & Forename & "' AND Surname = '" & Surname & "'"
COMMAND = New MySqlCommand(Query, Connect)
COMMAND.ExecuteNonQuery()
COMMAND.Dispose()
Catch ex As Exception

Playgroup System - Technical Solution


Amara Maiden

MessageBox.Show(ex.Message)
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

Select Case CheckPosition


Case Is <> TxtPosition.Text
UpdateSpecific("tbl_StaffInfo", "Position", TxtPosition.Text, "", StaffID)
'calls the updatespecific subroutine
End Select

Select Case CheckStaffID


Case Is <> TxtStaffID.Text
UpdateSpecific("tbl_StaffInfo", "StaffID", TxtStaffID.Text, "", StaffID)
UpdateSpecific("tbl_LoginInfo", "StaffID", TxtStaffID.Text, "", StaffID)
End Select

Select Case CheckUsername


Case Is <> TxtUsername.Text
UpdateSpecific("tbl_LoginInfo", "Username", TxtUsername.Text, "", StaffID)
End Select
End Sub

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


TxtForename.TextChanged
'this subroutine is called when the text in the forname textbox
'is changed
Count = Count + 1
'count used to make sure this is not executed the first time a user enters data
If Count <= 1 Then
MessageBox.Show("Staff member name changed, please search again.")
HideElement()
End If
End Sub

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


TxtSurname.TextChanged
Count = Count + 1
'count used to make sure this is not executed the first time a user enters data
If Count = 1 Then
MessageBox.Show("Staff member name changed, please search again.")
HideElement()
End If
End Sub

Private Sub BtnSearch_Click(sender As Object, e As EventArgs) Handles BtnSearch.Click


'whens when search button is clicked
Count = 0
Forename = TxtForename.Text

Playgroup System - Technical Solution


Amara Maiden

Surname = TxtSurname.Text
'counter is reset and variables are assigned values

PopulateInfo(TxtForename.Text, TxtSurname.Text)
'calls populateinfo to pass on staff member forename and surname to the subroutine
End Sub

Private Sub BtnEdit_Click(sender As Object, e As EventArgs) Handles BtnEdit.Click


'runs when the edit button is clicked by user
UpdateInfo()
Close()
'calls update info and then closes the form
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

Dim Query As String = ""


Dim DatabaseName As String = ""
Dim ServerIP As String = ""
Dim ServerUsername As String = ""
Dim ServerPassword As String = ""
Dim Connect As MySqlConnection
Dim COMMAND As MySqlCommand
'variables

ModuleGlobal.GetDatabaseInformation(ServerIP, ServerUsername, ServerPassword,


DatabaseName)
'gets database information
If Not Connect Is Nothing Then Connect.Close()
Connect.ConnectionString = String.Format("Server={0}; user id={1}; password={2};
database={3}; pooling=false", ServerIP, ServerUsername, ServerPassword, DatabaseName)
'checks for existing connection
'sets format and values
Try
Connect.Open()
Query = "UPDATE" & Table & " SET " & Column & " = " & Text & "'WHERE" &
ConstColumn & "='" & ConstText & "'"
COMMAND = New MySqlCommand(Query, Connect)
COMMAND.ExecuteNonQuery()
COMMAND.Dispose()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
Connect.Close()
'executes the command to update the information in the table
End If

Playgroup System - Technical Solution


Amara Maiden

End Sub
End Class

Designer Code;
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class FormEditStaffMember
Inherits System.Windows.Forms.Form

'Form overrides dispose to clean up the component list.


<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

'Required by the Windows Form Designer


Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer


'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New
System.ComponentModel.ComponentResourceManager(GetType(FormEditStaffMember))
Me.ImgBunnies = New System.Windows.Forms.PictureBox()
Me.LblEditStaffMember = New System.Windows.Forms.Label()
Me.LblForename = New System.Windows.Forms.Label()
Me.LblSurname = New System.Windows.Forms.Label()
Me.LblForenameChange = New System.Windows.Forms.Label()
Me.LblSurnameChange = New System.Windows.Forms.Label()
Me.LblPosition = New System.Windows.Forms.Label()
Me.LblStaffID = New System.Windows.Forms.Label()
Me.LblUsername = New System.Windows.Forms.Label()
Me.LblAdmin = New System.Windows.Forms.Label()
Me.BtnSearch = New System.Windows.Forms.Button()
Me.BtnExit = New System.Windows.Forms.Button()
Me.TxtForename = New System.Windows.Forms.TextBox()
Me.TxtSurname = New System.Windows.Forms.TextBox()
Me.TxtForenameChange = New System.Windows.Forms.TextBox()
Me.TxtSurnameChange = New System.Windows.Forms.TextBox()
Me.TxtPosition = New System.Windows.Forms.TextBox()
Me.TxtUsername = New System.Windows.Forms.TextBox()
Me.TxtStaffID = New System.Windows.Forms.TextBox()
Me.RadBtnYes = New System.Windows.Forms.RadioButton()
Me.RadBtnNo = New System.Windows.Forms.RadioButton()

Playgroup System - Technical Solution


Amara Maiden

Me.BtnEdit = New System.Windows.Forms.Button()


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

Playgroup System - Technical Solution


Amara Maiden

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"

Playgroup System - Technical Solution


Amara Maiden

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
'

Playgroup System - Technical Solution


Amara Maiden

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)

Playgroup System - Technical Solution


Amara Maiden

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

Playgroup System - Technical Solution


Amara Maiden

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

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


MyBase.Load
ComBoxForename.DropDownStyle = ComboBoxStyle.DropDown
ComBoxForename.AutoCompleteMode = AutoCompleteMode.SuggestAppend
ComBoxForename.AutoCompleteSource = AutoCompleteSource.ListItems
ComBoxSurname.DropDownStyle = ComboBoxStyle.DropDown
ComBoxSurname.AutoCompleteMode = AutoCompleteMode.SuggestAppend
ComBoxSurname.AutoCompleteSource = AutoCompleteSource.ListItems
'sets the drop down style and autocomplete style of the combo boxes

ModuleGlobal.GetDatabaseInformation(ServerIP, ServerUsername, ServerPassword,


DatabaseName)
'gets the required database info
InitialPopulate()
'info to populate combobox
End Sub

Playgroup System - Technical Solution


Amara Maiden

Private Sub InitialPopulate()


'runs when called, adds names to combo boxes
ComBoxForename.Items.Clear()
ComBoxSurname.Items.Clear()
'clears existing content of combo boxes

If Not Connect Is Nothing Then Connect.Close()


Connect.ConnectionString = String.Format("Server={0}; StaffID={1}; Password={2};
Database={3}; pooling=false", ServerIP, ServerUsername, ServerPassword, DatabaseName)
'checks for existing connection and formats
Try
Connect.Open()

Query = "Select Forename from tbl_StaffInfo ORDER by Forename ASC"


'selects all forenames in ascending order
COMMAND = New MySqlCommand(Query, Connect)
READER = COMMAND.ExecuteReader

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()

Query = "Select Surname from tbl_StaffInfo ORDER by Surname ASC"


'selects all forenames in ascending order
COMMAND = New MySqlCommand(Query, Connect)
READER = COMMAND.ExecuteReader

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

Playgroup System - Technical Solution


Amara Maiden

Dim StaffID As String


'variable declared to hold StaffID from table

If Not Connect Is Nothing Then Connect.Close()


'checks for existing database connection
Connect.ConnectionString = String.Format("Server={0}; StaffID={1}; Password={2};
Database={3}; pooling=false", ServerIP, ServerUsername, ServerPassword, DatabaseName)
Try
Connect.Open()
Query = "Select StaffID from tbl_StaffInfo where Forename = '" & ComBoxForename.Text &
"where Surname = " & ComBoxSurname.Text & "'"
'gets the StaffID of selected Staff
COMMAND = New MySqlCommand(Query, Connect)
READER = COMMAND.ExecuteReader()
While READER.Read()
StaffID = READER("StaffID")
End While
READER.Closer()
COMMAND.Dispose()

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

'Form overrides dispose to clean up the component list.


<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

'Required by the Windows Form Designer


Private components As System.ComponentModel.IContainer

Playgroup System - Technical Solution


Amara Maiden

'NOTE: The following procedure is required by the Windows Form Designer


'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New
System.ComponentModel.ComponentResourceManager(GetType(FormRemoveStaffMember))
Me.BtnRemove = New System.Windows.Forms.Button()
Me.ComBoxSurname = New System.Windows.Forms.ComboBox()
Me.ComBoxForename = New System.Windows.Forms.ComboBox()
Me.LblSurname = New System.Windows.Forms.Label()
Me.LblForename = New System.Windows.Forms.Label()
Me.LblRemoveStaffMember = New System.Windows.Forms.Label()
Me.ImgBunnies = New System.Windows.Forms.PictureBox()
CType(Me.ImgBunnies, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'BtnRemove
'
Me.BtnRemove.Location = New System.Drawing.Point(139, 186)
Me.BtnRemove.Name = "BtnRemove"
Me.BtnRemove.Size = New System.Drawing.Size(75, 23)
Me.BtnRemove.TabIndex = 18
Me.BtnRemove.Text = "Remove"
Me.BtnRemove.UseVisualStyleBackColor = True
'
'ComBoxSurname
'
Me.ComBoxSurname.FormattingEnabled = True
Me.ComBoxSurname.Location = New System.Drawing.Point(195, 141)
Me.ComBoxSurname.Name = "ComBoxSurname"
Me.ComBoxSurname.Size = New System.Drawing.Size(99, 21)
Me.ComBoxSurname.TabIndex = 17
'
'ComBoxForename
'
Me.ComBoxForename.FormattingEnabled = True
Me.ComBoxForename.Location = New System.Drawing.Point(59, 141)
Me.ComBoxForename.Name = "ComBoxForename"
Me.ComBoxForename.Size = New System.Drawing.Size(99, 21)
Me.ComBoxForename.TabIndex = 16
'
'LblSurname
'
Me.LblSurname.AutoSize = True
Me.LblSurname.Location = New System.Drawing.Point(192, 125)
Me.LblSurname.Name = "LblSurname"
Me.LblSurname.Size = New System.Drawing.Size(55, 13)
Me.LblSurname.TabIndex = 15
Me.LblSurname.Text = "Surname: "

Playgroup System - Technical Solution


Amara Maiden

'
'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()

Playgroup System - Technical Solution


Amara Maiden

End Sub
Friend WithEvents BtnRemove As System.Windows.Forms.Button
Friend WithEvents ComBoxSurname As System.Windows.Forms.ComboBox
Friend WithEvents ComBoxForename As System.Windows.Forms.ComboBox
Friend WithEvents LblSurname As System.Windows.Forms.Label
Friend WithEvents LblForename As System.Windows.Forms.Label
Friend WithEvents LblRemoveStaffMember As System.Windows.Forms.Label
Friend WithEvents ImgBunnies As System.Windows.Forms.PictureBox
End Class

Playgroup System - Technical Solution


Amara Maiden

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

Private Sub FormAddNewChild_Load(sender As Object, e As EventArgs)


ModuleGlobal.GetDatabaseInformation(ServerIP, ServerUsername, ServerPassword,
DatabaseName)
'Calls the GetDatabaseInformation Routine from global module
'assigns values saved their to the corresponding variables
End Sub

Private Sub BtnConfirm_Click(sender As Object, e As EventArgs) Handles BtnConfirm.Click


'this subroutine runs when confirm button is clicked by user

Playgroup System - Technical Solution


Amara Maiden

Dim Accepted As Boolean = CheckLengths()


'boolean variable is declared
'assigns returned value from the 'CheckLengths' function to the variable
If Not Connect Is Nothing Then Connect.close()
'checks to see whether a database connection is open
'if there is then it is closed
Connect.ConnectionString = String.Format("Server={0}; StaffID={1}; Password={2};
Database={3}; pooling=false", ServerIP, ServerUsername, ServerPassword, DatabaseName)
'connection string format is set and passes connection information

If Accepted = True Then


Try
Connect.Open()
'opens the connection
Query = "Insert into tbl_ChildInfo (ChildID, Forename, Surname, DateOfBirth,
ChildMedicalNeeds, MedicineNeeded) Values ('" & TxtChildID.Text & "','" & TxtForename.Text & "','" &
TxtSurname.Text & "','" & TxtDateOfBirth.Text & "','" & TxtChildMedicalNeeds.Text & "','" &
TxtMedicineNeeded.Text & "')"
'assigns value needed to query

COMMAND = New MySqlCommand(Query, Conn)


'generates new command
COMMAND.ExecuteNonQuery()
'executes command
COMMAND.Dispose()
'disposes of the command, so can be assigned if needed
MessageBox.Show("A new child record has been successfully added.")
Connect.Close()
'closes the connection
Close()
'closes the form
Catch ex As Exception
MessageBox.Show(ex.Message)
'displays an error message to user if something fails
End Try
Else
MessageBox.Show("Error! One or more of the values entered are too long, please fix this to
continue.")
End If
Connect.Close()
'closes the connection
End Sub

Private Function CheckLengths()


'function runs when called
Dim ChildIDLength As Integer = 2
Dim ForenameLength As Integer = 15
Dim SurnameLength As Integer = 20
Dim ChildMedicalNeedsLength As Integer = 40
Dim MedicineNeededLength As Integer = 40
'variables assigned the maximum lengths for each piece of data

Playgroup System - Technical Solution


Amara Maiden

Select Case TxtChildID.Text.Length


Case Is > ChildIDLength
MessageBox.Show("The value you have entered for ChildID is too long.")
Return False
End Select

Select Case TxtForename.Text.Length


Case Is > ForenameLength
MessageBox.Show("The value you have entered for Forename is too long.")
Return False
End Select

Select Case TxtSurname.Text.Length


Case Is > SurnameLength
MessageBox.Show("The value you have entered for Surname is too long.")
Return False
End Select

Select Case TxtChildMedicalNeeds.Text.Length


Case Is > ChildMedicalNeedsLength
MessageBox.Show("The value you have entered for Child Medical Needs is too long.")
End Select

Select Case TxtMedicineNeeded.Text.Length


Case Is > MedicineNeededLength
MessageBox.Show("The value you have entered for Medicine Needed is too long.")
Return False
'all case statements check whether the values entered are of correct length
'return false values if they are not within the correct length range
Case Else
Return True
'when the last one is reached and all values are accepted
'then a true value is returned
End Select
End Function

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


'this subroutine runs when the exit button is clicked
Close()
'closes the form
End Sub
End Class
End Class

Designer Code;
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class FormAddNewChild

Inherits System.Windows.Forms.Form

Playgroup System - Technical Solution


Amara Maiden

'Form overrides dispose to clean up the component list.


<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

'Required by the Windows Form Designer


Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer


'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New
System.ComponentModel.ComponentResourceManager(GetType(FormAddNewChild))
Me.PictureBox1 = New System.Windows.Forms.PictureBox()
Me.LblChildID = New System.Windows.Forms.Label()
Me.LblForename = New System.Windows.Forms.Label()
Me.LblSurname = New System.Windows.Forms.Label()
Me.LblDateOfBirth = New System.Windows.Forms.Label()
Me.LblChildMedicalNeeds = New System.Windows.Forms.Label()
Me.LblMedicineNeeded = New System.Windows.Forms.Label()
Me.LblAddNewChild = New System.Windows.Forms.Label()
CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'PictureBox1
'
Me.PictureBox1.Image = CType(resources.GetObject("PictureBox1.Image"),
System.Drawing.Image)
Me.PictureBox1.Location = New System.Drawing.Point(1, 0)
Me.PictureBox1.Name = "PictureBox1"
Me.PictureBox1.Size = New System.Drawing.Size(106, 70)
Me.PictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.PictureBox1.TabIndex = 11
Me.PictureBox1.TabStop = False
'
'LblChildID
'
Me.LblChildID.AutoSize = True
Me.LblChildID.Location = New System.Drawing.Point(48, 122)
Me.LblChildID.Name = "LblChildID"
Me.LblChildID.Size = New System.Drawing.Size(44, 13)
Me.LblChildID.TabIndex = 12

Playgroup System - Technical Solution


Amara Maiden

Me.LblChildID.Text = "ChildID:"
'
'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)

Playgroup System - Technical Solution


Amara Maiden

Me.LblAddNewChild.Name = "LblAddNewChild"
Me.LblAddNewChild.Size = New System.Drawing.Size(39, 13)
Me.LblAddNewChild.TabIndex = 18
Me.LblAddNewChild.Text = "LblAddNewChild"
'
'FormAddNewChild
'
Me.ClientSize = New System.Drawing.Size(371, 322)
Me.Controls.Add(Me.LblMedicineNeeded)
Me.Controls.Add(Me.LblChildMedicalNeeds)
Me.Controls.Add(Me.LblDateOfBirth)
Me.Controls.Add(Me.LblSurname)
Me.Controls.Add(Me.LblForename)
Me.Controls.Add(Me.LblChildID)
Me.Controls.Add(Me.PictureBox1)
Me.Name = "FormAddNewChild"
CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()

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

Playgroup System - Technical Solution


Amara Maiden

FormEditChildRecord;

Screenshot;

Form Code;
Imports MySql.Data.MySqlClient

Public Class FormEditChildRecord


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

Private Sub FormEditChildRecord_Load(sender As Object, e As EventArgs) Handles MyBase.Load


'runs when form is opened
ComBoxChild.DropDownStyle = ComboBoxStyle.DropDown
ComBoxChild.AutoCompleteMode = AutoCompleteMode.SuggestAppend
ComBoxChild.AutoCompleteSource = AutoCompleteSource.ListItems
'sets the drop down style and autocomplete style for
'child name combo/text box

Playgroup System - Technical Solution


Amara Maiden

ModuleGlobal.GetDatabaseInformation(ServerIP, ServerUsername, ServerPassword,


DatabaseName)
'gets the database info
InitialPopulate()
'calls subroutine
End Sub

Private Sub InitialPopulate()


'subroutine to populate drop down combo box
ComBoxChild.Items.Clear()
'clears existing items
If Not Connect Is Nothing Then Connect.Close()
Connect.ConnectionString = String.Format("Server={0}; StaffID={1}; Password={2};
Database={3}; pooling=false", ServerIP, ServerUsername, ServerPassword, DatabaseName)
'checks to see whether there is an existing connection
'sets connection string values and format
Try
Connect.open()
Query = "Select Forename AND Surname from tbl_ChildInfo ORDER by Forename ASC"
COMMAND = New MySqlCommand(Query, Connect)
READER = COMMAND.ExecuteReader
'selects all the forenames and surnames of the children
'from the database
'orders them in ascending order
While READER.Read
ComBoxChild.Items.Add(READER("Forename" & "Surname"))
End While
'reads the values in
'adds to drop down combo box
READER.Close()
COMMAND.Dispose()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
Connect.close()
End Sub

Private Sub BtnSelect_Click(sender As Object, e As EventArgs) Handles BtnSelect.Click


'this runs when the select Child button is clicked
'by user
Dim SelectedChild As String = ComBoxChild.Text
Try
Connect.Open()

Query = "SELECT ChildID, Forename, Surname, DateOfBirth, ChildMedicialNeeds,


MedicineNeeded from tbl_ChildInfo where Name ='" & SelectedChild & "'"
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()

Playgroup System - Technical Solution


Amara Maiden

TxtChildID.Text = READER("StaffID")
TxtForename.Text = READER("Forename")
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

Private Sub BtnUpdate_Click(sender As Object, e As EventArgs) Handles UpdateButton.Click


'subroutine runs when update button is clicked by user
Dim Accepted As Boolean
Dim CheckID As String
Dim CheckForename As String
Dim CheckSurname As String
Dim CheckChildMedicalNeeds As String
Dim CheckMedicineNeeded As String
'variables

If Accepted = True Then


'checks to make sure that all data fields are
'within correct length range
If Not Connect Is Nothing Then Connect.Close()
Connect.ConnectionString = String.Format("Server={0}; StaffID={1}; Password={2};
Database={3}; pooling=false", ServerIP, ServerUsername, ServerPassword, DatabaseName)
Try
Connect.Open()
'checks to see whether there is an existing database connection
'sets string format and values
Query = "Select ChildID, Forename, Surname, DateOfBirth, ChildMedicalNeeds,
MedicineNeeded from tbl_ChildInfo Where Name = '" & ComBoxChild.Text & "'"
COMMAND = New MySqlCommand(Query, Connect)
READER = COMMAND.ExecuteReader
'selects existing data to compare to
While READER.Read()
CheckID = READER("ChildID")
CheckForename = READER("Forename")
CheckSurname = READER("Surname")
CheckChildMedicalNeeds = READER("ChildMedicalNeeds")
CheckMedicineNeeded = READER("MedicineNeeded")
End While
READER.Close()
COMMAND.Dispose()
'data is assigned to the check variables
Select Case CheckID

Playgroup System - Technical Solution


Amara Maiden

Case Is <> TxtChildID.Text


Try
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)

Playgroup System - Technical Solution


Amara Maiden

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

Private Function LengthChecks()


'performs checks to see if values are within length range

Playgroup System - Technical Solution


Amara Maiden

Dim IDLength As Integer


Dim ForenameLength As Integer
Dim SurnameLength As Integer
Dim ChildMedicalNeedsLength As Integer
Dim MedicineNeededLength As Integer
Dim Accepted As Boolean
Select Case TxtChildID.Text.Length
Case Is > IDLength
MessageBox.Show("ChildID is too long, please amend")
Accepted = False
Case Else
Accepted = True
'if input is accepted, do nothing
End Select
Select Case TxtForename.Text.Length
Case Is > ForenameLength
MessageBox.Show("Forename is too long, please amend")
Accepted = False
Case Else
Accepted = True
'if input is accepted, do nothing
End Select
Select Case TxtSurname.Text.Length
Case Is > SurnameLength
MessageBox.Show("Surname is too long, please amend")
Accepted = False
Case Else
Accepted = True
'if input is accepted, do nothing
End Select
Select Case TxtChildMedicalNeeds.Text.Length
Case Is > ChildMedicalNeedsLength
MessageBox.Show("Child Medical Needs is too long, please amend")
Accepted = False
Case Else
Accepted = True
'if input is accepted, do nothing
End Select
Select Case TxtMedicineNeeded.Text.Length
Case Is > MedicineNeededLength
MessageBox.Show("Medicine Needed is too long, please amend")
Accepted = False
Case Else
Accepted = True
'if input is accepted, do nothing
End Select
Return Accepted
End Function

End Class

Playgroup System - Technical Solution


Amara Maiden

Designer Code;
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class FormEditChildRecord
Inherits System.Windows.Forms.Form

'Form overrides dispose to clean up the component list.


<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

'Required by the Windows Form Designer


Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer


'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New
System.ComponentModel.ComponentResourceManager(GetType(FormEditChildRecord))
Me.ImgBunnies = New System.Windows.Forms.PictureBox()
Me.LblEditChildRecord = New System.Windows.Forms.Label()
Me.LblChild = New System.Windows.Forms.Label()
Me.LblChildID = New System.Windows.Forms.Label()
Me.LblForename = New System.Windows.Forms.Label()
Me.LblSurname = New System.Windows.Forms.Label()
Me.LblChildMedicalNeeds = New System.Windows.Forms.Label()
Me.LblMedicineNeeded = New System.Windows.Forms.Label()
Me.TxtChildID = New System.Windows.Forms.TextBox()
Me.TxtForename = New System.Windows.Forms.TextBox()
Me.TxtSurname = New System.Windows.Forms.TextBox()
Me.TxtChildMedicalNeeds = New System.Windows.Forms.TextBox()
Me.TxtMedicineNeeded = New System.Windows.Forms.TextBox()
Me.BtnUpdate = New System.Windows.Forms.Button()
Me.ComBoxChild = New System.Windows.Forms.ComboBox()
Me.BtnSelect = New System.Windows.Forms.Button()
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)

Playgroup System - Technical Solution


Amara Maiden

Me.ImgBunnies.Name = "ImgBunnies"
Me.ImgBunnies.Size = New System.Drawing.Size(102, 65)
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

Playgroup System - Technical Solution


Amara Maiden

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)

Playgroup System - Technical Solution


Amara Maiden

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)

Playgroup System - Technical Solution


Amara Maiden

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

Playgroup System - Technical Solution


Amara Maiden

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

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


MyBase.Load
ComBoxForename.DropDownStyle = ComboBoxStyle.DropDown
ComBoxForename.AutoCompleteMode = AutoCompleteMode.SuggestAppend
ComBoxForename.AutoCompleteSource = AutoCompleteSource.ListItems
ComBoxSurname.DropDownStyle = ComboBoxStyle.DropDown
ComBoxSurname.AutoCompleteMode = AutoCompleteMode.SuggestAppend
ComBoxSurname.AutoCompleteSource = AutoCompleteSource.ListItems
'sets the drop down style and autocomplete style of the combo boxes

ModuleGlobal.GetDatabaseInformation(ServerIP, ServerUsername, ServerPassword,


DatabaseName)
'gets the required database info
InitialPopulate()
'info to populate combobox

Playgroup System - Technical Solution


Amara Maiden

End Sub

Private Sub InitialPopulate()


'runs when called, adds names to combo boxes
ComBoxForename.Items.Clear()
ComBoxSurname.Items.Clear()
'clears existing content of combo boxes

If Not Connect Is Nothing Then Connect.Close()


Connect.ConnectionString = String.Format("Server={0}; StaffID={1}; Password={2};
Database={3}; pooling=false", ServerIP, ServerUsername, ServerPassword, DatabaseName)
'checks for existing connection and formats
Try
Connect.Open()

Query = "Select Forename from tbl_ChildInfo ORDER by Forename ASC"


'selects all forenames in ascending order
COMMAND = New MySqlCommand(Query, Connect)
READER = COMMAND.ExecuteReader

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()

Query = "Select Surname from tbl_ChildInfo ORDER by Surname ASC"


'selects all forenames in ascending order
COMMAND = New MySqlCommand(Query, Connect)
READER = COMMAND.ExecuteReader

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

Playgroup System - Technical Solution


Amara Maiden

Private Sub BtnRemove_Click(sender As Object, e As EventArgs) Handles BtnRemove.Click


'runs when user clicks the remove button, deletes the selected child's record
Dim ChildID As String
'variable declared to hold ChildID from table

If Not Connect Is Nothing Then Connect.Close()


'checks for existing database connection
Connect.ConnectionString = String.Format("Server={0}; StaffID={1}; Password={2};
Database={3}; pooling=false", ServerIP, ServerUsername, ServerPassword, DatabaseName)
Try
Connect.Open()
Query = "Select ChildID from tbl_ChildInfo where Forename = '" & ComBoxForename.Text &
"where Surname = " & ComBoxSurname.Text & "'"
'gets the ChildID of selected child
COMMAND = New MySqlCommand(Query, Connect)
READER = COMMAND.ExecuteReader()
While READER.Read()
ChildID = READER("ChildID")
End While
READER.Closer()
COMMAND.Dispose()

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

'Form overrides dispose to clean up the component list.


<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

Playgroup System - Technical Solution


Amara Maiden

'Required by the Windows Form Designer


Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer


'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New
System.ComponentModel.ComponentResourceManager(GetType(FormRemoveChildRecord))
Me.ImgBunnies = New System.Windows.Forms.PictureBox()
Me.LblRemoveChildRecord = New System.Windows.Forms.Label()
Me.LblForename = New System.Windows.Forms.Label()
Me.LblSurname = New System.Windows.Forms.Label()
Me.ComBoxForename = New System.Windows.Forms.ComboBox()
Me.ComBoxSurname = New System.Windows.Forms.ComboBox()
Me.BtnRemove = New System.Windows.Forms.Button()
Me.PictureBox1 = New System.Windows.Forms.PictureBox()
CType(Me.ImgBunnies, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.PictureBox1, 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, -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
'
'LblRemoveChildRecord
'
Me.LblRemoveChildRecord.AutoSize = True
Me.LblRemoveChildRecord.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!,
System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.LblRemoveChildRecord.Location = New System.Drawing.Point(99, 67)
Me.LblRemoveChildRecord.Name = "LblRemoveChildRecord"
Me.LblRemoveChildRecord.Size = New System.Drawing.Size(163, 20)
Me.LblRemoveChildRecord.TabIndex = 6
Me.LblRemoveChildRecord.Text = "Remove Child Record"
'
'LblForename
'
Me.LblForename.AutoSize = True
Me.LblForename.Location = New System.Drawing.Point(50, 122)
Me.LblForename.Name = "LblForename"
Me.LblForename.RightToLeft = System.Windows.Forms.RightToLeft.No

Playgroup System - Technical Solution


Amara Maiden

Me.LblForename.Size = New System.Drawing.Size(60, 13)


Me.LblForename.TabIndex = 7
Me.LblForename.Text = "Forename: "
'
'LblSurname
'
Me.LblSurname.AutoSize = True
Me.LblSurname.Location = New System.Drawing.Point(186, 122)
Me.LblSurname.Name = "LblSurname"
Me.LblSurname.Size = New System.Drawing.Size(55, 13)
Me.LblSurname.TabIndex = 8
Me.LblSurname.Text = "Surname: "
'
'ComBoxForename
'
Me.ComBoxForename.FormattingEnabled = True
Me.ComBoxForename.Location = New System.Drawing.Point(53, 138)
Me.ComBoxForename.Name = "ComBoxForename"
Me.ComBoxForename.Size = New System.Drawing.Size(99, 21)
Me.ComBoxForename.TabIndex = 9
'
'ComBoxSurname
'
Me.ComBoxSurname.FormattingEnabled = True
Me.ComBoxSurname.Location = New System.Drawing.Point(189, 138)
Me.ComBoxSurname.Name = "ComBoxSurname"
Me.ComBoxSurname.Size = New System.Drawing.Size(99, 21)
Me.ComBoxSurname.TabIndex = 10
'
'BtnRemove
'
Me.BtnRemove.Location = New System.Drawing.Point(133, 183)
Me.BtnRemove.Name = "BtnRemove"
Me.BtnRemove.Size = New System.Drawing.Size(75, 23)
Me.BtnRemove.TabIndex = 11
Me.BtnRemove.Text = "Remove"
Me.BtnRemove.UseVisualStyleBackColor = True
'
'PictureBox1
'
Me.PictureBox1.Image = CType(resources.GetObject("PictureBox1.Image"),
System.Drawing.Image)
Me.PictureBox1.Location = New System.Drawing.Point(-1, -1)
Me.PictureBox1.Name = "PictureBox1"
Me.PictureBox1.Size = New System.Drawing.Size(91, 60)
Me.PictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.PictureBox1.TabIndex = 12
Me.PictureBox1.TabStop = False
'
'FormRemoveChildRecord
'

Playgroup System - Technical Solution


Amara Maiden

Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)


Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(358, 253)
Me.Controls.Add(Me.PictureBox1)
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.LblRemoveChildRecord)
Me.Name = "FormRemoveChildRecord"
CType(Me.ImgBunnies, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()

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

Playgroup System - Technical Solution


Amara Maiden

FormSettings;

Screenshot;

Form Code;
Public Class FormSettings

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


BtnChangeUsername.Click
FormChangeUsername.Show()
'FormChangeUsername is displayed when button is clicked by the user
End Sub

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


BtnChangePassword.Click
FormChangePassword.Show()
'FormChangePassword is displayed when button is clicked by the user
End Sub
End Class

Designer Code;
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class FormSettings
Inherits System.Windows.Forms.Form

'Form overrides dispose to clean up the component list.


<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)

Playgroup System - Technical Solution


Amara Maiden

End Try
End Sub

'Required by the Windows Form Designer


Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer


'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New
System.ComponentModel.ComponentResourceManager(GetType(FormSettings))
Me.ImgBunnies = New System.Windows.Forms.PictureBox()
Me.LblSettings = New System.Windows.Forms.Label()
Me.BtnChangeUsername = New System.Windows.Forms.Button()
Me.BtnChangePassword = New System.Windows.Forms.Button()
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(-1, 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 = 5
Me.ImgBunnies.TabStop = False
'
'LblSettings
'
Me.LblSettings.AutoSize = True
Me.LblSettings.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!,
System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.LblSettings.Location = New System.Drawing.Point(127, 73)
Me.LblSettings.Name = "LblSettings"
Me.LblSettings.Size = New System.Drawing.Size(68, 20)
Me.LblSettings.TabIndex = 6
Me.LblSettings.Text = "Settings"
'
'BtnChangeUsername
'
Me.BtnChangeUsername.Location = New System.Drawing.Point(28, 126)
Me.BtnChangeUsername.Name = "BtnChangeUsername"
Me.BtnChangeUsername.Size = New System.Drawing.Size(114, 23)
Me.BtnChangeUsername.TabIndex = 7
Me.BtnChangeUsername.Text = "Change Username"
Me.BtnChangeUsername.UseVisualStyleBackColor = True
'

Playgroup System - Technical Solution


Amara Maiden

'BtnChangePassword
'
Me.BtnChangePassword.Location = New System.Drawing.Point(184, 126)
Me.BtnChangePassword.Name = "BtnChangePassword"
Me.BtnChangePassword.Size = New System.Drawing.Size(114, 23)
Me.BtnChangePassword.TabIndex = 8
Me.BtnChangePassword.Text = "Change Password"
Me.BtnChangePassword.UseVisualStyleBackColor = True
'
'FormSettings
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(335, 208)
Me.Controls.Add(Me.BtnChangePassword)
Me.Controls.Add(Me.BtnChangeUsername)
Me.Controls.Add(Me.LblSettings)
Me.Controls.Add(Me.ImgBunnies)
Me.Name = "FormSettings"
Me.Text = "FormSettings"
CType(Me.ImgBunnies, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()

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

Playgroup System - Technical Solution


Amara Maiden

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 = ""

Dim ServerUsername As String = ""


Dim ServerPassword As String = ""
Dim Connect As MySqlConnection
Dim COMMAND As MySqlCommand
Dim ChangeComplete As Boolean
'gets the required info about the database

ModuleGlobal.GetDatabaseInformation(ServerIP, ServerUsername, ServerPassword,


DatabaseName)

Query = "UPDATE tbl_LoginInfo SET Username = '" & TxtNewUsername.Text & "'WHERE
Username = '" & TxtOldUsername.Text & "'"
'updates the new password

If Not Connect Is Nothing Then Connect.Close()


Connect.ConnectionString = String.Format("Server={0}; StaffID={1}; Password={2};
Database={3}; pooling=false", ServerIP, ServerUsername, ServerPassword, DatabaseName)
'checks for database connection and formats connection string
Try
Connect.Open()

Playgroup System - Technical Solution


Amara Maiden

COMMAND = New MySqlCommand(Query, Connect)


COMMAND.ExecuteNonQuery()
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

'Form overrides dispose to clean up the component list.


<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

'Required by the Windows Form Designer


Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer


'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New
System.ComponentModel.ComponentResourceManager(GetType(FormChangeUsername))
Me.BtnChange = New System.Windows.Forms.Button()
Me.ImgBunnies = New System.Windows.Forms.PictureBox()
Me.TxtOldUsername = New System.Windows.Forms.TextBox()
Me.TxtNewUsername = New System.Windows.Forms.TextBox()
Me.LblOldUsername = New System.Windows.Forms.Label()

Playgroup System - Technical Solution


Amara Maiden

Me.LblNewUsername = New System.Windows.Forms.Label()


CType(Me.ImgBunnies, System.ComponentModel.ISupportInitialize).BeginInit()
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)

Playgroup System - Technical Solution


Amara Maiden

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

Playgroup System - Technical Solution


Amara Maiden

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 = ""

Dim ServerUsername As String = ""


Dim ServerPassword As String = ""
Dim Connect As MySqlConnection
Dim COMMAND As MySqlCommand
Dim ChangeComplete As Boolean
'gets the required info about the database

ModuleGlobal.GetDatabaseInformation(ServerIP, ServerUsername, ServerPassword,


DatabaseName)

Query = "UPDATE tbl_LoginInfo SET Password = '" & TxtNewPassword.Text & "'WHERE
Password = '" & TxtOldPassword.Text & "'"
'updates the new password

If Not Connect Is Nothing Then Connect.Close()


Connect.ConnectionString = String.Format("Server={0}; StaffID={1}; Password={2};
Database={3}; pooling=false", ServerIP, ServerUsername, ServerPassword, DatabaseName)
'checks for database connection and formats connection string
Try
Connect.Open()
COMMAND = New MySqlCommand(Query, Connect)

Playgroup System - Technical Solution


Amara Maiden

COMMAND.ExecuteNonQuery()
ChangeComplete = True
'if everything matches, then change is successfully
Catch ex As Exception
ChangeComplete = False
MessageBox.Show("Your Password has not been changed.", "Error Occurred.",
MessageBoxButtons.OK)
'if not then change will not occur
End Try
If ChangeComplete = True Then
MessageBox.Show("Your Password has been successfully changed.", "Password changed
successfully.", MessageBoxButtons.OK)
'message displayed to user to tell them their Password has been changed
Close()
End If
End Sub
End Class

Designer Code;
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class FormChangePassword
Inherits System.Windows.Forms.Form

'Form overrides dispose to clean up the component list.


<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

'Required by the Windows Form Designer


Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer


'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New
System.ComponentModel.ComponentResourceManager(GetType(FormChangePassword))
Me.LblNewPassword = New System.Windows.Forms.Label()
Me.LblOldPassword = New System.Windows.Forms.Label()
Me.TxtNewPassword = New System.Windows.Forms.TextBox()
Me.TxtOldPassword = New System.Windows.Forms.TextBox()
Me.ImgBunnies = New System.Windows.Forms.PictureBox()
Me.BtnChange = New System.Windows.Forms.Button()

Playgroup System - Technical Solution


Amara Maiden

CType(Me.ImgBunnies, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'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)

Playgroup System - Technical Solution


Amara Maiden

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

Playgroup System - Technical Solution


Amara Maiden

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

Private Sub InitialPopulate()


'runs when called, adds names to combo boxes
ComBoxForename.Items.Clear()
ComBoxSurname.Items.Clear()
'clears existing content of combo boxes

Playgroup System - Technical Solution


Amara Maiden

If Not Connect Is Nothing Then Connect.Close()


Connect.ConnectionString = String.Format("Server={0}; StaffID={1}; Password={2};
Database={3}; pooling=false", ServerIP, ServerUsername, ServerPassword, DatabaseName)
'checks for existing connection and formats
Try
Connect.Open()

Query = "Select Forename from tbl_StaffInfo ORDER by Forename ASC"


'selects all forenames in ascending order
COMMAND = New MySqlCommand(Query, Connect)
READER = COMMAND.ExecuteReader

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()

Query = "Select Surname from tbl_StaffInfo ORDER by Surname ASC"


'selects all forenames in ascending order
COMMAND = New MySqlCommand(Query, Connect)
READER = COMMAND.ExecuteReader

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 Calculate()


'calculates the amount to pay
Dim GvmntFunding As Boolean
'declares variable
TxtAmountToPay.Text = TxtHoursAttended.Text * 8
'amount to pay equals the hours attended times by the standard hourly rate (8 GBP)

Playgroup System - Technical Solution


Amara Maiden

If GvmntFunding = True Then


TxtAmountToPay.Text = TxtAmountToPay.Text - (TxtAmountToPay.Text / 4)
'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

Private Sub BtnSearch_Click(sender As Object, e As EventArgs) Handles BtnSearch.Click


'this runs when the button is clicked
'by user

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

'Form overrides dispose to clean up the component list.


<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally

Playgroup System - Technical Solution


Amara Maiden

MyBase.Dispose(disposing)
End Try
End Sub

'Required by the Windows Form Designer


Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer


'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New
System.ComponentModel.ComponentResourceManager(GetType(FormCreateBill))
Me.ImgBunnies = New System.Windows.Forms.PictureBox()
Me.LblCreateBill = New System.Windows.Forms.Label()
Me.LblChild = New System.Windows.Forms.Label()
Me.LblChildForename = New System.Windows.Forms.Label()
Me.LblChildSurname = New System.Windows.Forms.Label()
Me.BtnSearch = New System.Windows.Forms.Button()
Me.LblParent = New System.Windows.Forms.Label()
Me.LblParentForename = New System.Windows.Forms.Label()
Me.LblParentSurname = New System.Windows.Forms.Label()
Me.LblHoursAttended = New System.Windows.Forms.Label()
Me.LblGvnmtFunding = New System.Windows.Forms.Label()
Me.LblAmountToPay = New System.Windows.Forms.Label()
Me.BtnEmail = New System.Windows.Forms.Button()
Me.BtnPrint = New System.Windows.Forms.Button()
Me.TxtHoursAttended = New System.Windows.Forms.TextBox()
Me.TxtParentForename = New System.Windows.Forms.TextBox()
Me.TxtParentSurname = New System.Windows.Forms.TextBox()
Me.TxtAmountToPay = New System.Windows.Forms.TextBox()
Me.RadBtnYes = New System.Windows.Forms.RadioButton()
Me.RadBtnNo = New System.Windows.Forms.RadioButton()
Me.ComBoxForename = New System.Windows.Forms.ComboBox()
Me.ComBoxSurname = New System.Windows.Forms.ComboBox()
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(-2, -2)
Me.ImgBunnies.Name = "ImgBunnies"
Me.ImgBunnies.Size = New System.Drawing.Size(95, 62)
Me.ImgBunnies.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.ImgBunnies.TabIndex = 2
Me.ImgBunnies.TabStop = False
'
'LblCreateBill

Playgroup System - Technical Solution


Amara Maiden

'
Me.LblCreateBill.AutoSize = True
Me.LblCreateBill.Font = New System.Drawing.Font("Microsoft Sans Serif", 14.25!,
System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.LblCreateBill.Location = New System.Drawing.Point(157, 58)
Me.LblCreateBill.Name = "LblCreateBill"
Me.LblCreateBill.Size = New System.Drawing.Size(94, 24)
Me.LblCreateBill.TabIndex = 3
Me.LblCreateBill.Text = "Create Bill"
'
'LblChild
'
Me.LblChild.AutoSize = True
Me.LblChild.Font = New System.Drawing.Font("Microsoft Sans Serif", 11.25!,
System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.LblChild.Location = New System.Drawing.Point(55, 98)
Me.LblChild.Name = "LblChild"
Me.LblChild.Size = New System.Drawing.Size(49, 18)
Me.LblChild.TabIndex = 4
Me.LblChild.Text = "Child: "
'
'LblChildForename
'
Me.LblChildForename.AutoSize = True
Me.LblChildForename.Location = New System.Drawing.Point(73, 121)
Me.LblChildForename.Name = "LblChildForename"
Me.LblChildForename.Size = New System.Drawing.Size(60, 13)
Me.LblChildForename.TabIndex = 5
Me.LblChildForename.Text = "Forename: "
'
'LblChildSurname
'
Me.LblChildSurname.AutoSize = True
Me.LblChildSurname.Location = New System.Drawing.Point(222, 121)
Me.LblChildSurname.Name = "LblChildSurname"
Me.LblChildSurname.Size = New System.Drawing.Size(55, 13)
Me.LblChildSurname.TabIndex = 6
Me.LblChildSurname.Text = "Surname: "
'
'BtnSearch
'
Me.BtnSearch.Location = New System.Drawing.Point(161, 168)
Me.BtnSearch.Name = "BtnSearch"
Me.BtnSearch.Size = New System.Drawing.Size(75, 23)
Me.BtnSearch.TabIndex = 7
Me.BtnSearch.Text = "Search"
Me.BtnSearch.UseVisualStyleBackColor = True
'
'LblParent
'
Me.LblParent.AutoSize = True

Playgroup System - Technical Solution


Amara Maiden

Me.LblParent.Font = New System.Drawing.Font("Microsoft Sans Serif", 11.25!,


System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.LblParent.Location = New System.Drawing.Point(55, 262)
Me.LblParent.Name = "LblParent"
Me.LblParent.Size = New System.Drawing.Size(55, 18)
Me.LblParent.TabIndex = 8
Me.LblParent.Text = "Parent:"
'
'LblParentForename
'
Me.LblParentForename.AutoSize = True
Me.LblParentForename.Location = New System.Drawing.Point(73, 290)
Me.LblParentForename.Name = "LblParentForename"
Me.LblParentForename.Size = New System.Drawing.Size(60, 13)
Me.LblParentForename.TabIndex = 9
Me.LblParentForename.Text = "Forename: "
'
'LblParentSurname
'
Me.LblParentSurname.AutoSize = True
Me.LblParentSurname.Location = New System.Drawing.Point(222, 290)
Me.LblParentSurname.Name = "LblParentSurname"
Me.LblParentSurname.Size = New System.Drawing.Size(55, 13)
Me.LblParentSurname.TabIndex = 10
Me.LblParentSurname.Text = "Surname: "
'
'LblHoursAttended
'
Me.LblHoursAttended.AutoSize = True
Me.LblHoursAttended.Location = New System.Drawing.Point(73, 211)
Me.LblHoursAttended.Name = "LblHoursAttended"
Me.LblHoursAttended.Size = New System.Drawing.Size(137, 13)
Me.LblHoursAttended.TabIndex = 11
Me.LblHoursAttended.Text = "Hours attended this month: "
'
'LblGvnmtFunding
'
Me.LblGvnmtFunding.AutoSize = True
Me.LblGvnmtFunding.Location = New System.Drawing.Point(222, 209)
Me.LblGvnmtFunding.Name = "LblGvnmtFunding"
Me.LblGvnmtFunding.Size = New System.Drawing.Size(155, 13)
Me.LblGvnmtFunding.TabIndex = 12
Me.LblGvnmtFunding.Text = "Eligible for government funding:"
'
'LblAmountToPay
'
Me.LblAmountToPay.AutoSize = True
Me.LblAmountToPay.Location = New System.Drawing.Point(64, 340)
Me.LblAmountToPay.Name = "LblAmountToPay"
Me.LblAmountToPay.Size = New System.Drawing.Size(126, 13)
Me.LblAmountToPay.TabIndex = 13

Playgroup System - Technical Solution


Amara Maiden

Me.LblAmountToPay.Text = "Amount for parent to pay:"


'
'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

Playgroup System - Technical Solution


Amara Maiden

Me.RadBtnYes.Location = New System.Drawing.Point(229, 228)


Me.RadBtnYes.Name = "RadBtnYes"
Me.RadBtnYes.Size = New System.Drawing.Size(43, 17)
Me.RadBtnYes.TabIndex = 22
Me.RadBtnYes.TabStop = True
Me.RadBtnYes.Text = "Yes"
Me.RadBtnYes.UseVisualStyleBackColor = True
'
'RadBtnNo
'
Me.RadBtnNo.AutoSize = True
Me.RadBtnNo.Location = New System.Drawing.Point(305, 228)
Me.RadBtnNo.Name = "RadBtnNo"
Me.RadBtnNo.Size = New System.Drawing.Size(39, 17)
Me.RadBtnNo.TabIndex = 23
Me.RadBtnNo.TabStop = True
Me.RadBtnNo.Text = "No"
Me.RadBtnNo.UseVisualStyleBackColor = True
'
'ComBoxForename
'
Me.ComBoxForename.FormattingEnabled = True
Me.ComBoxForename.Location = New System.Drawing.Point(76, 137)
Me.ComBoxForename.Name = "ComBoxForename"
Me.ComBoxForename.Size = New System.Drawing.Size(121, 21)
Me.ComBoxForename.TabIndex = 24
'
'ComBoxSurname
'
Me.ComBoxSurname.FormattingEnabled = True
Me.ComBoxSurname.Location = New System.Drawing.Point(225, 137)
Me.ComBoxSurname.Name = "ComBoxSurname"
Me.ComBoxSurname.Size = New System.Drawing.Size(121, 21)
Me.ComBoxSurname.TabIndex = 25
'
'FormCreateBill
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(427, 434)
Me.Controls.Add(Me.ComBoxSurname)
Me.Controls.Add(Me.ComBoxForename)
Me.Controls.Add(Me.RadBtnNo)
Me.Controls.Add(Me.RadBtnYes)
Me.Controls.Add(Me.TxtAmountToPay)
Me.Controls.Add(Me.TxtParentSurname)
Me.Controls.Add(Me.TxtParentForename)
Me.Controls.Add(Me.TxtHoursAttended)
Me.Controls.Add(Me.BtnPrint)
Me.Controls.Add(Me.BtnEmail)
Me.Controls.Add(Me.LblAmountToPay)

Playgroup System - Technical Solution


Amara Maiden

Me.Controls.Add(Me.LblGvnmtFunding)
Me.Controls.Add(Me.LblHoursAttended)
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

Playgroup System - Technical Solution


Amara Maiden

Technical Solution - Completeness

Quantitative System Objective 1


My system should have a feature that allows the user to easily add a new record/file with 2-3
minutes. As the creation of the new file’s outline is done by the system, the user only needs
to type in the required information which speeds up the process of adding a new file.

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;

Playgroup System - Technical Solution


Amara Maiden

Quantitative System Objective 2


My system should allow the user to edit the files and save changes within 1-2 minutes. This
will be an improvement on the current system because edits can be made almost instantly
with the user only having to remove the old information and replace it with the new
information instead of having to create a whole new file at times.

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;

Playgroup System - Technical Solution


Amara Maiden

Quantitative System Objective 3


My system should have a feature that allows the user to delete whole files at a time, within
seconds. This will be an improvement on the current system as when a digital file is deleted
it is much harder to get back in comparison to a paper file that is simply put in a rubbish bin.

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;

Playgroup System - Technical Solution


Amara Maiden

Qualitative System Objective 1


It is also important that my system has a log on screen in order to improve security.
Currently, if a file is left unattended then potentially anyone could access it which would
breach the security of the children at the playgroup. Having a computer based with a logon
screen means that only authorised people can access the system and files.

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;

Playgroup System - Technical Solution


Amara Maiden

Qualitative System Objective 2


My program needs to have an easy to user interface which is consistent throughout the
whole program to ensure that the user is able to work the system with ease and without any
confusion.

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;

Playgroup System - Technical Solution


Amara Maiden

Quantitative Processing Objective 1


For integrity to be achieved it is important that each calculation is accurate, correct answers
should be displayed to the user within 5 seconds. Accuracy can also be ensured by applying
verification methods that ensure the data entered is within a certain range, is of a certain
data type etc.

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;

Private Sub Calculate()


'calculates the amount to pay
Dim GvmntFunding As Boolean
'declares variable
TxtAmountToPay.Text = TxtHoursAttended.Text * 8
'amount to pay equals the hours attended times by the standard hourly rate (8 GBP)

If GvmntFunding = True Then


TxtAmountToPay.Text = TxtAmountToPay.Text - (TxtAmountToPay.Text / 4)
'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
‘Subroutine from ‘FormCreateBill’

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’

Playgroup System - Technical Solution


Amara Maiden

Quantitative Processing Objective 2


Calculations/queries should be performed within 5 seconds. This will be an improvement on
the current system as calculations done by a person are often performed a lot slower in
comparison to a computer.

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;

Private Sub Calculate()


'calculates the amount to pay
Dim GvmntFunding As Boolean
'declares variable
TxtAmountToPay.Text = TxtHoursAttended.Text * 8
'amount to pay equals the hours attended times by the standard hourly rate (8 GBP)

If GvmntFunding = True Then


TxtAmountToPay.Text = TxtAmountToPay.Text - (TxtAmountToPay.Text / 4)
'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
‘Subroutine from ‘FormCreateBill’

Playgroup System - Technical Solution


Amara Maiden

Qualitative User Objective 1


The user should be able to easily navigate through the system and receive the information
they need.

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;

Playgroup System - Technical Solution


Amara Maiden

Qualitative User Objective 2


The user should be assigned a username and password that allows them to use the system.
This is an improvement on the current system as it means only authorised people can
access the system and the files.

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;

Playgroup System - Technical Solution


Amara Maiden

Technical Solution - Techniques Used

Group A - Dynamic SQL

I have used dynamic SQL throughout mu program as almost all of the queries that are made
to the server need an input from the user in order to determine which records need to be
returned.

FormLogin;

Query = "SELECT Password FROM tbl_LoginInfo WHERE Username = '" & Username & "'"

ModuleGlobal;

Query = "INSERT INTO tbl_BillingInfo ( ParentForename, ParentSurname, ContactNumber,


ParentAddress, ParentEmail ) VALUES ( 'John', 'Smith', '12345678912', '21 Testroad, Testown, TE12
ST9', 'johnsmith@test.com' )"

FormEditChildRecord;

Query = ("UPDATE tbl_ChildInfo SET ChildID = '" & TxtChildID.Text & "' WHERE Forename = '" &
ComBoxChild.Text & "'")

Query = ("UPDATE tbl_ChildInfo SET Forename = '" & TxtForename.Text & "' WHERE Forename = '"
& ComBoxChild.Text & "'")

FormEditStaffMember;

Query = "UPDATE" & Table & " SET " & Column & " = " & Text & "'WHERE" & ConstColumn & "='" &
ConstText & "'”

Playgroup System - Technical Solution


Amara Maiden

Query = "UPDATE tbl_LoginInfo SET Forename" & TxtForenameChange.Text & " WHERE Forename
= '" & Forename & "' AND Surname = '" & Surname & "'"

Group A - CASE-Generated DDL Statements

The DDL within my program is dependant on whether the database exists or not. When the
program is started up, a query is executed in order to check the number of tables that are
present within the database. If zero is returned then the DDL statements are executed.

FormLogin;
Private Sub FormLogin_Load(sender As Object, e As EventArgs) Handles MyBase.Load
'this subroutine runs when the form first loads
TxtUsername.Focus()
'makes the username textbox the focus
Dim Setup As Boolean
Dim Query As String
Dim COMMAND As MySqlCommand
Dim Tables As Integer
'Declares the variables that will be needed for the initial SQL query
'checks whether the database has been set up
ModuleGlobal.GetDatabaseInformation(ServerIp, ServerUsername, ServerPassword,
DatabaseName)
'gets info for database connection
If ServerIp = "" And ServerPassword = "" And ServerUsername = "" And DatabaseName = ""
Then
'checks to see whether the variables for database connection have been set
'if they have not then the database information form is displayed
'so user can input correct info
MessageBox.Show("Database information not found, please enter the right information",
"Database settings error", MessageBoxButtons.OK)
FormDbInfo.ShowDialog()
End If

If Not Connect Is Nothing Then Connect.Close()

Playgroup System - Technical Solution


Amara Maiden

Connect.ConnectionString = String.Format("server = {0}; user id = {1}; password = {2}; database


= {3}; pooling = false", ServerIp, ServerUsername, ServerPassword, DatabaseName)
Try
Connect.Open()
'opens the connection to the database

Query = "select count(*) from information_schema.tables where table_type = 'BASE TABLE'


and table_schema = '" & DatabaseName & "';"
COMMAND = New MySqlCommand(Query, Connect)
Tables = COMMAND.ExecuteScalar
'sets query to check for tables in database

If Tables > 0 Then


Setup = True
Else
Setup = False
End If
'if no tables are found then value of setup is set to true
Catch ex As Exception
MessageBox.Show(ex.Message)
Setup = False
FormDbInfo.ShowDialog()
End Try
'the exception handler is used to show an error message to the user
'as well as database connection info form
'if query fails
Connect.Close()
'closes the connection

If Setup = False Then


'takes correct action due to value assigned to setup
Dim Result = MessageBox.Show("The database has not been setup, would you like to run the
installation process?", "Create the database?", MessageBoxButtons.YesNo)
'asks the user if they want to set up a new database tables
If Result = Windows.Forms.DialogResult.Yes Then
ModuleGlobal.CreateTables()
Else
'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

ModuleGlobal;
Public Sub CreateTables()
'subroutine is called when program is started up by user, used to setup database
Dim DatabaseName As String = ""

Playgroup System - Technical Solution


Amara Maiden

Dim ServerIP As String = ""


Dim ServerUsername As String = ""
Dim ServerPassword As String = ""

GetDatabaseInformation(ServerIP, ServerUsername, ServerPassword, DatabaseName)


'calls subroutine
If Not Connect Is Nothing Then Connect.Close()
'checks to see whether there is any existing database connections
'if there is then they are closed
Connect.ConnectionString = String.Format("Server={0}; StaffID={1}; Password={2};
Database={3}; pooling=false", ServerIP, ServerUsername, ServerPassword, DatabaseName)
'sets the format of the connection string
Try
Connect.Open()
'opens database connection
MessageBox.Show("Connection established, the tables will now be created.", "Connection has
been made.", MessageBoxButtons.OK)

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 = "INSERT INTO tbl_Login ( Username, Password, StaffID, Admin ) VALUES (


'Username' , '" & "' Password', 'Staff01', 1 )"
COMMAND = New MySqlCommand(Query, Connect)
COMMAND.ExecuteNonQuery()
COMMAND.Dispose()
'inserts test/default values into 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 = "INSERT INTO tbl_StaffInfo ( StaffID, Forename, Surname, Position ) VALUES (


'Staff01', 'John', 'Smith', 'Test' )"
COMMAND = New MySqlCommand(Query, Connect)
COMMAND.ExecuteNonQuery()
COMMAND.Dispose()
'inserts test/default values into the staff info table

Playgroup System - Technical Solution


Amara Maiden

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

Query = "INSERT INTO tbl_ChildInfo (ChildID, Forename, Surname, ChildMedicalNeeds,


MedicineNeeded) VALUES ( 'ChildO1' , 'Sarah', 'Smith', 'Asthma', 'Inhaler' ) "
COMMAND = New MySqlCommand(Query, Connect)
COMMAND.ExecuteNonQuery()
COMMAND.Dispose()
'inserts test/default values into the child info table

Query = "CREATE TABLE tbl_PaymentInfo (HoursAttended SINGLE(00.0),


GvmntFundingEligibility BIT(1), TotalToPay CURRENCY(000.00), AmountCoveredByGvmnt
CURRENCY(000.00), AmountToPayByParent CURRENCY(000.00) ) "
COMMAND = New MySqlCommand(Query, Connect)
COMMAND.ExecuteNonQuery()
COMMAND.Dispose()
'inserts test/default values into the child info table

Query = "INSERT INTO tbl_PaymentInfo (HoursAttended, GvmntFundingEligibility,


TotalToPay, AmountCoveredByGvmnt, AmountToPayByParent) VALUES ( 15.5, 1, 450.00, 200.00,
250.00 )"
COMMAND = New MySqlCommand(Query, Connect)
COMMAND.ExecuteNonQuery()
COMMAND.Dispose()
'inserts test/default values into the payment info table

Query = "CREATE TABLE tbl_BillingInfo ( ParentForename VARCHAR(25) ,


ParentSurname VARCHAR(35) , ContactNumber VARCHAR(11), ParentAddress VARCHAR (70),
ParentEmail VARCHAR(40) ) "
COMMAND = New MySqlCommand(Query, Connect)
COMMAND.ExecuteNonQuery()
COMMAND.Dispose()
'inserts test/default values into the billing info table

Query = "INSERT INTO tbl_BillingInfo ( ParentForename, ParentSurname, ContactNumber,


ParentAddress, ParentEmail ) VALUES ( 'John', 'Smith', '12345678912', '21 Testroad, Testown, TE12
ST9', 'johnsmith@test.com' )"
COMMAND = New MySqlCommand(Query, Connect)
COMMAND.ExecuteNonQuery()
COMMAND.Dispose()
'inserts test/default values into the billing info table

Connect.Close()
'closes connection to the database

Playgroup System - Technical Solution


Amara Maiden

Messagebox.Show("Database Created.", "Database.", MessageBoxButtons.OK)


Catch ex As Exception
'exception handlers user to stop the program from crashing

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 Su

Group A - Aggregate SQL Functions

The aggregate functions within my program are used to count the number of tables within
the database. This allows the program to know whether the correct database has connected
to or whether the database even exists.

FormLogin;
Query = "select count(*) from information_schema.tables where table_type = 'BASE TABLE' and
table_schema = '" & DatabaseName & "';"
COMMAND = New MySqlCommand(Query, Connect)
Tables = COMMAND.ExecuteScalar
'sets query to check for tables in database

Playgroup System - Technical Solution


Amara Maiden

Group A - Complex Data Model

The data for my program is stored in a complex database which consists of 5 joined tables.

Playgroup System - Technical Solution


Amara Maiden

Group B - Writing and Reading from Files

There are two instances within my program where data needs o be written to or stored within
text files; the database connection information and information required in the global module.
Both of these instances use the I/O reader and writer in order to read/write the required data.

ModuleGlobal;
Public Sub GetDatabaseInformation(ByRef ServerIP As String, ByRef ServerUsername As String,
ByRef ServerPassword As String, ByRef DatabaseName As String)
'gets and assigns the database connection string information
Using StreamReader As StreamReader = New StreamReader
ServerIP = StreamReader.ReadLine()
DatabaseName = StreamReader.ReadLine()
ServerUsername = StreamReader.ReadLine()
ServerPassword = StreamReader.ReadLine()
End Using
End Sub

FormDbInfo;
If ValidConnection = True Then
Using StreamWriter As StreamWriter = New StreamWriter
StreamWriter.WriteLine(TxtServerIP.Text)
StreamWriter.WriteLine(TxtDatabaseName.Text)
StreamWriter.WriteLine(TxtPassword.Text)
End Using

Me.Close()
Else

Playgroup System - Technical Solution


Amara Maiden

MessageBox.Show("Connection has not been made. Ensure you have entered the right
details.", "Connection error.", MessageBoxButtons.OK)
End If

Playgroup System - Technical Solution

You might also like