Professional Documents
Culture Documents
Login Button
If txtUserName.Text = "" Then
DialogResult = MessageBox.Show("Username textbox cannot be empty.", "Stop",
MessageBoxButtons.OK, MessageBoxIcon.Warning)
ElseIf Not Regex.Match(txtUserName.Text, "^[a-z]*$").Success Then
DialogResult = MessageBox.Show("Username can only contain 15 or less lower
case letters.", "Stop", MessageBoxButtons.OK, MessageBoxIcon.Warning)
ElseIf Len(txtUserName.Text) > 15 Then
DialogResult = MessageBox.Show("Username can only contain 15 or less lower
case letters.", "Stop", MessageBoxButtons.OK, MessageBoxIcon.Warning)
ElseIf Char.IsUpper(txtUserName.Text) Then
DialogResult = MessageBox.Show("Username can only contain 15 or less lower
case letters.", "Stop", MessageBoxButtons.OK, MessageBoxIcon.Warning)
ElseIf txtPassword.Text = "" Then
DialogResult = MessageBox.Show("Password textbox cannot be empty.", "Stop",
MessageBoxButtons.OK, MessageBoxIcon.Warning)
ElseIf Len(txtPassword.Text) > 8 Then
DialogResult = MessageBox.Show("Password should be 8 or less characters
long.", "Stop", MessageBoxButtons.OK, MessageBoxIcon.Warning)
ElseIf txtUserName.Text = "munashe" And txtPassword.Text = "47494749" Then
DialogResult = MessageBox.Show("Login Was Successful.", "Welcome",
MessageBoxButtons.OK, MessageBoxIcon.Information)
Form3.Show()
Me.Hide()
Else
DialogResult = MessageBox.Show("Invalid Username or Password.", "Error",
MessageBoxButtons.RetryCancel, MessageBoxIcon.Error)
End If
Exit Button
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles iExit.Click
Dim iExit As DialogResult
iExit = MessageBox.Show("Confirm if you want to exit system.", "Login
Form", MessageBoxButtons.YesNo, MessageBoxIcon.Information)
If iExit = DialogResult.Yes Then
Me.Close()
Else
Me.Show()
End If
End Sub
CLEAR BUTTON
ADDING USERS
Search Button
Private Sub Button6_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button6.Click
Me.UsersBindingSource.Filter = "FullName LIKE'" & TextBox14.Text & "%'"
If TextBox14.Text = "" Then
DialogResult = MessageBox.Show("Search textbox should not be empty", "Error",
MessageBoxButtons.OK, MessageBoxIcon.Error)
ElseIf Not Regex.Match(TextBox14.Text, "^[a-z]*$").Success Then
DialogResult = MessageBox.Show("Only enter user's name.", "Wait",
MessageBoxButtons.OK, MessageBoxIcon.Warning)
End If
End Sub
End Sub
CLEAR BUTTON
UserBindingNavigatorSaveItem_Click
Private Sub UsersBindingNavigatorSaveItem_Click_6(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles UsersBindingNavigatorSaveItem.Click
Me.Validate()
Me.UsersBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.Spar_Users_FormDataSet)
Form 2
End Sub
ADDNEW BUTTON
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
BindingNavigatorAddNewItem.PerformClick()
SAVE BUTTON
Public Class Form2
NEXT BUTTON
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button3.Click
BindingNavigatorMoveNextItem.PerformClick()
PREVIOUS BUTTON
DELETE BUTTON
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button7.Click
BindingNavigatorDeleteItem.PerformClick()
End Sub
ADDING CANDIDATES
FORM 6
Private Sub Form6_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load
'TODO: This line of code loads data into the
'Spar_Candidates_Recruit_FormDataSet.Candidates' table. You can move, or remove it, as
needed.
Me.CandidatesTableAdapter1.Fill(Me.Spar_Candidates_Recruit_FormDataSet.Candidates)
SEARCH BUTTON
Private Sub Button6_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button6.Click
Me.CandidatesBindingSource.Filter = "FullName LIKE'" & TextBox2.Text & "%'"
If TextBox2.Text = "" Then
DialogResult = MessageBox.Show("Search textbox cannot be empty.", "Wait",
MessageBoxButtons.OK, MessageBoxIcon.Warning)
ElseIf Not Regex.Match(TextBox2.Text, "^[a-z]*$").Success Then
DialogResult = MessageBox.Show("Only enter candidates name.", "Wait",
MessageBoxButtons.OK, MessageBoxIcon.Warning)
End If
End Sub
End Sub
End Sub
Candidates BindingNavigator Save Item_Click
Private Sub CandidatesBindingNavigatorSaveItem_Click_4(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles CandidatesBindingNavigatorSaveItem.Click
Me.Validate()
Me.CandidatesBindingSource.EndEdit()
Me.TableAdapterManager1.UpdateAll(Me.Spar_Candidates_Recruit_FormDataSet)
End Sub
End Class
ADDNEW BUTTON
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
BindingNavigatorAddNewItem.PerformClick()
End Sub
PREVIOUS BUTTON
SAVE BUTTON
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button2.Click
CandidatesBindingNavigatorSaveItem.PerformClick()
NEXT BUTTON
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button3.Click
BindingNavigatorMoveNextItem.PerformClick()
End Sub
CLEAR BUTTON
End Sub
EXIT BUTTON
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles iExit.Click
Dim iExit As DialogResult
iExit = MessageBox.Show("Confirm if you want to exit", "Candidates Recruitment
Form", MessageBoxButtons.YesNo, MessageBoxIcon.Information)
If iExit = DialogResult.Yes Then
Form3.Show()
Me.Hide()
Else
Me.Show()
End If
End Sub
DELETE BUTTON
End Sub
End If
End Sub
Form 8
Public Class Form8
Me.CandidatesTableAdapter1.Fill(Me.Spar_Candidates_Recruit_FormDataSet.Candidates)
txtJobTitle.Items.Add("Manager")
txtJobTitle.Items.Add("Sales Accountant")
txtJobTitle.Items.Add("Clerk")
End Sub
Search Button
Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button8.Click
If TextBox1.Text Then
DialogResult = MessageBox.Show("Search textbox cannot be empty.", "Wait",
MessageBoxButtons.OK, MessageBoxIcon.Warning)
ElseIf Not Regex.Match(TextBox1.Text, "^[a-z]*$").Success Then
DialogResult = MessageBox.Show("Only enter candidate's name.", "Wait",
MessageBoxButtons.OK, MessageBoxIcon.Warning)
End If
End Sub
End Sub
TextBox1.Clear()
End Sub
Addnew Button
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
BindingNavigatorAddNewItem.PerformClick()
End Sub
Save Button
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button4.Click
CandidatesBindingNavigatorSaveItem.PerformClick()
End Sub
Previous Button
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button3.Click
BindingNavigatorMovePreviousItem.PerformClick()
End Sub
Next Button
Private Sub Button6_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button6.Click
BindingNavigatorMoveNextItem.PerformClick()
End Sub
Delete Button
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button7.Click
BindingNavigatorDeleteItem.PerformClick()
End Sub
Link Button
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button2.Click
If TextBox14.Text = txtJobQualifications.Text Then
DialogResult = MessageBox.Show(txtFullName.Text & " qualified for job
position.", "Match Found", MessageBoxButtons.OK, MessageBoxIcon.Information)
Else
DialogResult = MessageBox.Show("Candidate is not a match for the job
position.", "Error", MessageBoxButtons.OKCancel, MessageBoxIcon.Error)
End If
End Sub
Exit Button
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles iExit.Click
Dim iExit As DialogResult
iExit = MessageBox.Show("Confirm if you want to exit", "Job Profile Linking
Form", MessageBoxButtons.YesNo, MessageBoxIcon.Information)
If iExit = DialogResult.Yes Then
Form3.Show()
Me.Hide()
Else
Me.Show()
End If
End Sub
CandidatesBindingNavigatorSaveItem_Click
Private Sub CandidatesBindingNavigatorSaveItem_Click_4(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles CandidatesBindingNavigatorSaveItem.Click
Me.Validate()
Me.CandidatesBindingSource.EndEdit()
Me.TableAdapterManager1.UpdateAll(Me.Spar_Candidates_Recruit_FormDataSet)
End Sub
Search Button
Private Sub Button4_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button4.Click
Me.Placement_FormBindingSource.Filter = "FullName LIKE'" & TextBox3.Text & "%'"
If TextBox3.Text = "" Then
DialogResult = MessageBox.Show("Search textbox cannot be empty.", "Wait",
MessageBoxButtons.OK, MessageBoxIcon.Warning)
ElseIf Not Regex.Match(TextBox3.Text, "^[a-z]*$").Success Then
DialogResult = MessageBox.Show("Only enter applicant's name.", "Wait",
MessageBoxButtons.OK, MessageBoxIcon.Warning)
End If
End Sub
Clients_form_report.Show()
Me.Hide()
End Sub
Clear Button
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button5.Click
TextBox1.Clear()
TextBox2.Clear()
TextBox4.Clear()
TextBox5.Clear()
TextBox6.Clear()
TextBox7.Clear()
TextBox8.Clear()
TextBox9.Clear()
TextBox10.Clear()
End Sub
Save Button
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button2.Click
ClientsBindingNavigatorSaveItem.PerformClick()
If TextBox1.Text = "" Then
DialogResult = MessageBox.Show("ID textbox cannot be empty.", "Error",
MessageBoxButtons.OK, MessageBoxIcon.Error)
ElseIf TextBox2.Text = "" Then
DialogResult = MessageBox.Show("FullName textbox cannot be empty.", "Error",
MessageBoxButtons.OK, MessageBoxIcon.Error)
ElseIf TextBox9.Text = "" Then
DialogResult = MessageBox.Show("Gender textbox cannot be empty.", "Error",
MessageBoxButtons.OK, MessageBoxIcon.Error)
End Sub
Next Button
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button3.Click
BindingNavigatorMoveNextItem.PerformClick()
End Sub
Previous Button
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button4.Click
BindingNavigatorMovePreviousItem.PerformClick()
End Sub
Delete Button
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button7.Click
BindingNavigatorDeleteItem.PerformClick()
End Sub
Exit Button