views:

67

answers:

1

m creating a project on hospital management ...with C# code but the problem i m not able to do what i want ..... !. its like i want to create multiuser login like if admin will login with his/her id and password he/she can access all the field in the project but if cashier will login with his id and password he will only able to access the cash part...but for this m not able to write the specific code have tried many times but cant....please help me out..... thanks

A: 

You could start with having a LoggedInUserObject that holds the current logged in user. And see to that every user is connected to a UserRightLevel, for example Admin=1, Cashier=2, Doctor=3 and so on.

Then in every form/usercontrol that is used in the program, in the loadEvent check what userrightlevel the logged in user has and disable/enable buttons/menu options and so on according to that.

This can be done as easy as that or you can make a more advanced right system, using user/roles and connect rights to the different roles.

However, you have to program it by yourself, its no magic behind.

Stefan