Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
1.50/5 (2 votes)
See more:
How can I develop a menu driven program - means as per user they can get access the application in c# desktop/windows application.

thanks
payraj
Posted
Updated 7-Mar-11 20:17pm
v2
Comments
pankajupadhyay29 8-Mar-11 1:44am    
what have you done for this so far, what you want to do in that application.
amitkarnik2211 8-Mar-11 2:07am    
Can u be more Specific
payraj143 8-Mar-11 22:55pm    
yes sure i give an example.
there are 3 roles like student,administer and counsilor.
admin have all rights, counselor have inquiry and fee collection rights and student have only right to see timetable and marks etc.
i have table in database for roles also but hoe can i give rights at the login time???

thanks
payraj1412

You got to control this from backend and should have a table for which user what what rights. And further you got to enable or diable the feature in your Menus.
 
Share this answer
 
at the login time you should save the UserId in a static variable to be able to read this variable in all your project.
and when you are creating your menu you should check if this user have the rights to enable or disable it, also you can itterate your controls inside the screen to enable and disble it according to the rights.
so your table may contain 3 fields:
WindowName,controlname (buttons,texts...),usersEnable(contain the ID of the users that have the rights to access this control in this screen)
when you want to check the rights,you can select the usersenabled where userid = (the staticvariable you initialized in login time) and you will get users with comma separated list and you will check if the ID logged in is inside the list.
Sorry for not coding, but may be i help in the algorithm :)
gd luck
 
Share this answer
 
I have Downloaded the Similar Project u can use source code for Reference from here
http://www.c-sharpcorner.com/UploadFile/rahul4_saxena/1130/[^]

This is a small office management system. With the help of this project all office employee can connect with each other, request online leave, get birthday reminders, get status of present/absent employees and use an automatic attendence system when logged in and logged out. Just need to install and setup of this project to every machine.
In this project there are 2 types of users one is Employee of a office and other is Admin. An Admin has full access for this project. I am showing every right of both types of user in the following DFD.
 
Share this answer
 

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