Beispiel #1
0
        // frmPallet インボイス番号を登録
        private void btnOK_Click(object sender, EventArgs e)
        {
            string invoice = txtInvoiceNo.Text;

            if (invoice == string.Empty)
            {
                DialogResult result = MessageBox.Show("Selected cells' invoice no is to be updated." + Environment.NewLine +
                                                      "Is it OK?", "Notice", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2);
                if (result == DialogResult.No)
                {
                    return;
                }
            }

            TfSQL tf  = new TfSQL();
            bool  res = tf.sqlMultipleUpdateInvoiceOnPallet(cartonlist, invoice);

            if (res)
            {
                //本フォームのデータグリットビュー更新
                MessageBox.Show("The following carton IDs' invoice number were updated: " + Environment.NewLine + message, "Process Result", MessageBoxButtons.OK, MessageBoxIcon.Information);

                //親フォームfrmTrayのデータグリットビューを更新するため、デレゲートイベントを発生させる
                this.RefreshEvent(this, new EventArgs());
            }
            else
            {
                MessageBox.Show("Invoice number registration was not successful.", "Process Result", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            Close();
        }