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

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

                string   palletId   = dgvPallet["pallet_id", currentRow].Value.ToString();
                DateTime palletDate = (DateTime)dgvPallet["register_date", currentRow].Value;
                string   batch      = txtBatch.Text;
                bool     canceled   = !String.IsNullOrEmpty(dgvPallet["cl_user", currentRow].Value.ToString());
                bool     invoiced   = !String.IsNullOrEmpty(dgvPallet["invoice_no", currentRow].Value.ToString());

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

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

                fP.updateControls(palletId, palletDate, userId, txtLoginName.Text, txtLoginDept.Text, userRole, batch, false, false, canceled, invoiced, reprintMode);
                fP.Show();
            }
        }
예제 #2
0
        // frmTrayInPack を追加モードで開く、デレゲートあり
        private void btnAddBoxId_Click(object sender, EventArgs e)
        {
            if (TfGeneral.checkOpenFormExists("frmCartonOnPallet"))
            {
                MessageBox.Show("Please close the currently open form.", "Notice",
                                MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button2);
                return;
            }

            frmCartonOnPallet fP = new frmCartonOnPallet();

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

            fP.updateControls(String.Empty, DateTime.Now, userId, txtLoginName.Text, txtLoginDept.Text, userRole, string.Empty, true, false, false, false, false);
            fP.Show();
        }