Ejemplo n.º 1
0
        private void openModuleSelectionUserControl()
        {
            //如果没有SelectModule权限,则回到登录页面

            if (this.user != null &&
                (this.userPreference == null || this.userPreference.Value == null || this.userPreference.Value == string.Empty ||
                 this.userPreference.Value == BusinessConstants.TRANSFORMER_MODULE_TYPE_SELECTION))
            {
                if (isPrintMonitor.ToLower() == "true")
                {
                    this.autoLogoutTimer.Enabled = false;
                    this.lbCountDown.Visible     = false;
                    this.RemoveOldControls();
                    this.WindowState = FormWindowState.Maximized;
                    UCPrintMonitor ucPrintMonitor = new UCPrintMonitor(this.user, BusinessConstants.TRANSFORMER_MODULE_TYPE_PRINTING);
                    ucPrintMonitor.Anchor = System.Windows.Forms.AnchorStyles.None;
                    ucPrintMonitor.Size   = new System.Drawing.Size(this.Width, this.Height);
                    this.plMain.Controls.Add(ucPrintMonitor);
                    this.ActiveControl = ucPrintMonitor;
                    ucPrintMonitor.Focus();
                    return;
                }

                if (isBatchDevanning.ToLower() == "true")
                {
                    this.autoLogoutTimer.Enabled = false;
                    this.lbCountDown.Visible     = false;
                    this.RemoveOldControls();
                    this.WindowState = FormWindowState.Maximized;
                    UCBatchDevanning ucBatchDevanning = new UCBatchDevanning(this.user, BusinessConstants.TRANSFORMER_MODULE_TYPE_BATCH_DEVANNING);
                    ucBatchDevanning.Anchor = System.Windows.Forms.AnchorStyles.None;
                    ucBatchDevanning.Size   = new System.Drawing.Size(this.Width, this.Height);
                    this.plMain.Controls.Add(ucBatchDevanning);
                    this.ActiveControl = ucBatchDevanning;
                    ucBatchDevanning.Focus();
                    return;
                }

                this.lbCountDown.Visible = false;
                this.RemoveOldControls();
                this.WindowState = FormWindowState.Maximized;
                UCModuleSelection ucModuleSelection = new UCModuleSelection(this.user);
                ucModuleSelection.Anchor = System.Windows.Forms.AnchorStyles.None;
                // ucModuleSelection.Location = new System.Drawing.Point((this.Width - 400) / 2, (this.Height - 300) / 2);
                ucModuleSelection.Size = new System.Drawing.Size(this.Width, this.Height);
                ucModuleSelection.ModuleSelectionEvent += new ModuleSelectionHandler(this.ModuleSelectionCallback);
                this.plMain.Controls.Add(ucModuleSelection);
                this.ActiveControl = ucModuleSelection;
                ucModuleSelection.Focus();
            }
            else
            {
                this.Logout();
            }
        }
Ejemplo n.º 2
0
        private void openModuleSelectionUserControl()
        {
            //如果没有SelectModule权限,则回到登录页面

            if (this.user != null &&
                (this.userPreference == null || this.userPreference.Value == null || this.userPreference.Value == string.Empty
                || this.userPreference.Value == BusinessConstants.TRANSFORMER_MODULE_TYPE_SELECTION))
            {
                if (isPrintMonitor.ToLower() == "true")
                {
                    this.autoLogoutTimer.Enabled = false;
                    this.lbCountDown.Visible = false;
                    this.RemoveOldControls();
                    this.WindowState = FormWindowState.Maximized;
                    UCPrintMonitor ucPrintMonitor = new UCPrintMonitor(this.user, BusinessConstants.TRANSFORMER_MODULE_TYPE_PRINTING);
                    ucPrintMonitor.Anchor = System.Windows.Forms.AnchorStyles.None;
                    ucPrintMonitor.Size = new System.Drawing.Size(this.Width, this.Height);
                    this.plMain.Controls.Add(ucPrintMonitor);
                    this.ActiveControl = ucPrintMonitor;
                    ucPrintMonitor.Focus();
                    return;
                }

                if (isBatchDevanning.ToLower() == "true")
                {
                    this.autoLogoutTimer.Enabled = false;
                    this.lbCountDown.Visible = false;
                    this.RemoveOldControls();
                    this.WindowState = FormWindowState.Maximized;
                    UCBatchDevanning ucBatchDevanning = new UCBatchDevanning(this.user, BusinessConstants.TRANSFORMER_MODULE_TYPE_BATCH_DEVANNING);
                    ucBatchDevanning.Anchor = System.Windows.Forms.AnchorStyles.None;
                    ucBatchDevanning.Size = new System.Drawing.Size(this.Width, this.Height);
                    this.plMain.Controls.Add(ucBatchDevanning);
                    this.ActiveControl = ucBatchDevanning;
                    ucBatchDevanning.Focus();
                    return;
                }

                this.lbCountDown.Visible = false;
                this.RemoveOldControls();
                this.WindowState = FormWindowState.Maximized;
                UCModuleSelection ucModuleSelection = new UCModuleSelection(this.user);
                ucModuleSelection.Anchor = System.Windows.Forms.AnchorStyles.None;
                // ucModuleSelection.Location = new System.Drawing.Point((this.Width - 400) / 2, (this.Height - 300) / 2);
                ucModuleSelection.Size = new System.Drawing.Size(this.Width, this.Height);
                ucModuleSelection.ModuleSelectionEvent += new ModuleSelectionHandler(this.ModuleSelectionCallback);
                this.plMain.Controls.Add(ucModuleSelection);
                this.ActiveControl = ucModuleSelection;
                ucModuleSelection.Focus();
            }
            else
            {
                this.Logout();
            }
        }