user roles management using c# windows application

Last Reply on Mar 05, 2013 04:25 AM By Mustafa

Posted on Mar 05, 2013 04:12 AM

hi all,

i wana work on a windows forms application using c# that several users can work with different roles, for example 3 roles ,that "A role" only to access some parts of the program and cannot see and access it and "B role" can acess to entire of application, but some parts are just right to access and view, "C role" full access to all parts of the Application i have these roles and users in a database (sql server).

whats a good way for make this application?

 

 

 

thanks in advance...

Posted on Mar 05, 2013 04:25 AM Modified on on Mar 05, 2013 04:44 AM

You can get the role from the database when the user logs in the database based on his userid

Than you can write the if else statement to hide show controls

For example:

if(role.Trim().Toupper() == "A role")
{
  //Write the code to hide show respective controls
}
else if(role.Trim().Toupper() == "B role")
{
  //Write the code to hide show respective controls
}
else
{
  //Write the code to hide show respective controls
}

and see it will work as you want.

I agree, here is the link: https://www.e-iceblue.com/Introduce/spire-office-for-net-free.html