Login button code for HR:
Private Sub Login_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles hrLogin.Click
frmMain.NameToolStripMenuItem.Text = TextBox1.Text
Dim hrManager As New HR_DatabaseManager() 'Class form name
Dim adminManager As New Admin_DatabaseManager ' Class form name
'checks if the user exist in HR Table
If CBool(hrManager.Login(TextBox1.Text, TextBox2.Text)) Then
MsgBox("Welcome to HR Department " & TextBox1.Text, MsgBoxStyle.Information + MsgBoxStyle.OkOnly, TextBox1.Text)
Me.Close()
frmMain.Show()
Else
MsgBox("Invalid Username or Password", MsgBoxStyle.Critical, "Please check your username or password")
End If
'checks if the user exist in the Admin table
If TextBox1.Text = "Admin" Or TextBox1.Text = "admin" Then
hrAdmin() ' name of my private sub that contains the code for checking if the data exist in the admin table
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
Login button Code for TR:
frmMain.NameToolStripMenuItem.Text = TextBox1.Text
Dim hrManager As New HR_DatabaseManager() 'Class form name
Dim adminManager As New Admin_DatabaseManager ' Class form name
'checks if the user exist in TR Table
If CBool(hrManager.Login(TextBox1.Text, TextBox2.Text)) Then
MsgBox("Welcome to HR Department " & TextBox1.Text, MsgBoxStyle.Information + MsgBoxStyle.OkOnly, TextBox1.Text)
Me.Close()
frmMain.Show()
Else
MsgBox("Invalid Username or Password", MsgBoxStyle.Critical, "Please check your username or password")
End If
'checks if the user exist in the Admin table
If TextBox1.Text = "Admin" Or TextBox1.Text = "admin" Then
trAdmin() ' name of my private sub that contains the code for checking if the data exist in the admin table
End If

New Topic/Question
Reply




MultiQuote





|