Exemplo n.º 1
0
        // 登録済みのカートンおよびその付帯情報を、UPDATE文で置き換える
        private void btnReplace_Click(object sender, EventArgs e)
        {
            if (cartonNg || dtCarton.Rows.Count <= 0)
            {
                return;
            }

            string mdlBefore = txtBefore.Text;
            string mdlAfter  = dtCarton.Rows[0]["carton_id"].ToString();

            // 更新処理
            TfSQL tf  = new TfSQL();
            bool  res = tf.sqlReplaceCartonOnPallet(palletId, txtBefore.Text, txtAfter.Text, user);

            if (res)
            {
                //親フォームfrmTrayのデータグリットビューを更新するため、デレゲートイベントを発生させる
                this.RefreshEvent(this, new EventArgs());
                btnReplaceCarton.Enabled = false;
                txtAfter.Enabled         = false;
                // txtRow.Text = string.Empty;
                this.Focus();
                MessageBox.Show("The replacement was successful." + Environment.NewLine +
                                "Please re-print the pallet label.", "Process Result", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button2);
            }
        }