| | |
login
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
you must to have a main menu. u can add code in form login to disable sub menu agree with user role.
so when user finished login, user only chosen the sub menu or menu that user depending on.
ex :
Dim Menu As New Main_Menu
Menu.Show()
Menu.x.Enabled = False
x : menu or sub menu in main menu that u want to disable.
this my part project n have same like u. but i didn't use oledbdataadapter, just for comparison.
in my project, i have 2 user (Admin & Headmaster)
admin can utilize all menu or sub menu in Main Menu.
Headmaster have same like Admin but headmaster can't to use User Management (add or delete user).
ok.that is. hope this help.
so when user finished login, user only chosen the sub menu or menu that user depending on.
ex :
Dim Menu As New Main_Menu
Menu.Show()
Menu.x.Enabled = False
x : menu or sub menu in main menu that u want to disable.
this my part project n have same like u. but i didn't use oledbdataadapter, just for comparison.
VB.NET Syntax (Toggle Plain Text)
If cmbRole.SelectedIndex = 0 Then If dtUser1.Rows(0).Item(0) = Trim(txtUserId.Text) Then 'checking user id If dtUser2.Rows(0).Item(0) = Trim(txtPasw.Text) Then ' cheking password If dtUser.Rows(0).Item("ID_ROLE") = 1 Then ' cheking role Dim menu As New Menu_Utama Menu.Show() Me.Dispose(False) Else MsgBox("You not Admin") End If Else MsgBox("Wrong password!!", MsgBoxStyle.Critical, "Password Error") End If Else MsgBox("Your User Id is not valid", MsgBoxStyle.Critical, "Wrong User_Id") End If Else If cmbRole.SelectedIndex = 1 Then If dtUser1.Rows(0).Item(0) = Trim(txtUserId.Text) Then 'checking user id If dtUser2.Rows(0).Item(0) = Trim(txtPasw.Text) Then ' cheking password If dtUser.Rows(0).Item("ID_ROLE") = 2 Then ' cheking role Dim menu As New Menu_Utama Menu.Show() Menu.mnUser.Enabled = False Menu.BarMenu.Buttons(6).Enabled = False Me.Dispose(False) Else MsgBox("You not Headmaster") End If Else MsgBox("Wrong Password!!", MsgBoxStyle.Critical, "Password Error") End If Else MsgBox("Your User Id is not valid", MsgBoxStyle.Critical, "Wrong User_Id") End If End If End If
admin can utilize all menu or sub menu in Main Menu.
Headmaster have same like Admin but headmaster can't to use User Management (add or delete user).
ok.that is. hope this help.
Last edited by cscgal; Nov 29th, 2007 at 11:40 pm. Reason: Added code tags
![]() |
Similar Threads
- Windows XP slow login (Windows NT / 2000 / XP)
- network login problem (Windows NT / 2000 / XP)
- can't get past xp login (Windows NT / 2000 / XP)
- XP anf Novell Client Dual Login (Novell)
- Cannot Login to Mac (OS X)
- login screen config (Window and Desktop Managers)
Other Threads in the VB.NET Forum
- Previous Thread: Need help generating a Grand Total
- Next Thread: can not update combo box...
Views: 1586 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
"crystal .net .net2005 30minutes 2008 access add application arithmetic array assignment basic binary box button buttons center code combobox component connectionstring convert cpu data database databasesearch datagrid datagridview design dissertation dissertations dissertationthesis dll dosconsolevb.net editvb.net error excel firewall folder highlighting image images isnumericfuntioncall listview login math memory mobile ms mssqlbackend mysql navigate net opacity pan peertopeervideostreaming picturebox picturebox1 plugin port print printing printpreview problem problemwithinstallation project record reports" reuse save savedialog serial server sorting sql storedprocedure string structures studio temp textbox timer updown upload useraccounts usercontrol vb vb.net vb.netcode vb.nettoolboxvisualbasic2008sidebar vb2008 vbnet view visual visualbasic visualbasic.net visualstudio visualstudio2008 web wpf






