///<summary>
        ///A0470_Hachusuhenko_Load
        ///画面レイアウト設定
        ///</summary>
        private void A0470_Hachusuhenko_Load(object sender, EventArgs e)
        {
            this.Show();
            this._Title = "発注数変更";

            // フォームでもキーイベントを受け取る
            this.KeyPreview = true;

            this.btnF01.Text = STR_FUNC_F1_HYOJII;
            this.btnF04.Text = STR_FUNC_F4;
            this.btnF05.Text = "F5:選択";
            this.btnF08.Text = "F8:更新";
            this.btnF09.Text = STR_FUNC_F9;
            this.btnF12.Text = STR_FUNC_F12;

            DataTable dtTantoshaCd = new DataTable();

            //ビジネス層のインスタンス生成
            A0470_Hachusuhenko_B hachusuhenkoB = new A0470_Hachusuhenko_B();

            try
            {
                //ログインIDから担当者コードを取り出す
                dtTantoshaCd = hachusuhenkoB.getEigyiCdSetUserID(SystemInformation.UserName);

                //担当者データがある場合
                if (dtTantoshaCd.Rows.Count > 0)
                {
                    //一行目にデータがない場合
                    if (dtTantoshaCd.Rows[0][0].ToString() == "")
                    {
                        return;
                    }

                    //本社の場合
                    if (dtTantoshaCd.Rows[0]["営業所コード"].ToString() == "0001")
                    {
                        radSet_3btn_Basho.radbtn1.Checked = true;
                    }
                    else
                    {
                        radSet_3btn_Basho.radbtn2.Checked = true;
                    }
                }
                else
                {
                    throw new Exception();
                }
            }
            catch (Exception ex)
            {
                // エラーロギング
                new CommonException(ex);

                // メッセージボックスの処理、削除失敗の場合のウィンドウ(OK)
                BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_VIEW, "失敗しました。", CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR);
                basemessagebox.ShowDialog();
            }

            SetUpGrid();
        }
        ///<summary>
        ///updKoshin
        ///データの更新
        ///</summary>
        private void updKoshin()
        {
            //変更する発注IDがない場合
            if (strHachuID == "")
            {
                return;
            }

            //発注数空チェック
            if (txtHachusu.blIsEmpty() == false)
            {
                // メッセージボックスの処理、項目が日付でない場合のウィンドウ(OK)
                BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_INPUT, "項目が空です。数値を入力してください。", CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR);
                basemessagebox.ShowDialog();

                txtHachusu.Focus();

                return;
            }

            //発注数の数値チェック
            if (txtHachusu.chkMoneyText())
            {
                // メッセージボックスの処理、項目が日付でない場合のウィンドウ(OK)
                BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_INPUT, "入力された数値が正しくありません。", CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR);
                basemessagebox.ShowDialog();

                txtHachusu.Focus();

                return;
            }

            //発注数が仕入数以下の場合
            if (int.Parse(txtHachusu.Text) < int.Parse(txtShiresu.Text))
            {
                //発注数が仕入数以下の場合のメッセージ(OK)
                BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_ERROR, "発注数は仕入数以上を入力してください", CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR);
                basemessagebox.ShowDialog();
                return;
            }

            //ビジネス層のインスタンス生成
            A0470_Hachusuhenko_B hachusuhenkoB = new A0470_Hachusuhenko_B();

            DBConnective con = null;

            KATO.Business.A0010_JuchuInput.A0010_JuchuInput_B juchuB = new KATO.Business.A0010_JuchuInput.A0010_JuchuInput_B();

            con = new DBConnective();

            try
            {
                DataTable dt = hachusuhenkoB.getHatchuData(strHachuID);
                hachusuhenkoB.updKoushin(txtHachusu.Text, strHachuID);

                if (dt != null && dt.Rows.Count > 0)
                {
                    con.BeginTrans();
                    juchuB.updZaiko(dt.Rows[0]["商品コード"].ToString(), dt.Rows[0]["営業所コード"].ToString(), dt.Rows[0]["納期"].ToString(), Environment.UserName, con);
                    con.Commit();
                }

                //メッセージボックスの処理、登録完了のウィンドウ(OK)
                BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_TOUROKU, CommonTeisu.LABEL_TOUROKU, CommonTeisu.BTN_OK, CommonTeisu.DIAG_INFOMATION);
                basemessagebox.ShowDialog();

                //下部のみ取消動作
                txtHinmei_Katashiki.Clear();
                txtHachusu.Clear();
                txtShiresu.Clear();
                txtTanka.Clear();

                //グリッド表示
                setHachusuhenko();
            }
            catch (Exception ex)
            {
                if (con != null)
                {
                    con.Rollback();
                }
                //エラーロギング
                new CommonException(ex);
                //例外発生メッセージ(OK)
                BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_ERROR, CommonTeisu.LABEL_ERROR_MESSAGE, CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR);
                basemessagebox.ShowDialog();
                return;
            }
        }
        ///<summary>
        ///setHachusuhenko
        ///該当データの表示
        ///</summary>
        private void setHachusuhenko()
        {
            //年月日の日付フォーマット後を入れる用
            string strYMDformat = "";

            //受注者コードと仕入先コードがない場合
            if (StringUtl.blIsEmpty(labelSet_Tantousha.CodeTxtText) == false &&
                StringUtl.blIsEmpty(labelSet_Torihikisaki.CodeTxtText) == false)
            {
                //メッセージボックスの処理、受注者コードと仕入先コードが空の場合のウィンドウ(OK)
                BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_INPUT, "発注者か仕入先を指定してください。", CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR);
                basemessagebox.ShowDialog();
                labelSet_Tantousha.Focus();
                return;
            }

            //発注者チェック
            if (labelSet_Tantousha.chkTxtTantosha())
            {
                labelSet_Tantousha.Focus();

                return;
            }

            //仕入先チェック
            if (labelSet_Torihikisaki.chkTxtTorihikisaki())
            {
                labelSet_Torihikisaki.Focus();

                return;
            }

            //検索開始年月日に記入がある場合
            if (baseCalendarOpen.blIsEmpty())
            {
                //日付フォーマット生成、およびチェック
                strYMDformat = baseCalendarOpen.chkDateDataFormat(baseCalendarOpen.Text);

                //検索開始年月日の日付チェック
                if (strYMDformat == "")
                {
                    // メッセージボックスの処理、項目が日付でない場合のウィンドウ(OK)
                    BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_INPUT, "入力された日付が正しくありません。", CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR);
                    basemessagebox.ShowDialog();

                    baseCalendarOpen.Focus();

                    return;
                }
                else
                {
                    baseCalendarOpen.Text = strYMDformat;
                }
            }

            //検索終了年月日に記入がある場合
            if (baseCalendarClose.blIsEmpty())
            {
                //初期化
                strYMDformat = "";

                //日付フォーマット生成、およびチェック
                strYMDformat = baseCalendarClose.chkDateDataFormat(baseCalendarClose.Text);

                //検索終了年月日の日付チェック
                if (strYMDformat == "")
                {
                    // メッセージボックスの処理、項目が日付でない場合のウィンドウ(OK)
                    BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_INPUT, "入力された日付が正しくありません。", CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR);
                    basemessagebox.ShowDialog();

                    baseCalendarClose.Focus();

                    return;
                }
                else
                {
                    baseCalendarClose.Text = strYMDformat;
                }
            }

            //発注数の数値チェック
            if (txtHachusu.chkMoneyText())
            {
                // メッセージボックスの処理、項目が日付でない場合のウィンドウ(OK)
                BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_INPUT, "入力された数値が正しくありません。", CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR);
                basemessagebox.ShowDialog();

                txtHachusu.Focus();

                return;
            }

            //グリッド表示のデータ渡し用
            List <string> lstStrSQL = new List <string>();

            //ビジネス層のインスタンス生成
            A0470_Hachusuhenko_B hachusuhenkoB = new A0470_Hachusuhenko_B();

            try
            {
                //発注者コード
                lstStrSQL.Add(labelSet_Tantousha.CodeTxtText);
                //仕入先コード
                lstStrSQL.Add(labelSet_Torihikisaki.CodeTxtText);
                //検索納期範囲(開始)
                lstStrSQL.Add(baseCalendarOpen.Text);
                //検索納期範囲(終了)
                lstStrSQL.Add(baseCalendarClose.Text);

                //場所ボタンセットの「すべて」にチェックがある場合
                if (radSet_3btn_Basho.radbtn0.Checked)
                {
                    lstStrSQL.Add("0");
                }
                //本社
                else if (radSet_3btn_Basho.radbtn1.Checked)
                {
                    lstStrSQL.Add("1");
                }
                //岐阜
                else
                {
                    lstStrSQL.Add("2");
                }

                //発注残ボタンセットの「発注残をすべて」にチェックがある場合
                if (radHachuZan0.Checked == true)
                {
                    lstStrSQL.Add("0");
                }
                //発注残で仕入済数あり
                else
                {
                    lstStrSQL.Add("1");
                }

                //品名・型番
                lstStrSQL.Add(txtHinmei_Kataban.Text);
                //注番
                lstStrSQL.Add(txtChuban.Text);

                gridHachusuhenko.DataSource = hachusuhenkoB.setHachusuhenkoGrid(lstStrSQL);


                int intCnt;

                int intKin = 0;

                for (intCnt = 0; intCnt < gridHachusuhenko.RowCount; intCnt++)
                {
                    intKin = intKin + Convert.ToInt32(gridHachusuhenko.Rows[intCnt].Cells[8].Value);

                    if (Convert.ToInt32(gridHachusuhenko.Rows[intCnt].Cells[6].Value) < 0)
                    {
                        gridHachusuhenko.Rows[intCnt].DefaultCellStyle.ForeColor = Color.Red;
                    }
                }
                txtHachukin.Text = string.Format("{0:#,#}", intKin);

                //グリッドビューに一行以上ある場合
                if (gridHachusuhenko.RowCount > 0)
                {
                    gridHachusuhenko.Focus();
                }
                else
                {
                    labelSet_Torihikisaki.Focus();
                }
            }
            catch (Exception ex)
            {
                //エラーロギング
                new CommonException(ex);
                //例外発生メッセージ(OK)
                BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_ERROR, CommonTeisu.LABEL_ERROR_MESSAGE, CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR);
                basemessagebox.ShowDialog();
                return;
            }
        }