Beispiel #1
0
        private void FrmMain_Load(object sender, EventArgs e)
        {
            InitToolBarButtonAction();
            BaseForm firstTab = null;

            if (Factory.Create <AuthLogic>().Auth(GObj.SYSTEM_FUNCTION_USER))
            {
                _frmUser = new FrmUser();
                _frmUser.Show(dockPanel);
                firstTab = _frmUser;
                _frmDict.Add(tool_User.Text, _frmUser);
            }
            if (Factory.Create <AuthLogic>().Auth(GObj.SYSTEM_FUNCTION_DEPARTMENT))
            {
                _frmDep = new FrmDepartment();
                _frmDep.Show(dockPanel);
                if (firstTab == null)
                {
                    firstTab = _frmDep;
                }
                _frmDict.Add(tool_Dep.Text, _frmDep);
            }
            if (Factory.Create <AuthLogic>().Auth(GObj.SYSTEM_FUNCTION_ROLE))
            {
                _frmRole = new FrmRole();
                _frmRole.Show(dockPanel);
                if (firstTab == null)
                {
                    firstTab = _frmRole;
                }
                _frmDict.Add(tool_Role.Text, _frmRole);
            }
            if (Factory.Create <AuthLogic>().Auth(GObj.SYSTEM_FUNCTION_FUNCTION))
            {
                _frmFun = new FrmFunction();
                _frmFun.Show(dockPanel);
                if (firstTab == null)
                {
                    firstTab = _frmFun;
                }
                _frmDict.Add(tool_Function.Text, _frmFun);
            }

            if (firstTab != null)
            {
                firstTab.Show(dockPanel);
            }
            //在底部状态栏显示当前登录的用户信息
            lblCurrentUser.Text = string.Format("当前管理员:{0}", GObj.CurrentUser.UserRealName);
        }
Beispiel #2
0
        private void InitTabPage()
        {
            BaseForm firstTab = null;

            if (Factory.Create <AuthLogic>().Auth(GObj.SYSTEM_FUNCTION_USER))
            {
                _frmUser = new FrmUser();
                _frmUser.Show(dockPanel);
                firstTab          = _frmUser;
                tool_User.Enabled = true;
                _frmDict.Add(tool_User.Text, _frmUser);
            }
            if (Factory.Create <AuthLogic>().Auth(GObj.SYSTEM_FUNCTION_DEPARTMENT))
            {
                _frmDep = new FrmDepartment();
                _frmDep.Show(dockPanel);
                if (firstTab == null)
                {
                    firstTab = _frmDep;
                }
                tool_Dep.Enabled = true;
                _frmDict.Add(tool_Dep.Text, _frmDep);
            }
            if (Factory.Create <AuthLogic>().Auth(GObj.SYSTEM_FUNCTION_ROLE))
            {
                _frmRole = new FrmRole();
                _frmRole.Show(dockPanel);
                if (firstTab == null)
                {
                    firstTab = _frmRole;
                }
                tool_Role.Enabled = true;
                _frmDict.Add(tool_Role.Text, _frmRole);
            }
            if (Factory.Create <AuthLogic>().Auth(GObj.SYSTEM_FUNCTION_FUNCTION))
            {
                _frmFun = new FrmFunction();
                _frmFun.Show(dockPanel);
                if (firstTab == null)
                {
                    firstTab = _frmFun;
                }
                tool_Function.Enabled = true;
                _frmDict.Add(tool_Function.Text, _frmFun);
            }
            if (Factory.Create <AuthLogic>().Auth(GObj.SYSTEM_FUNCTION_TEMPLATE))
            {
                _frmTemp = new FrmTemplate();
                _frmTemp.Show(dockPanel);
                if (firstTab == null)
                {
                    firstTab = _frmTemp;
                }
                tool_Template.Enabled = true;
                _frmDict.Add(tool_Template.Text, _frmTemp);
            }

            if (firstTab != null)
            {
                firstTab.Show(dockPanel);
            }
        }