コード例 #1
0
        // グリッドビュー上のボタン押下時、モジュールフォームを閲覧モードで開く、デレゲートあり
        private void dgvBoxId_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            int currentRow = int.Parse(e.RowIndex.ToString());

            if (dgvTray.Columns[e.ColumnIndex] == openTray && currentRow >= 0)
            {
                //既にfrmModuleInTray が開かれている場合は、それを閉じるよう促す
                if (TfGeneral.checkOpenFormExists("frmModuleInTray"))
                {
                    MessageBox.Show("Please close the currently open form.", "Notice",
                                    MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button2);
                    return;
                }

                string   trayId   = dgvTray["tray_id", currentRow].Value.ToString();
                DateTime trayDate = (DateTime)dgvTray["register_date", currentRow].Value;
                string   shift    = VBS.Right(trayId, 3);
                bool     canceled = !String.IsNullOrEmpty(dgvTray["cl_dept", currentRow].Value.ToString());
                bool     packed   = !String.IsNullOrEmpty(dgvTray["pack_id", currentRow].Value.ToString());

                // モジュールテキストボックスが空でない、かつチェックボックスがオン、かつ検索結果が1行の場合のみ、再プリントモードを有効
                bool reprintMode = (txtModuleId.Text.Length != 0 && cbxModuleId.Checked && dtTray.Rows.Count == 1);

                frmModuleInTray fM = new frmModuleInTray();
                //子イベントをキャッチして、データグリッドを更新する
                fM.RefreshEvent += delegate(object sndr, EventArgs excp)
                {
                    updateDataGridViews(dtTray, ref dgvTray, false);
                    this.Focus();
                };

                fM.updateControls(trayId, trayDate, userId, txtLoginName.Text, txtLoginDept.Text, userRole, shift, false, false, canceled, packed, 1, false, reprintMode);
                fM.Show();
            }
        }
コード例 #2
0
        // QAのスーパーユーザーは、トレーの一部モジュールのキャンセルができる
        private void btnPartiallyCancel_Click(object sender, EventArgs e)
        {
            if (dtTray.Rows.Count == 0)
            {
                return;
            }
            // セルの選択範囲が2列以上の場合は、メッセージの表示のみでプロシージャを抜ける
            if (dgvTray.Columns.GetColumnCount(DataGridViewElementStates.Selected) >= 2 ||
                dgvTray.Rows.GetRowCount(DataGridViewElementStates.Selected) >= 2 || dgvTray.CurrentCell.ColumnIndex != 0)
            {
                MessageBox.Show("Please select only one tray id.", "Notice", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2);
                return;
            }
            //既にfrmModuleInTray が開かれている場合は、それを閉じるよう促す
            if (TfGeneral.checkOpenFormExists("frmModuleInTray"))
            {
                MessageBox.Show("Please close the currently open form.", "Notice", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            int      currentRow = dgvTray.CurrentCell.RowIndex;
            string   trayId     = dgvTray["tray_id", currentRow].Value.ToString();
            DateTime trayDate   = (DateTime)dgvTray["register_date", currentRow].Value;
            string   shift      = VBS.Right(trayId, 3);
            bool     canceled   = !String.IsNullOrEmpty(dgvTray["cl_dept", currentRow].Value.ToString());
            bool     packed     = !String.IsNullOrEmpty(dgvTray["pack_id", currentRow].Value.ToString());

            if (canceled || packed)
            {
                MessageBox.Show("The tray id is already canceled or packed.", "Notice", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            frmModuleInTray fM = new frmModuleInTray();

            //子イベントをキャッチして、データグリッドを更新する
            fM.RefreshEvent += delegate(object sndr, EventArgs excp)
            {
                updateDataGridViews(dtTray, ref dgvTray, false);
                this.Focus();
            };

            fM.updateControls(trayId, trayDate, userId, txtLoginName.Text, txtLoginDept.Text, userRole, shift, false, false, canceled, packed, 1, true, false);
            fM.Show();
        }
コード例 #3
0
        // モジュールフォームを追加モードで開く(BIN:A)
        private void btnAddBoxId_Click(object sender, EventArgs e)
        {
            if (TfGeneral.checkOpenFormExists("frmModuleInTray"))
            {
                MessageBox.Show("Please close the currently open form.", "Notice",
                                MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button2);
                return;
            }

            frmModuleInTray fM = new frmModuleInTray();

            //子イベントをキャッチして、データグリッドを更新する
            fM.RefreshEvent += delegate(object sndr, EventArgs excp)
            {
                updateDataGridViews(dtTray, ref dgvTray, false);
                this.Focus();
            };

            fM.updateControls(String.Empty, DateTime.Now, userId, txtLoginName.Text, txtLoginDept.Text, userRole, string.Empty, true, false, false, false, 1, false, false);
            fM.Show();
        }
コード例 #4
0
        //トレーグリッドビュー上のボタンのクリックで、formModuleInTrayを呼び出し、対応するモジュールを表示する(デレゲートなし)
        private void dgvTray_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            int currentRow = int.Parse(e.RowIndex.ToString());

            if (dgvTray.Columns[e.ColumnIndex] == openTray && currentRow >= 0)
            {
                //既にfrmModuleInTray が開かれている場合は、それを閉じるよう促す
                if (TfGeneral.checkOpenFormExists("frmModuleInTray"))
                {
                    MessageBox.Show("Please close the currently open form.", "Notice",
                                    MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button2);
                    return;
                }

                string   trayId   = dgvTray["tray_id", currentRow].Value.ToString();
                string   line     = VBS.Right(trayId, 1);
                DateTime trayDate = (DateTime)dgvTray["register_date", currentRow].Value;

                //デレゲートなし。当トレーフォームのフォーム位置が2の場合は、モジュールフォームの位置は3。それ以外は2。
                frmModuleInTray fM = new frmModuleInTray();
                fM.updateControls(trayId, trayDate, "", txtLoginName.Text, txtLoginDept.Text, userRole, line, false, false, true, true, 4, false, false);
                fM.Show();
            }
        }