コード例 #1
0
        /// <summary>
        /// 窗体加载事件
        /// </summary>
        private void FrmRight_UserMenuButton_Load(object sender, EventArgs e)
        {
            try
            {
                tvwUserRight.Nodes.Clear();
                new FrmMainBLL().InitTreeList(tvwUserRight);
                FrmRightBLL.TreeAddButtonsNode(tvwUserRight);

                InitControl();
            }
            catch (Exception ex)
            {
                ExceptionHandler.HandleException(this.Text + "--窗体加载事件错误。", ex);
            }
        }
コード例 #2
0
ファイル: FrmRight.cs プロジェクト: RD-IT/RDPSAP
        private void dgvUserList_SelectionChanged(object sender, EventArgs e)
        {
            if (dgvUserList.CurrentRow != null)
            {
                cboRoleName.Text = "";
                mnsRight.Items.Clear();
                FrmMainBLL.InitMenuItem(mnsRight);                                                            //初始化权限菜单
                FrmMainBLL.SetMenuItemByRole(mnsRight, dgvUserList.CurrentRow.Cells[5].Value.ToString());     //初始化用户权限
                FrmMainBLL.SetMenuItemByPersonal(mnsRight, dgvUserList.CurrentRow.Cells[0].Value.ToString()); //初始化用户"个人"权限

                //初始化treeView1
                tvwUserRight.Nodes.Clear();
                FrmRightBLL.TreeGetNodeForMns(tvwUserRight, mnsRight);
                tvwUserRight.ExpandAll();
                FrmRightBLL.TreeAddButtonsNode(tvwUserRight, dgvUserList.CurrentRow.Cells[0].Value.ToString());//遍历窗口中的按钮,加到指定的Tree的叶子节点上
            }
        }