Example #1
0
        private void ManageImpowers_Load(object sender, System.EventArgs e)
        {
            List <Role> allRoles = Role.GetAll();

            foreach (Role role in allRoles)
            {
                repositoryItemComboBox1.Items.Add(role.Name);
            }
            //初始化权限列表
            Privileges privileges = new Privileges();

            repositoryItemLookUpEdit1.DisplayMember = "Name";
            repositoryItemLookUpEdit1.ValueMember   = "Id";
            repositoryItemLookUpEdit1.DataSource    = privileges.LoadAll();

            Impowers ps = new Impowers();

            impowerList             = ps.LoadAll();
            gridControl1.DataSource = impowerList;
        }
        private void DataPrivileges_Load(object sender, System.EventArgs e)
        {
            //初始化资源列表
            Resources res = new Resources();

            repositoryItemLookUpEdit1.DisplayMember = "Name";
            repositoryItemLookUpEdit1.ValueMember   = "ResId";
            repositoryItemLookUpEdit1.DataSource    = res.LoadAll();

            // //初始化动作列表
            Actions acts = new Actions();

            repositoryItemLookUpEdit2.DisplayMember = "Name";
            repositoryItemLookUpEdit2.ValueMember   = "ActionId";
            repositoryItemLookUpEdit2.DataSource    = acts.LoadAll();

            Privileges ps = new Privileges();

            pList = ps.LoadAll();
            gridControl1.DataSource = pList;
        }