Пример #1
0
        private void frmMain_Shown(object sender, EventArgs e)
        {
            try
            {
                frmLogin frmLogin = new frmLogin();
                frmLogin.ShowDialog();

                //アプリケーションのタイトル
                //   string AppTitle = ConfigurationManager.AppSettings["ApplicationTitle"] + "  " + "自動印刷ソフト";
                string AppTitle = ConfigurationManager.AppSettings["ApplicationTitle"] + "  " + "";
                this.Text = AppTitle;

                txtStartProcess.Clear();
                txtStartProcess.AppendText("自動アップロード処理を開始する場合は" + Environment.NewLine);
                txtStartProcess.AppendText("下のボタンを押してください。");

                txtStopProcess.Clear();
                txtStopProcess.AppendText("自動アップロード処理を終了する場合は" + Environment.NewLine);
                txtStopProcess.AppendText("下のボタンを押してください。");

                //最後にログインしたユーザーの情報を取得する
                _UserId         = frmLogin.LoginId;
                _Pwd            = frmLogin.LoginPwd;
                _CurrentPrinter = ConfigurationManager.AppSettings["CurrentPrinter"] + "";

                string _ontime = ConfigurationManager.AppSettings["Ontime"] + "";
                string _delay  = ConfigurationManager.AppSettings["Delay"] + "";


                //if (_CurrentPrinter.Trim() != "")
                if (_ontime.Trim() != "" || _delay.Trim() != "")
                {
                    //Trường hợp đã thiết lập ontime và delay
                    btnStartPrintProcess.Visible = true;
                    txtStartProcess.Visible      = true;
                    mnuStartProcess.Enabled      = true;
                    mnuStopProcess.Enabled       = false;
                }
                else
                {
                    //Trường hợp chưa thiết lập ontime và delay - yêu cầu nhập để tiếp tục
                    btnStartPrintProcess.Visible = false;
                    txtStartProcess.Visible      = false;
                    mnuStartProcess.Enabled      = false;
                    MessageBox.Show("プリンタ設定してください。", "システム警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    frmSetting frmPrinterSetting = new frmSetting();
                    frmPrinterSetting.ShowDialog();
                }
            }
            catch (Exception ex)
            {
                logger.LogException(ex);
            }
        }
Пример #2
0
        private void mnuPrinterSetting_Click(object sender, EventArgs e)
        {
            frmSetting frmPrinterSetting = new frmSetting();

            frmPrinterSetting.ShowDialog();
        }