示例#1
0
        // サブプロシージャ:モジュールの登録、充填モード
        private void registerModuleRefillMode()
        {
            string trayCurrent = txtTrayId.Text;

            //モジュールテーブルの補充前レコードを一旦削除し、トレーテーブルの更新履歴を追加する
            bool res1 = updateTrayIdAndDeleteModule(trayCurrent, txtLoginDept.Text, txtLoginName.Text);

            if (!res1)
            {
                MessageBox.Show("An error happened in the tray id updating process.", "Process Result", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            //モジュールテーブルへ、データテーブルのレコードを一括登録する
            TfSQL tf   = new TfSQL();
            bool  res2 = tf.sqlMultipleInsertModule(dtModule, trayCurrent);

            if (res2)
            {
                //ラベルのプリントアウト
                TfSato tfs = new TfSato();
                tfs.printStart("tray", txtTrayId.Text, dtLot, string.Empty, dtpRegisterDate.Value, string.Empty, string.Empty, 1, string.Empty);

                //親フォームfrmTrayのデータグリットビューを更新するため、デレゲートイベントを発生させる
                this.RefreshEvent(this, new EventArgs());
                this.Focus();
                MessageBox.Show("Tray ID: " + trayCurrent + Environment.NewLine +
                                "and its modules were updated.", "Process Result", MessageBoxButtons.OK, MessageBoxIcon.Information);

                //ユーザーによるメッセージボックス確認後の処理
                formAddMode    = false;
                formRefillMode = false;
                updateDataGridViews(dtModule, ref dgvModule);

                //閉じるボタンみ有効として、閉じることを促す
                cmbBinShift.Enabled        = false;
                txtModuleId.Enabled        = false;
                btnRegisterTray.Enabled    = false;
                btnDeleteSelection.Enabled = false;
                btnChangeCapacity.Enabled  = false;
            }
        }
示例#2
0
        // サブプロシージャ:モジュールの登録、通常モード
        private void registerModuleNormalMode()
        {
            // 2016.08.10 FUJII  トレーIDの新規採番プロシージャ「GetNewTrayId」を、トランザクション処理バージョンへ変更
            //トレーIDの新規採番
            //string trayNew = getNewTrayId(txtLoginDept.Text, txtLoginName.Text, VBS.Mid(maxLot, 8, 1), cmbBinShift.Text);
            TfSQL  tf      = new TfSQL();
            string trayNew = tf.sqlGetNewTrayId(txtLoginDept.Text, txtLoginName.Text, VBS.Mid(maxLot, 8, 1), cmbBinShift.Text, maxLot, dtLot, ref registerDate);

            if (trayNew == string.Empty)
            {
                MessageBox.Show("An error happened in the tray id issuing process.", "Process Result", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            //モジュールテーブルへ、データテーブルのレコードを一括登録する
            bool res = tf.sqlMultipleInsertModule(dtModule, trayNew);

            if (res)
            {
                //ラベルのプリントアウト
                TfSato tfs = new TfSato();
                tfs.printStart("tray", trayNew, dtLot, string.Empty, dtpRegisterDate.Value, string.Empty, string.Empty, 1, string.Empty);

                //登録済みの状態を表示
                txtTrayId.Text        = trayNew;
                dtpRegisterDate.Value = registerDate;

                //親フォームfrmTrayのデータグリットビューを更新するため、デレゲートイベントを発生させる
                this.RefreshEvent(this, new EventArgs());
                this.Focus();
                MessageBox.Show("Tray ID: " + trayNew + Environment.NewLine +
                                "and its modules were registered.", "Process Result", MessageBoxButtons.OK, MessageBoxIcon.Information);

                //ユーザーによるメッセージボックス確認後の処理
                txtTrayId.Text   = String.Empty;
                txtModuleId.Text = String.Empty;
                dtModule.Clear();
                capacity = 24;
                updateDataGridViews(dtModule, ref dgvModule);
            }
        }