Ejemplo n.º 1
0
        private void FrmUserRight_Load(object sender, EventArgs e)
        {
            // TODO: 这行代码将数据加载到表“dsPSAP.BS_Menu”中。您可以根据需要移动或删除它。
            this.bS_MenuTableAdapter.Fill(this.dsPSAP.BS_Menu);
            // TODO: 这行代码将数据加载到表“dsPSAP.BS_Role”中。您可以根据需要移动或删除它。
            this.bS_RoleTableAdapter.Fill(this.dsPSAP.BS_Role);
            // TODO: 这行代码将数据加载到表“dsPSAP.BS_Department”中。您可以根据需要移动或删除它。
            this.bS_DepartmentTableAdapter.Fill(this.dsPSAP.BS_Department);

            dtblTmp = BSCommon.getUserInfoList("", "", "");
            dgvUserList.DataSource                  = dtblTmp;
            dgvUserList.ColumnHeadersHeight         = 32;
            dgvUserList.Columns[0].Width            = 40;
            dgvUserList.Columns[1].Width            = 60;
            dgvUserList.Columns[2].Width            = 60;
            dgvUserList.Columns[3].Width            = 90;
            dgvUserList.Columns[4].Width            = 90;
            dgvUserList.Columns[5].Width            = 60;
            dgvUserList.Columns[0].DataPropertyName = dtblTmp.Columns["AutoId"].ToString();
            dgvUserList.Columns[1].DataPropertyName = dtblTmp.Columns["LoginID"].ToString();
            dgvUserList.Columns[2].DataPropertyName = dtblTmp.Columns["EmpName"].ToString();
            dgvUserList.Columns[3].DataPropertyName = dtblTmp.Columns["DepartmentName"].ToString();
            dgvUserList.Columns[4].DataPropertyName = dtblTmp.Columns["RoleName"].ToString();
            dgvUserList.Columns[5].DataPropertyName = dtblTmp.Columns["RoleNo"].ToString();
            dgvUserList.Columns[0].HeaderText       = "员工编号";
            dgvUserList.Columns[1].HeaderText       = "用户编号";
            dgvUserList.Columns[2].HeaderText       = "用户姓名";
            dgvUserList.Columns[3].HeaderText       = "部门";
            dgvUserList.Columns[4].HeaderText       = "角色";
            dgvUserList.Columns[5].HeaderText       = "角色编号";
            dgvUserList.Columns[0].Visible          = false;
            dgvUserList.Columns[5].Visible          = false;

            dtblTmp1 = BSCommon.getDepartmentList();
            cboDepartmentName.DataSource    = dtblTmp1;
            cboDepartmentName.DisplayMember = "DepartmentName";

            //角色combo
            dtblTmp1 = BSCommon.getRoleList();
            cboRoleName.DataSource    = dtblTmp1;
            cboRoleName.DisplayMember = "RoleName";
            cboRoleName.ValueMember   = "RoleNo";

            //初始化【菜单管理page】
            mnsMainMenu.Items.Clear();
            FrmMainBLL.InitMenuItem(mnsMainMenu);//初始化主菜单
            FrmRightBLL.TreeGetNodeForMns(tvwMainMenu, mnsMainMenu);
            tvwMainMenu.ExpandAll();
            FrmRightBLL.InitDataGridViewComboFormName(dataGridViewComboFormName); //初始化窗口名下拉列表
            FrmRightBLL.TraverseFormControlToTable();                             // 遍历所有DockContent窗口及其中控件,并将结果加至数据库表中(系统完成后可停用)

            //初始化【角色管理page】
            InitEnableState();//初始化控件按钮状态
        }
Ejemplo n.º 2
0
 private void dgvRoleList_SelectionChanged(object sender, EventArgs e)
 {
     if (dgvRoleList.CurrentRow != null)
     {
         mnsRight.Items.Clear();
         FrmMainBLL.InitMenuItem(mnsRight);                                                        //初始化权限菜单
         FrmMainBLL.SetMenuItemByRole(mnsRight, dgvRoleList.CurrentRow.Cells[1].Value.ToString()); //初始化角色权限
         tvwRoleRight.Nodes.Clear();
         FrmRightBLL.TreeGetNodeForMns(tvwRoleRight, mnsRight);
         tvwRoleRight.ExpandAll();
         //FrmRightBLL.TreeAddButtonsNode(tvwRoleRight, dgvUserList.CurrentRow.Cells[0].Value.ToString());//遍历窗口中的按钮,加到指定的Tree的叶子节点上
     }
 }
Ejemplo n.º 3
0
        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的叶子节点上
            }
        }
Ejemplo n.º 4
0
        public static MenuStrip mnsMain = new MenuStrip();//主菜单

        public FrmMain()
        {
            frmMain = this;
            InitializeComponent();
            toolStripContainer1.TopToolStripPanel.Controls.Add(mnsMain);
            //PSAP.BLL.BSBLL.BSBLL.InitUserMenus(this);//初始化主菜单用户权限(不用了这是以前设置实例菜单的)
            FrmMainBLL.InitMenuItem(mnsMain);                                             //初始化菜单
            FrmMainBLL.SetMenuItemByRole(mnsMain, SystemInfo.user.RoleNo);                //初始化用户"角色"权限
            FrmMainBLL.SetMenuItemByPersonal(mnsMain, SystemInfo.user.AutoId.ToString()); //初始化用户"个人"权限
            //FrmMainTool frmMainTool = new FrmMainTool(mnsMain);//menuStrip1(实例菜单)
            ////frmMainTool.HideOnClose = true;//使用就无法触发窗口关闭事件了
            //frmMainTool.Show(this.dockPanel1, DockState.DockLeft);

            //BSBLL.RefreshUserThemeConfigFile();//刷新用户主题配置文件(暂不用了)
            BSBLL.InitThemeVariable();//初始化主题变量(暂不用了)

            if (SystemInfo.user.Lanuage != "Chinese")
            {
                BSBLL.SetFormLanguages(this);//设置DockContent中的语种
            }
        }