المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : retrive user rights from sql table



C# Programming
12-31-2009, 08:00 AM
I am using the following code to store public variables:

using System;
using System.Collections.Generic;
using System.Text;

namespace Takhlees
{
class public_class
{
// login;
private static string user_login;

public string login_user_login
{
get { return user_login; }
set { user_login = value; }
}

}
}

and I want to create a table called user_rights with user_right_code and user_right_value fields..... The user_right_value field will be a bit with True or False and the user_right_code will have something like:

ADD_OCCUPATION
EDIT_OCCUPATION
DELETE_OCCUPATION
BROWSE _OCCUPATIONS
BROWSE _GENDER
BROWSE_NATIONALITY
BROWSE_USERS
ADD_USER
EDIT_USER
RESET_PASSWORD
I want to know how can automatiocally retrive the user_right_code and user_right_value into public variables? do i have to create each and every code in the public_class?!!