login

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Nov 2007
Posts: 2
Reputation: sisey is an unknown quantity at this point 
Solved Threads: 0
sisey sisey is offline Offline
Newbie Poster

login

 
0
  #1
Nov 22nd, 2007
when a user logs in i want assign a particular form to him depending on the user name he entered. that means different forms for different users.im using oledbdataadapter to connect to sql. i will appreciate your help.thanks
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 2,641
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Solved Threads: 245
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: login

 
0
  #2
Nov 23rd, 2007
you mean that when user finished login, user access
a form in accordance with the rules?
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 2
Reputation: sisey is an unknown quantity at this point 
Solved Threads: 0
sisey sisey is offline Offline
Newbie Poster

Re: login

 
0
  #3
Nov 29th, 2007
Originally Posted by Jx_Man View Post
you mean that when user finished login, user access
a form in accordance with the rules?
yes
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 2,641
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Solved Threads: 245
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: login

 
0
  #4
Nov 29th, 2007
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.
  1. If cmbRole.SelectedIndex = 0 Then
  2. If dtUser1.Rows(0).Item(0) = Trim(txtUserId.Text) Then 'checking user id
  3. If dtUser2.Rows(0).Item(0) = Trim(txtPasw.Text) Then ' cheking password
  4. If dtUser.Rows(0).Item("ID_ROLE") = 1 Then ' cheking role
  5. Dim menu As New Menu_Utama
  6. Menu.Show()
  7. Me.Dispose(False)
  8. Else
  9. MsgBox("You not Admin")
  10. End If
  11. Else
  12. MsgBox("Wrong password!!", MsgBoxStyle.Critical, "Password Error")
  13. End If
  14. Else
  15. MsgBox("Your User Id is not valid", MsgBoxStyle.Critical, "Wrong User_Id")
  16. End If
  17. Else
  18. If cmbRole.SelectedIndex = 1 Then
  19. If dtUser1.Rows(0).Item(0) = Trim(txtUserId.Text) Then 'checking user id
  20. If dtUser2.Rows(0).Item(0) = Trim(txtPasw.Text) Then ' cheking password
  21. If dtUser.Rows(0).Item("ID_ROLE") = 2 Then ' cheking role
  22. Dim menu As New Menu_Utama
  23. Menu.Show()
  24. Menu.mnUser.Enabled = False
  25. Menu.BarMenu.Buttons(6).Enabled = False
  26. Me.Dispose(False)
  27. Else
  28. MsgBox("You not Headmaster")
  29. End If
  30. Else
  31. MsgBox("Wrong Password!!", MsgBoxStyle.Critical, "Password Error")
  32. End If
  33. Else
  34. MsgBox("Your User Id is not valid", MsgBoxStyle.Critical, "Wrong User_Id")
  35. End If
  36. End If
  37. End If
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.
Last edited by cscgal; Nov 29th, 2007 at 11:40 pm. Reason: Added code tags
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the VB.NET Forum


Views: 1586 | Replies: 3
Thread Tools Search this Thread



Tag cloud for VB.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC