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

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

                string   cartonId   = dgvCarton["carton_id", currentRow].Value.ToString();
                DateTime cartonDate = (DateTime)dgvCarton["register_date", currentRow].Value;
                string   batch      = txtBatch.Text;
                bool     canceled   = !String.IsNullOrEmpty(dgvCarton["cl_user", currentRow].Value.ToString());
                bool     palleted   = !String.IsNullOrEmpty(dgvCarton["pallet_id", currentRow].Value.ToString());

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

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

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

            frmPackInCarton fP = new frmPackInCarton();

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

            fP.updateControls(String.Empty, DateTime.Now, userId, txtLoginName.Text, txtLoginDept.Text, userRole, string.Empty, true, false, false, false, 1, false);
            fP.Show();
        }
Ejemplo n.º 3
0
        //パックグリッドビュー上のボタンのクリックで、formTrayInPackを呼び出し、対応するトレーを表示する(デレゲートなし)
        private void dgvPack_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            int currentRow = int.Parse(e.RowIndex.ToString());

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

                string   packId   = dgvCarton["carton_id", currentRow].Value.ToString();
                string   batch    = dgvCarton["batch", currentRow].Value.ToString();
                DateTime packDate = (DateTime)dgvCarton["register_date", currentRow].Value;

                //デレゲートなし
                frmPackInCarton fT = new frmPackInCarton();
                fT.updateControls(packId, packDate, "", txtLoginName.Text, txtLoginDept.Text, userRole, batch, false, false, true, true, 2, false);
                fT.Show();
            }
        }