Click here to Skip to main content
15,895,799 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi all...

i am creating a software in window application using c#...there are many problem to create admin page...how to create sub admin and how to give limited power to sub admin..there are many problem to create adin page...it any one can provide ...admin page implemented project..

please help me
Posted
Comments
[no name] 25-Oct-12 2:39am    
What have you done till now to create admin page. post some code if possible
Devendra 1988 25-Oct-12 2:44am    
actually..i am working on stock and billing management Software...you know all about this type of software...
OriginalGriff 25-Oct-12 2:58am    
Yes - but we don't know what you have done so far, so we don't know how what we do will fit in.
Tell us what you have, so we can work round it, and help fix your problem.
Or did you expect us to write the whole thing for you?
Sushil Mate 25-Oct-12 2:57am    
How can someone give you admin page code which exactly matches your requirements. you better start doing by yourself. see don't grab everything. if it is difficult, divide the work, try with simple one. step by step you can achieve everything. as per your requirements its not that much difficult. how proficient you are in programming? you might need database here. so my advice is start with small & simple requirement.
Hope this helps :)
[no name] 25-Oct-12 3:21am    
This could be done by Database.. For that you need to fire some appropriate query..
With this help, yet you are not able to get the proble solved then show us your code that you have tried so far... All the Best :)

1 solution

Hints:
You can create a class to define the privileges of a user.
Example:
C#
public class User
{
    public Privilege UserType { get; set; }
    public string UserName { get; set; }

    public enum Privilege
    {
        Admin,
        Supervisor,
        User
    }
}

After that, you can initialize the user any where in your application. Then you can hide or show the items that are allowed to be viewed by the user based on his/her privilege.
Example:
C#
public Form2()
{
    InitializeComponent();
    User user = new User();
    user.UserType = User.Privilege.Admin;

    button_Admin.Visible = false;
    button_Supervisor.Visible = false;
    button_User.Visible = false;

    switch (user.UserType)
    {
        case User.Privilege.Admin:
            button_Admin.Visible = true;
            button_Supervisor.Visible = true;
            button_User.Visible = true;
            break;
        case User.Privilege.Supervisor:
            button_Supervisor.Visible = true;
            button_User.Visible = true;
            break;
        case User.Privilege.User:
            button_User.Visible = true;
            break;
        default:
            break;
    }
}
 
Share this answer
 
Comments
Kislay Raj 25-Oct-12 8:31am    
ya that'll work
Devendra 1988 25-Oct-12 8:42am    
it is vry helpful ..but i can't use in my project..please explani how to implent it
adriancs 25-Oct-12 9:25am    
Why you can't use it in your project?
Akkywadhwa 25-Oct-12 9:08am    
5ed!
Devendra 1988 26-Oct-12 0:15am    
i am enable to use this code

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