Example #1
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);
            }
        }