Exemplo n.º 1
0
        private void LoadAllRole()
        {
            AllRoleID = new List<string>();
            this.comboBox2.Items.Clear();
            allRole = new List<string>();
            DataTable dt = new DataTable();
            DataTable dt_power = new DataTable();

            AllRole = new Dictionary<string, UsePurview>();
            dt = ds.Tables["S_Role"];

            dt_power.Columns.Add("ProgramID");
            dt_power.Columns.Add("Power");
            dt_power.PrimaryKey = new DataColumn[] { dt_power.Columns[0] };
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                allRole.Add(dt.Rows[i][1].ToString().Trim());
                AllRoleID.Add(dt.Rows[i][0].ToString().Trim());

                dt_power = DBUser.Get_ProgramIDByRole(dt.Rows[i][0].ToString().Trim());

                UsePurview temp_UsePurview = new UsePurview();
                temp_UsePurview.SetUserAttribute(dt.Rows[i][0].ToString().Trim(), dt.Rows[i][1].ToString().Trim(), dt_power);
                AllRole.Add(dt.Rows[i][0].ToString().Trim(), temp_UsePurview);

            }

            this.comboBox2.Items.AddRange(AllRoleID.ToArray());
        }
Exemplo n.º 2
0
 /// <summary>
 /// ��ǰ����ĸ������������ݣ�
 /// </summary>
 /// <returns></returns>
 public UsePurview Clone()
 {
     UsePurview Temp = new UsePurview();
     Temp.SetUserAttribute(this.id,this.RoleName,this.power == null ? null:this.power.Copy());
     return Temp;
 }