public override void DataSelect(int intKbn, object objList)
        {
            switch ((ExWebService.geWebServiceCallKbn)intKbn)
            {
            case _GetWebServiceCallKbn:
                // 更新
                if (objList != null)
                {
                    _entity = (EntityPurchaseMst)objList;

                    if (_entity.message != "" && _entity.message != null)
                    {
                        this.utlID.txtID.Text = "";
                        ExBackgroundWorker.DoWork_Focus(this.utlID, 10);
                        return;
                    }
                    else
                    {
                        // バインド反映
                        SetBinding();

                        if (_entity._lock_flg == 0)
                        {
                            this.utlFunctionKey.gFunctionKeyEnable = Utl_FunctionKey.geFunctionKeyEnable.Upd;
                            this.btnSalesBalance.IsEnabled         = true;
                        }
                        else
                        {
                            this.utlFunctionKey.gFunctionKeyEnable = Utl_FunctionKey.geFunctionKeyEnable.Sel;
                            this.btnSalesBalance.IsEnabled         = true;
                        }
                    }
                }
                // 新規
                else
                {
                    _entity = new EntityPurchaseMst();
                    SetBinding();
                    this.utlFunctionKey.gFunctionKeyEnable = Utl_FunctionKey.geFunctionKeyEnable.New;
                    this.btnSalesBalance.IsEnabled         = false;
                }
                this.utlID.txtID_IsReadOnly = true;
                ExBackgroundWorker.DoWork_Focus(this.txtName, 10);
                break;

            default:
                break;
            }
        }
        // F2ボタン(クリア) クリック
        public override void btnF2_Click(object sender, RoutedEventArgs e)
        {
            // 初期化
            _entity = null;
            SetBinding();

            this.utlFunctionKey.gFunctionKeyEnable = Utl_FunctionKey.geFunctionKeyEnable.Init;
            this.btnSalesBalance.IsEnabled         = false;

            this.utlID.txtID_IsReadOnly = false;
            this.utlID.txtID.Text       = "";
            ExBackgroundWorker.DoWork_Focus(this.utlID, 10);

            // ロック解除
            DataPgLock.gLockPg(PG_NM, "", (int)DataPgLock.geLockType.UnLock);
        }
        public override void DataSelect(int intKbn, object objList)
        {
            switch ((ExWebService.geWebServiceCallKbn)intKbn)
            {
                case _GetWebServiceCallKbn:
                    // 更新
                    if (objList != null)    
                    {
                        _entity = (EntityPurchaseMst)objList;

                        if (_entity.message != "" && _entity.message != null)
                        {
                            this.utlID.txtID.Text = "";
                            ExBackgroundWorker.DoWork_Focus(this.utlID, 10);
                            return;
                        }
                        else
                        {
                            // バインド反映
                            SetBinding();

                            if (_entity._lock_flg == 0)
                            {
                                this.utlFunctionKey.gFunctionKeyEnable = Utl_FunctionKey.geFunctionKeyEnable.Upd;
                                this.btnSalesBalance.IsEnabled = true;
                            }
                            else
                            {
                                this.utlFunctionKey.gFunctionKeyEnable = Utl_FunctionKey.geFunctionKeyEnable.Sel;
                                this.btnSalesBalance.IsEnabled = true;
                            }
                        }
                    }
                    // 新規
                    else
                    {
                        _entity = new EntityPurchaseMst();
                        SetBinding();
                        this.utlFunctionKey.gFunctionKeyEnable = Utl_FunctionKey.geFunctionKeyEnable.New;
                        this.btnSalesBalance.IsEnabled = false;
                    }
                    this.utlID.txtID_IsReadOnly = true;
                    ExBackgroundWorker.DoWork_Focus(this.txtName, 10);
                    break;
                default:
                    break;
            }
        }
        private void SetBinding()
        {
            if (_entity == null)
            {
                _entity = new EntityPurchaseMst();
            }

            // マスタコントロールPropertyChanged
            _entity.PropertyChanged += this.utlZip.MstID_Changed;
            _entity.PropertyChanged += this.utlSummingUp.MstID_Changed;
            _entity.PropertyChanged += this.utlPaymentDivision.MstID_Changed;
            _entity.PropertyChanged += this.utlGroup1.MstID_Changed;
            _entity.PropertyChanged += this._PropertyChanged;

            NumberConverter nmConvDecm0 = new NumberConverter();

            #region Bind

            // バインド
            Binding BindingName = new Binding("_name");
            BindingName.Mode = BindingMode.TwoWay;
            BindingName.Source = _entity;
            this.txtName.SetBinding(TextBox.TextProperty, BindingName);

            Binding BindingKana = new Binding("_kana");
            BindingKana.Mode = BindingMode.TwoWay;
            BindingKana.Source = _entity;
            this.txtKana.SetBinding(TextBox.TextProperty, BindingKana);

            Binding BindingAboutName = new Binding("_about_name");
            BindingAboutName.Mode = BindingMode.TwoWay;
            BindingAboutName.Source = _entity;
            this.txtAdoutName.SetBinding(TextBox.TextProperty, BindingAboutName);

            Binding BindingZipCodeFrom = new Binding("_zip_code_from");
            BindingZipCodeFrom.Mode = BindingMode.TwoWay;
            BindingZipCodeFrom.Source = _entity;
            this.utlZip.txtZipNo1.SetBinding(TextBox.TextProperty, BindingZipCodeFrom);

            Binding BindingZipCodeTo = new Binding("_zip_code_to");
            BindingZipCodeTo.Mode = BindingMode.TwoWay;
            BindingZipCodeTo.Source = _entity;
            this.utlZip.txtZipNo2.SetBinding(TextBox.TextProperty, BindingZipCodeTo);

            this.utlZip.is_zip_from_first_flg = true;
            this.utlZip.is_zip_to_first_flg = true;

            Binding BindingAdress1 = new Binding("_adress1");
            BindingAdress1.Mode = BindingMode.TwoWay;
            BindingAdress1.Source = _entity;
            this.utlZip.SetBinding(Utl_Zip.UserControlAdress1Property, BindingAdress1);

            Binding BindingAdress2 = new Binding("_adress2");
            BindingAdress2.Mode = BindingMode.TwoWay;
            BindingAdress2.Source = _entity;
            this.utlZip.SetBinding(Utl_Zip.UserControlAdress2Property, BindingAdress2);

            Binding BindingStationName = new Binding("_station_name");
            BindingStationName.Mode = BindingMode.TwoWay;
            BindingStationName.Source = _entity;
            this.txtStationName.SetBinding(TextBox.TextProperty, BindingStationName);

            Binding BindingPostName = new Binding("_post_name");
            BindingPostName.Mode = BindingMode.TwoWay;
            BindingPostName.Source = _entity;
            this.txtPostName.SetBinding(TextBox.TextProperty, BindingPostName);

            Binding BindingPersonName = new Binding("_person_name");
            BindingPersonName.Mode = BindingMode.TwoWay;
            BindingPersonName.Source = _entity;
            this.txtPersonName.SetBinding(TextBox.TextProperty, BindingPersonName);

            Binding BindingTitleId = new Binding("_title_id");
            BindingTitleId.Mode = BindingMode.TwoWay;
            BindingTitleId.Source = _entity;
            this.utlTitle.txtID.SetBinding(TextBox.TextProperty, BindingTitleId);

            Binding BindingTitleName = new Binding("_title_name");
            BindingTitleName.Mode = BindingMode.TwoWay;
            BindingTitleName.Source = _entity;
            this.utlTitle.txtNm.SetBinding(TextBox.TextProperty, BindingTitleName);

            Binding BindingTel = new Binding("_tel");
            BindingTel.Mode = BindingMode.TwoWay;
            BindingTel.Source = _entity;
            this.txtTel.SetBinding(TextBox.TextProperty, BindingTel);

            Binding BindingFax = new Binding("_fax");
            BindingFax.Mode = BindingMode.TwoWay;
            BindingFax.Source = _entity;
            this.txtFax.SetBinding(TextBox.TextProperty, BindingFax);

            Binding BindingMailAdress = new Binding("_mail_adress");
            BindingMailAdress.Mode = BindingMode.TwoWay;
            BindingMailAdress.Source = _entity;
            this.txtMail.SetBinding(TextBox.TextProperty, BindingMailAdress);

            Binding BindingBusinessDivisionId = new Binding("_business_division_id");
            BindingBusinessDivisionId.Mode = BindingMode.TwoWay;
            BindingBusinessDivisionId.Source = _entity;
            this.utlBusiness.txtID.SetBinding(TextBox.TextProperty, BindingBusinessDivisionId);

            Binding BindingBusinessDivisionName = new Binding("_business_division_nm");
            BindingBusinessDivisionName.Mode = BindingMode.TwoWay;
            BindingBusinessDivisionName.Source = _entity;
            this.utlBusiness.txtNm.SetBinding(TextBox.TextProperty, BindingBusinessDivisionName);

            Binding BindingUnitKindId = new Binding("_unit_kind_id");
            BindingUnitKindId.Mode = BindingMode.TwoWay;
            BindingUnitKindId.Source = _entity;
            this.utlUnitKind.txtID.SetBinding(TextBox.TextProperty, BindingUnitKindId);

            Binding BindingUnitKindName = new Binding("_unit_kind_nm");
            BindingUnitKindName.Mode = BindingMode.TwoWay;
            BindingUnitKindName.Source = _entity;
            this.utlUnitKind.txtNm.SetBinding(TextBox.TextProperty, BindingUnitKindName);

            Binding BindingCreditRate = new Binding("_credit_rate");
            BindingCreditRate.Mode = BindingMode.TwoWay;
            BindingCreditRate.Source = _entity;
            this.txtCreditRate.SetBinding(TextBox.TextProperty, BindingCreditRate);

            Binding BindingTaxChangeId = new Binding("_tax_change_id");
            BindingTaxChangeId.Mode = BindingMode.TwoWay;
            BindingTaxChangeId.Source = _entity;
            this.utlTaxChange.txtID.SetBinding(TextBox.TextProperty, BindingTaxChangeId);

            Binding BindingTaxChangeName = new Binding("_tax_change_nm");
            BindingTaxChangeName.Mode = BindingMode.TwoWay;
            BindingTaxChangeName.Source = _entity;
            this.utlTaxChange.txtNm.SetBinding(TextBox.TextProperty, BindingTaxChangeName);

            Binding BindingSummingUpGroupId = new Binding("_summing_up_group_id");
            BindingSummingUpGroupId.Mode = BindingMode.TwoWay;
            BindingSummingUpGroupId.Source = _entity;
            this.utlSummingUp.txtID.SetBinding(TextBox.TextProperty, BindingSummingUpGroupId);

            Binding BindingSummingUpGroupName = new Binding("_summing_up_group_nm");
            BindingSummingUpGroupName.Mode = BindingMode.TwoWay;
            BindingSummingUpGroupName.Source = _entity;
            this.utlSummingUp.txtNm.SetBinding(TextBox.TextProperty, BindingSummingUpGroupName);

            Binding BindigPriceFractionProcId = new Binding("_price_fraction_proc_id");
            BindigPriceFractionProcId.Mode = BindingMode.TwoWay;
            BindigPriceFractionProcId.Source = _entity;
            this.utlPriceFractionProc.txtID.SetBinding(TextBox.TextProperty, BindigPriceFractionProcId);

            Binding BindigPriceFractionProcName = new Binding("_price_fraction_proc_nm");
            BindigPriceFractionProcName.Mode = BindingMode.TwoWay;
            BindigPriceFractionProcName.Source = _entity;
            this.utlPriceFractionProc.txtNm.SetBinding(TextBox.TextProperty, BindigPriceFractionProcName);

            Binding BindigTaxFractionProcId = new Binding("_tax_fraction_proc_id");
            BindigTaxFractionProcId.Mode = BindingMode.TwoWay;
            BindigTaxFractionProcId.Source = _entity;
            this.utlTaxFractionProc.txtID.SetBinding(TextBox.TextProperty, BindigTaxFractionProcId);

            Binding BindigTaxFractionProcName = new Binding("_tax_fraction_proc_nm");
            BindigTaxFractionProcName.Mode = BindingMode.TwoWay;
            BindigTaxFractionProcName.Source = _entity;
            this.utlTaxFractionProc.txtNm.SetBinding(TextBox.TextProperty, BindigTaxFractionProcName);

            Binding BindigSalesCreditPrice = new Binding("_payment_credit_price");
            BindigSalesCreditPrice.Mode = BindingMode.TwoWay;
            BindigSalesCreditPrice.Source = _entity;
            this.txtSalesLimitPrice.SetBinding(TextBox.TextProperty, BindigSalesCreditPrice);
            this.txtSalesLimitPrice.OnFormatString();

            Binding BindigPaymentDivisionId = new Binding("_payment_division_id");
            BindigPaymentDivisionId.Mode = BindingMode.TwoWay;
            BindigPaymentDivisionId.Source = _entity;
            this.utlPaymentDivision.txtID.SetBinding(TextBox.TextProperty, BindigPaymentDivisionId);

            Binding BindigPaymentDivisionName = new Binding("_payment_division_nm");
            BindigPaymentDivisionName.Mode = BindingMode.TwoWay;
            BindigPaymentDivisionName.Source = _entity;
            this.utlPaymentDivision.txtNm.SetBinding(TextBox.TextProperty, BindigPaymentDivisionName);

            Binding BindigPaymentCycleId = new Binding("_payment_cycle_id");
            BindigPaymentCycleId.Mode = BindingMode.TwoWay;
            BindigPaymentCycleId.Source = _entity;
            this.utlPaymentCycle.txtID.SetBinding(TextBox.TextProperty, BindigPaymentCycleId);

            Binding BindigPaymentCycleName = new Binding("_payment_cycle_nm");
            BindigPaymentCycleName.Mode = BindingMode.TwoWay;
            BindigPaymentCycleName.Source = _entity;
            this.utlPaymentCycle.txtNm.SetBinding(TextBox.TextProperty, BindigPaymentCycleName);

            Binding BindigPaymentDay = new Binding("_payment_day");
            BindigPaymentDay.Mode = BindingMode.TwoWay;
            BindigPaymentDay.Source = _entity;
            this.txtPaymentDay.SetBinding(TextBox.TextProperty, BindigPaymentDay);

            Binding BindigBillSite = new Binding("_bill_site");
            BindigBillSite.Mode = BindingMode.TwoWay;
            BindigBillSite.Source = _entity;
            this.txtBillSite.SetBinding(TextBox.TextProperty, BindigBillSite);

            Binding BindigGroup1Id = new Binding("_group1_id");
            BindigGroup1Id.Mode = BindingMode.TwoWay;
            BindigGroup1Id.Source = _entity;
            this.utlGroup1.txtID.SetBinding(TextBox.TextProperty, BindigGroup1Id);

            Binding BindigGroup1Name = new Binding("_group1_nm");
            BindigGroup1Name.Mode = BindingMode.TwoWay;
            BindigGroup1Name.Source = _entity;
            this.utlGroup1.txtNm.SetBinding(TextBox.TextProperty, BindigGroup1Name);

            Binding BindigDiaplayDivisionId = new Binding("_display_division_id");
            BindigDiaplayDivisionId.Mode = BindingMode.TwoWay;
            BindigDiaplayDivisionId.Source = _entity;
            this.utlDisplay.txtID.SetBinding(TextBox.TextProperty, BindigDiaplayDivisionId);

            Binding BindigDiaplayDivisionNm = new Binding("_display_division_nm");
            BindigDiaplayDivisionNm.Mode = BindingMode.TwoWay;
            BindigDiaplayDivisionNm.Source = _entity;
            this.utlDisplay.txtNm.SetBinding(TextBox.TextProperty, BindigDiaplayDivisionNm);

            Binding BindigMemo = new Binding("_memo");
            BindigMemo.Mode = BindingMode.TwoWay;
            BindigMemo.Source = _entity;
            this.txtMemo.SetBinding(TextBox.TextProperty, BindigMemo);

            #endregion

            this.utlID.txtID.SetZeroToNullString();
            this.utlTitle.txtID.SetZeroToNullString();
            this.utlBusiness.txtID.SetZeroToNullString();
            this.utlUnitKind.txtID.SetZeroToNullString();
            this.utlTaxFractionProc.txtID.SetZeroToNullString();
            this.utlSummingUp.txtID.SetZeroToNullString();
            this.utlPaymentDivision.txtID.SetZeroToNullString();
            this.utlPaymentCycle.txtID.SetZeroToNullString();
            this.utlPriceFractionProc.txtID.SetZeroToNullString();
            this.utlTaxFractionProc.txtID.SetZeroToNullString();
            this.utlGroup1.txtID.SetZeroToNullString();

            this.txtSalesLimitPrice.OnFormatString();

            if (ExCast.zCInt(_entity._id) == 0)
            {
                _entity._business_division_id = 1;                              // 取引区分 1:掛売上
                _entity._unit_kind_id = 2;                                      // 単価種類 2:売上単価
                _entity._tax_change_id = (int)Common.geTaxChange.OUT_TAX_SUM;   // 税転換 1:外税/伝票計
                _entity._price_fraction_proc_id = 2;                            // 金額端数処理 2:切り上げ
                _entity._tax_fraction_proc_id = 2;                              // 税端数処理 2:切り上げ
                _entity._display_division_id = 1;
                _entity._credit_rate = 100;
            }
        }
        // F2ボタン(クリア) クリック
        public override void btnF2_Click(object sender, RoutedEventArgs e)
        {
            // 初期化
            _entity = null;
            SetBinding();

            this.utlFunctionKey.gFunctionKeyEnable = Utl_FunctionKey.geFunctionKeyEnable.Init;
            this.btnSalesBalance.IsEnabled = false;

            this.utlID.txtID_IsReadOnly = false;
            this.utlID.txtID.Text = "";
            ExBackgroundWorker.DoWork_Focus(this.utlID, 10);

            // ロック解除
            DataPgLock.gLockPg(PG_NM, "", (int)DataPgLock.geLockType.UnLock);
        }
 private void UpdatePurchaseMst(int type, string Id, EntityPurchaseMst entity)
 {
     try
     {
         svcPurchaseMstClient svc = new svcPurchaseMstClient();
         svc.UpdatePurchaseMstCompleted += new EventHandler<UpdatePurchaseMstCompletedEventArgs>(this.UpdatePurchaseMstCompleted);
         svc.UpdatePurchaseMstAsync(Common.gstrSessionString, type, Id, entity);
     }
     catch (Exception ex)
     {
         this.ProcessingDlgClose();
         ExMessageBox.Show(CLASS_NM + ".UpdatePurchaseMst" + Environment.NewLine + ex.ToString(), "エラー確認");
     }
 }
        private void GetPurchaseMstCompleted(Object sender, GetPurchaseMstCompletedEventArgs e)
        {
            try
            {
                objPurchaseMst = e.Result;
                if (DialogCloseFlg == geDialogCloseFlg.Yes & win != null)
                {
                    win.Close();
                    win = null;
                }

                if (objPurchaseMst != null)
                {
                    if (objPurchaseMst.message != "" && objPurchaseMst.message != null)
                    {
                        // 失敗
                        ExMessageBox.Show(objPurchaseMst.message);
                        objPerent.DataSelect((int)geWebServiceCallKbn.GetPurchaseMst, (object)objPurchaseMst);
                    }
                    else
                    {
                        // 成功
                        objPerent.DataSelect((int)geWebServiceCallKbn.GetPurchaseMst, (object)objPurchaseMst);
                    }
                }
                else
                {
                    objPerent.DataSelect((int)geWebServiceCallKbn.GetPurchaseMst, null);
                }

            }
            catch (Exception ex)
            {
                this.ProcessingDlgClose();
                ExMessageBox.Show(CLASS_NM + ".GetPurchaseMstCompleted" + Environment.NewLine + ex.ToString(), "エラー確認");
            }
            finally
            {
                if (DialogCloseFlg == geDialogCloseFlg.Yes & win != null)
                {
                    win.Close();
                    win = null;
                }
            }
        }
 private void GetPurchaseMst(string id)
 {
     try
     {
         objPurchaseMst = null;   // 初期化
         svcPurchaseMstClient svc = new svcPurchaseMstClient();
         svc.GetPurchaseMstCompleted += new EventHandler<GetPurchaseMstCompletedEventArgs>(this.GetPurchaseMstCompleted);
         svc.GetPurchaseMstAsync(Common.gstrSessionString, id);
     }
     catch (Exception ex)
     {
         this.ProcessingDlgClose();
         ExMessageBox.Show(CLASS_NM + ".GetPurchaseMst" + Environment.NewLine + ex.ToString(), "エラー確認");
     }
 }
        private void SetBinding()
        {
            if (_entity == null)
            {
                _entity = new EntityPurchaseMst();
            }

            // マスタコントロールPropertyChanged
            _entity.PropertyChanged += this.utlZip.MstID_Changed;
            _entity.PropertyChanged += this.utlSummingUp.MstID_Changed;
            _entity.PropertyChanged += this.utlPaymentDivision.MstID_Changed;
            _entity.PropertyChanged += this.utlGroup1.MstID_Changed;
            _entity.PropertyChanged += this._PropertyChanged;

            NumberConverter nmConvDecm0 = new NumberConverter();

            #region Bind

            // バインド
            Binding BindingName = new Binding("_name");
            BindingName.Mode   = BindingMode.TwoWay;
            BindingName.Source = _entity;
            this.txtName.SetBinding(TextBox.TextProperty, BindingName);

            Binding BindingKana = new Binding("_kana");
            BindingKana.Mode   = BindingMode.TwoWay;
            BindingKana.Source = _entity;
            this.txtKana.SetBinding(TextBox.TextProperty, BindingKana);

            Binding BindingAboutName = new Binding("_about_name");
            BindingAboutName.Mode   = BindingMode.TwoWay;
            BindingAboutName.Source = _entity;
            this.txtAdoutName.SetBinding(TextBox.TextProperty, BindingAboutName);

            Binding BindingZipCodeFrom = new Binding("_zip_code_from");
            BindingZipCodeFrom.Mode   = BindingMode.TwoWay;
            BindingZipCodeFrom.Source = _entity;
            this.utlZip.txtZipNo1.SetBinding(TextBox.TextProperty, BindingZipCodeFrom);

            Binding BindingZipCodeTo = new Binding("_zip_code_to");
            BindingZipCodeTo.Mode   = BindingMode.TwoWay;
            BindingZipCodeTo.Source = _entity;
            this.utlZip.txtZipNo2.SetBinding(TextBox.TextProperty, BindingZipCodeTo);

            this.utlZip.is_zip_from_first_flg = true;
            this.utlZip.is_zip_to_first_flg   = true;

            Binding BindingAdress1 = new Binding("_adress1");
            BindingAdress1.Mode   = BindingMode.TwoWay;
            BindingAdress1.Source = _entity;
            this.utlZip.SetBinding(Utl_Zip.UserControlAdress1Property, BindingAdress1);

            Binding BindingAdress2 = new Binding("_adress2");
            BindingAdress2.Mode   = BindingMode.TwoWay;
            BindingAdress2.Source = _entity;
            this.utlZip.SetBinding(Utl_Zip.UserControlAdress2Property, BindingAdress2);

            Binding BindingStationName = new Binding("_station_name");
            BindingStationName.Mode   = BindingMode.TwoWay;
            BindingStationName.Source = _entity;
            this.txtStationName.SetBinding(TextBox.TextProperty, BindingStationName);

            Binding BindingPostName = new Binding("_post_name");
            BindingPostName.Mode   = BindingMode.TwoWay;
            BindingPostName.Source = _entity;
            this.txtPostName.SetBinding(TextBox.TextProperty, BindingPostName);

            Binding BindingPersonName = new Binding("_person_name");
            BindingPersonName.Mode   = BindingMode.TwoWay;
            BindingPersonName.Source = _entity;
            this.txtPersonName.SetBinding(TextBox.TextProperty, BindingPersonName);

            Binding BindingTitleId = new Binding("_title_id");
            BindingTitleId.Mode   = BindingMode.TwoWay;
            BindingTitleId.Source = _entity;
            this.utlTitle.txtID.SetBinding(TextBox.TextProperty, BindingTitleId);

            Binding BindingTitleName = new Binding("_title_name");
            BindingTitleName.Mode   = BindingMode.TwoWay;
            BindingTitleName.Source = _entity;
            this.utlTitle.txtNm.SetBinding(TextBox.TextProperty, BindingTitleName);

            Binding BindingTel = new Binding("_tel");
            BindingTel.Mode   = BindingMode.TwoWay;
            BindingTel.Source = _entity;
            this.txtTel.SetBinding(TextBox.TextProperty, BindingTel);

            Binding BindingFax = new Binding("_fax");
            BindingFax.Mode   = BindingMode.TwoWay;
            BindingFax.Source = _entity;
            this.txtFax.SetBinding(TextBox.TextProperty, BindingFax);

            Binding BindingMailAdress = new Binding("_mail_adress");
            BindingMailAdress.Mode   = BindingMode.TwoWay;
            BindingMailAdress.Source = _entity;
            this.txtMail.SetBinding(TextBox.TextProperty, BindingMailAdress);

            Binding BindingBusinessDivisionId = new Binding("_business_division_id");
            BindingBusinessDivisionId.Mode   = BindingMode.TwoWay;
            BindingBusinessDivisionId.Source = _entity;
            this.utlBusiness.txtID.SetBinding(TextBox.TextProperty, BindingBusinessDivisionId);

            Binding BindingBusinessDivisionName = new Binding("_business_division_nm");
            BindingBusinessDivisionName.Mode   = BindingMode.TwoWay;
            BindingBusinessDivisionName.Source = _entity;
            this.utlBusiness.txtNm.SetBinding(TextBox.TextProperty, BindingBusinessDivisionName);

            Binding BindingUnitKindId = new Binding("_unit_kind_id");
            BindingUnitKindId.Mode   = BindingMode.TwoWay;
            BindingUnitKindId.Source = _entity;
            this.utlUnitKind.txtID.SetBinding(TextBox.TextProperty, BindingUnitKindId);

            Binding BindingUnitKindName = new Binding("_unit_kind_nm");
            BindingUnitKindName.Mode   = BindingMode.TwoWay;
            BindingUnitKindName.Source = _entity;
            this.utlUnitKind.txtNm.SetBinding(TextBox.TextProperty, BindingUnitKindName);

            Binding BindingCreditRate = new Binding("_credit_rate");
            BindingCreditRate.Mode   = BindingMode.TwoWay;
            BindingCreditRate.Source = _entity;
            this.txtCreditRate.SetBinding(TextBox.TextProperty, BindingCreditRate);

            Binding BindingTaxChangeId = new Binding("_tax_change_id");
            BindingTaxChangeId.Mode   = BindingMode.TwoWay;
            BindingTaxChangeId.Source = _entity;
            this.utlTaxChange.txtID.SetBinding(TextBox.TextProperty, BindingTaxChangeId);

            Binding BindingTaxChangeName = new Binding("_tax_change_nm");
            BindingTaxChangeName.Mode   = BindingMode.TwoWay;
            BindingTaxChangeName.Source = _entity;
            this.utlTaxChange.txtNm.SetBinding(TextBox.TextProperty, BindingTaxChangeName);

            Binding BindingSummingUpGroupId = new Binding("_summing_up_group_id");
            BindingSummingUpGroupId.Mode   = BindingMode.TwoWay;
            BindingSummingUpGroupId.Source = _entity;
            this.utlSummingUp.txtID.SetBinding(TextBox.TextProperty, BindingSummingUpGroupId);

            Binding BindingSummingUpGroupName = new Binding("_summing_up_group_nm");
            BindingSummingUpGroupName.Mode   = BindingMode.TwoWay;
            BindingSummingUpGroupName.Source = _entity;
            this.utlSummingUp.txtNm.SetBinding(TextBox.TextProperty, BindingSummingUpGroupName);

            Binding BindigPriceFractionProcId = new Binding("_price_fraction_proc_id");
            BindigPriceFractionProcId.Mode   = BindingMode.TwoWay;
            BindigPriceFractionProcId.Source = _entity;
            this.utlPriceFractionProc.txtID.SetBinding(TextBox.TextProperty, BindigPriceFractionProcId);

            Binding BindigPriceFractionProcName = new Binding("_price_fraction_proc_nm");
            BindigPriceFractionProcName.Mode   = BindingMode.TwoWay;
            BindigPriceFractionProcName.Source = _entity;
            this.utlPriceFractionProc.txtNm.SetBinding(TextBox.TextProperty, BindigPriceFractionProcName);

            Binding BindigTaxFractionProcId = new Binding("_tax_fraction_proc_id");
            BindigTaxFractionProcId.Mode   = BindingMode.TwoWay;
            BindigTaxFractionProcId.Source = _entity;
            this.utlTaxFractionProc.txtID.SetBinding(TextBox.TextProperty, BindigTaxFractionProcId);

            Binding BindigTaxFractionProcName = new Binding("_tax_fraction_proc_nm");
            BindigTaxFractionProcName.Mode   = BindingMode.TwoWay;
            BindigTaxFractionProcName.Source = _entity;
            this.utlTaxFractionProc.txtNm.SetBinding(TextBox.TextProperty, BindigTaxFractionProcName);

            Binding BindigSalesCreditPrice = new Binding("_payment_credit_price");
            BindigSalesCreditPrice.Mode   = BindingMode.TwoWay;
            BindigSalesCreditPrice.Source = _entity;
            this.txtSalesLimitPrice.SetBinding(TextBox.TextProperty, BindigSalesCreditPrice);
            this.txtSalesLimitPrice.OnFormatString();

            Binding BindigPaymentDivisionId = new Binding("_payment_division_id");
            BindigPaymentDivisionId.Mode   = BindingMode.TwoWay;
            BindigPaymentDivisionId.Source = _entity;
            this.utlPaymentDivision.txtID.SetBinding(TextBox.TextProperty, BindigPaymentDivisionId);

            Binding BindigPaymentDivisionName = new Binding("_payment_division_nm");
            BindigPaymentDivisionName.Mode   = BindingMode.TwoWay;
            BindigPaymentDivisionName.Source = _entity;
            this.utlPaymentDivision.txtNm.SetBinding(TextBox.TextProperty, BindigPaymentDivisionName);

            Binding BindigPaymentCycleId = new Binding("_payment_cycle_id");
            BindigPaymentCycleId.Mode   = BindingMode.TwoWay;
            BindigPaymentCycleId.Source = _entity;
            this.utlPaymentCycle.txtID.SetBinding(TextBox.TextProperty, BindigPaymentCycleId);

            Binding BindigPaymentCycleName = new Binding("_payment_cycle_nm");
            BindigPaymentCycleName.Mode   = BindingMode.TwoWay;
            BindigPaymentCycleName.Source = _entity;
            this.utlPaymentCycle.txtNm.SetBinding(TextBox.TextProperty, BindigPaymentCycleName);

            Binding BindigPaymentDay = new Binding("_payment_day");
            BindigPaymentDay.Mode   = BindingMode.TwoWay;
            BindigPaymentDay.Source = _entity;
            this.txtPaymentDay.SetBinding(TextBox.TextProperty, BindigPaymentDay);

            Binding BindigBillSite = new Binding("_bill_site");
            BindigBillSite.Mode   = BindingMode.TwoWay;
            BindigBillSite.Source = _entity;
            this.txtBillSite.SetBinding(TextBox.TextProperty, BindigBillSite);

            Binding BindigGroup1Id = new Binding("_group1_id");
            BindigGroup1Id.Mode   = BindingMode.TwoWay;
            BindigGroup1Id.Source = _entity;
            this.utlGroup1.txtID.SetBinding(TextBox.TextProperty, BindigGroup1Id);

            Binding BindigGroup1Name = new Binding("_group1_nm");
            BindigGroup1Name.Mode   = BindingMode.TwoWay;
            BindigGroup1Name.Source = _entity;
            this.utlGroup1.txtNm.SetBinding(TextBox.TextProperty, BindigGroup1Name);

            Binding BindigDiaplayDivisionId = new Binding("_display_division_id");
            BindigDiaplayDivisionId.Mode   = BindingMode.TwoWay;
            BindigDiaplayDivisionId.Source = _entity;
            this.utlDisplay.txtID.SetBinding(TextBox.TextProperty, BindigDiaplayDivisionId);

            Binding BindigDiaplayDivisionNm = new Binding("_display_division_nm");
            BindigDiaplayDivisionNm.Mode   = BindingMode.TwoWay;
            BindigDiaplayDivisionNm.Source = _entity;
            this.utlDisplay.txtNm.SetBinding(TextBox.TextProperty, BindigDiaplayDivisionNm);

            Binding BindigMemo = new Binding("_memo");
            BindigMemo.Mode   = BindingMode.TwoWay;
            BindigMemo.Source = _entity;
            this.txtMemo.SetBinding(TextBox.TextProperty, BindigMemo);

            #endregion

            this.utlID.txtID.SetZeroToNullString();
            this.utlTitle.txtID.SetZeroToNullString();
            this.utlBusiness.txtID.SetZeroToNullString();
            this.utlUnitKind.txtID.SetZeroToNullString();
            this.utlTaxFractionProc.txtID.SetZeroToNullString();
            this.utlSummingUp.txtID.SetZeroToNullString();
            this.utlPaymentDivision.txtID.SetZeroToNullString();
            this.utlPaymentCycle.txtID.SetZeroToNullString();
            this.utlPriceFractionProc.txtID.SetZeroToNullString();
            this.utlTaxFractionProc.txtID.SetZeroToNullString();
            this.utlGroup1.txtID.SetZeroToNullString();

            this.txtSalesLimitPrice.OnFormatString();

            if (ExCast.zCInt(_entity._id) == 0)
            {
                _entity._business_division_id   = 1;                                   // 取引区分 1:掛売上
                _entity._unit_kind_id           = 2;                                   // 単価種類 2:売上単価
                _entity._tax_change_id          = (int)Common.geTaxChange.OUT_TAX_SUM; // 税転換 1:外税/伝票計
                _entity._price_fraction_proc_id = 2;                                   // 金額端数処理 2:切り上げ
                _entity._tax_fraction_proc_id   = 2;                                   // 税端数処理 2:切り上げ
                _entity._display_division_id    = 1;
                _entity._credit_rate            = 100;
            }
        }