Click here to Skip to main content
15,912,400 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Dear Techs..

How to create user group mapping in C# with SQL server2005. I am using One Login form, MDI Form, and FORM_A, FORM_B, FORM_C AND FORM_D. if I am Administrator I can access all forms A,B,C,D. if I am not admin I want to access my privilege only. If privilege access only for FORM_A rest are disabled or in-visible.



Thanks & Regards
Sreeni..
Posted
Updated 5-Jun-14 23:42pm
v2
Comments
Herman<T>.Instance 6-Jun-14 5:48am    
what have you tried?
sreenivashan 6-Jun-14 5:58am    
Dear Digimanus: can you understand my Q: How to create user group mapping in C# with SQL server2005. I am using One Login form, MDI Form, and FORM_A, FORM_B, FORM_C AND FORM_D. if I am Administrator I can access all forms A,B,C,D. if I am not admin I want to access my privilege only. If privilege access only for FORM_A rest are disabled or in-visible.

1 solution

Hi,

Your database structure should be some what like the following structure:

SQL
Users Table:
UserId, FirstName,LastName

Roles Table:
RoleId,RoleName

RolesMapping Table:
RolesMapId, UserId,RoleId




Get the RoleIds after the user login then disable/enable the tabs accordingly to the roles.
 
Share this answer
 
Comments
sreenivashan 6-Jun-14 5:55am    
Users Table as Login:
txtUserName, txtPasswrod, CboType(Combo box). //Having as "ADMIN", "Supervisor", and "End User".

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900