private void SetBinding()
        {
            if (entity == null)
            {
                entity = new EntitySearch();
            }

            // マスタコントロールPropertyChanged
            entity.PropertyChanged += this.utlCommodity_F.MstID_Changed;
            entity.PropertyChanged += this.utlCommodity_T.MstID_Changed;

            #region Bind

            // バインド
            Binding BindingCommodityId_F = new Binding("commodity_id_from");
            BindingCommodityId_F.Mode = BindingMode.TwoWay;
            BindingCommodityId_F.Source = entity;
            this.utlCommodity_F.txtID.SetBinding(TextBox.TextProperty, BindingCommodityId_F);

            // バインド
            Binding BindingCommodityId_T = new Binding("commodity_id_to");
            BindingCommodityId_T.Mode = BindingMode.TwoWay;
            BindingCommodityId_T.Source = entity;
            this.utlCommodity_T.txtID.SetBinding(TextBox.TextProperty, BindingCommodityId_T);

            #endregion

            this.utlCommodity_F.txtID.OnFormatString();
            this.utlCommodity_T.txtID.OnFormatString();
        }
        private void SetBinding()
        {
            if (entity == null)
            {
                entity = new EntitySearch();
            }

            // マスタコントロールPropertyChanged
            entity.PropertyChanged += this.utlPerson_F.MstID_Changed;
            entity.PropertyChanged += this.utlPerson_T.MstID_Changed;
            entity.PropertyChanged += this.utlPurchase.MstID_Changed;
            entity.PropertyChanged += this.utlCustomer.MstID_Changed;
            entity.PropertyChanged += this.utlSupplier.MstID_Changed;
            entity.PropertyChanged += this.utlCommodity.MstID_Changed;

            #region Bind

            // バインド
            Binding BindingPersonF = new Binding("person_id_from");
            BindingPersonF.Mode = BindingMode.TwoWay;
            BindingPersonF.Source = entity;
            this.utlPerson_F.txtID.SetBinding(TextBox.TextProperty, BindingPersonF);

            Binding BindingPersonT = new Binding("person_id_to");
            BindingPersonT.Mode = BindingMode.TwoWay;
            BindingPersonT.Source = entity;
            this.utlPerson_T.txtID.SetBinding(TextBox.TextProperty, BindingPersonT);

            Binding BindingPurchase = new Binding("purchae_id");
            BindingPurchase.Mode = BindingMode.TwoWay;
            BindingPurchase.Source = entity;
            this.utlPurchase.txtID.SetBinding(TextBox.TextProperty, BindingPurchase);

            Binding BindingCustomer = new Binding("customer_id");
            BindingCustomer.Mode = BindingMode.TwoWay;
            BindingCustomer.Source = entity;
            this.utlCustomer.txtID.SetBinding(TextBox.TextProperty, BindingCustomer);

            Binding BindingSupply = new Binding("supplier_id");
            BindingSupply.Mode = BindingMode.TwoWay;
            BindingSupply.Source = entity;
            this.utlSupplier.txtID.SetBinding(TextBox.TextProperty, BindingSupply);
            this.utlSupplier.txtID2.SetBinding(TextBox.TextProperty, BindingCustomer);

            Binding BindingCommodity = new Binding("commodity_id");
            BindingCommodity.Mode = BindingMode.TwoWay;
            BindingCommodity.Source = entity;
            this.utlCommodity.txtID.SetBinding(TextBox.TextProperty, BindingCommodity);

            #endregion

            this.utlPerson_F.txtID.OnFormatString();
            this.utlPerson_T.txtID.SetZeroToNullString();
            this.utlPurchase.txtID.SetZeroToNullString();
            this.utlCustomer.txtID.SetZeroToNullString();
            this.utlSupplier.txtID.SetZeroToNullString();
            this.utlCommodity.txtID.SetZeroToNullString();
        }
        private void SetBinding()
        {
            if (entity == null)
            {
                entity = new EntitySearch();
            }

            // マスタコントロールPropertyChanged
            //entity.PropertyChanged += this.utlPerson_F.MstID_Changed;
            //entity.PropertyChanged += this.utlPerson_T.MstID_Changed;
            //entity.PropertyChanged += this.utlSupply.MstID_Changed;
            //entity.PropertyChanged += this.utlCommodity.MstID_Changed;

            #region Bind

            // バインド
            //Binding BindingPersonF = new Binding("person_id_from");
            //BindingPersonF.Mode = BindingMode.TwoWay;
            //BindingPersonF.Source = entity;
            //this.utlPerson_F.txtID.SetBinding(TextBox.TextProperty, BindingPersonF);

            //Binding BindingPersonT = new Binding("person_id_to");
            //BindingPersonT.Mode = BindingMode.TwoWay;
            //BindingPersonT.Source = entity;
            //this.utlPerson_T.txtID.SetBinding(TextBox.TextProperty, BindingPersonT);

            if (Common.gWinType == Common.geWinType.ListCollectPlan)
            {
                entity.PropertyChanged -= this.utlInvoice_F.MstID_Changed;
                entity.PropertyChanged -= this.utlInvoice_T.MstID_Changed;
                entity.PropertyChanged += this.utlInvoice_F.MstID_Changed;
                entity.PropertyChanged += this.utlInvoice_T.MstID_Changed;

                Binding BindingInvoiceF = new Binding("invoice_id_from");
                BindingInvoiceF.Mode = BindingMode.TwoWay;
                BindingInvoiceF.Source = entity;
                this.utlInvoice_F.txtID.SetBinding(TextBox.TextProperty, BindingInvoiceF);

                Binding BindingInvoiceT = new Binding("invoice_id_to");
                BindingInvoiceT.Mode = BindingMode.TwoWay;
                BindingInvoiceT.Source = entity;
                this.utlInvoice_T.txtID.SetBinding(TextBox.TextProperty, BindingInvoiceT);

                this.utlInvoice_F.txtID.SetZeroToNullString();
                this.utlInvoice_T.txtID.SetZeroToNullString();
            }
            else
            {
                entity.PropertyChanged -= this.utlPurchase_F.MstID_Changed;
                entity.PropertyChanged -= this.utlPurchase_T.MstID_Changed;
                entity.PropertyChanged += this.utlPurchase_F.MstID_Changed;
                entity.PropertyChanged += this.utlPurchase_T.MstID_Changed;

                Binding BindingPurchaseF = new Binding("purchase_id_from");
                BindingPurchaseF.Mode = BindingMode.TwoWay;
                BindingPurchaseF.Source = entity;
                this.utlPurchase_F.txtID.SetBinding(TextBox.TextProperty, BindingPurchaseF);

                Binding BindingPurchaseT = new Binding("purchase_id_to");
                BindingPurchaseT.Mode = BindingMode.TwoWay;
                BindingPurchaseT.Source = entity;
                this.utlPurchase_T.txtID.SetBinding(TextBox.TextProperty, BindingPurchaseT);

                this.utlPurchase_F.txtID.SetZeroToNullString();
                this.utlPurchase_T.txtID.SetZeroToNullString();
            }


            //Binding BindingSupply = new Binding("supplier_id");
            //BindingSupply.Mode = BindingMode.TwoWay;
            //BindingSupply.Source = entity;
            //this.utlSupply.txtID.SetBinding(TextBox.TextProperty, BindingSupply);
            //this.utlSupply.txtID2.SetBinding(TextBox.TextProperty, BindingCustomer);

            //Binding BindingCommodity = new Binding("commodity_id");
            //BindingCommodity.Mode = BindingMode.TwoWay;
            //BindingCommodity.Source = entity;
            //this.utlCommodity.txtID.SetBinding(TextBox.TextProperty, BindingCommodity);

            #endregion

            //this.utlPerson_F.txtID.OnFormatString();
            //this.utlPerson_T.txtID.SetZeroToNullString();
            //this.utlSupply.txtID.SetZeroToNullString();
            //this.utlCommodity.txtID.SetZeroToNullString();
        }
        private void SetBinding()
        {
            if (entity == null)
            {
                entity = new EntitySearch();
            }

            // マスタコントロールPropertyChanged
            entity.PropertyChanged += this.utlPurchase.MstID_Changed;
            entity.PropertyChanged += this.utlSummingUp.MstID_Changed;

            #region Bind

            // バインド
            Binding BindingInvoiceId = new Binding("purchase_id");
            BindingInvoiceId.Mode = BindingMode.TwoWay;
            BindingInvoiceId.Source = entity;
            this.utlPurchase.txtID.SetBinding(TextBox.TextProperty, BindingInvoiceId);

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

            #endregion

            this.utlPurchase.txtID.OnFormatString();
            this.utlSummingUp.txtID.SetZeroToNullString();
        }
        public void Init()
        {
            if (this.gPageType != Common.gePageType.None)
            {
                switch (this.gPageType)
                {
                    case Common.gePageType.InpOrder:
                        this.pgId = DataPgEvidence.PGName.Order.OrderListPrint;
                        break;
                }
            }
            else
            {
                EntitySearch entity = new EntitySearch();
                entity.PropertyChanged -= this.utlID_F.MstID_Changed;
                entity.PropertyChanged += this.utlID_F.MstID_Changed;
                entity.PropertyChanged -= this.utlID_T.MstID_Changed;
                entity.PropertyChanged += this.utlID_T.MstID_Changed;

                switch (this.gWinMsterType)
                {
                    #region 得意先

                    case Common.geWinMsterType.Customer:
                        this.lblID.Content = "得意先";
                        this.utlID_F.MstKbn = MstData.geMDataKbn.Customer_F;
                        this.utlID_T.MstKbn = MstData.geMDataKbn.Customer_T;

                        this.utlID_F.txtID.InputMode = ExTextBox.geInputMode.ID;
                        this.utlID_F.txtID.MaxLengthB = Common.gintidFigureCustomer;
                        this.utlID_T.txtID.InputMode = ExTextBox.geInputMode.ID;
                        this.utlID_T.txtID.MaxLengthB = Common.gintidFigureCustomer;

                        this.cmbOrder.Items.Clear();
                        this.cmbOrder.Items.Add("ID順");
                        this.cmbOrder.Items.Add("得意先分類順");
                        this.cmbOrder.Items.Add("フリガナ順");
                        this.cmbOrder.SelectedIndex = 0;

                        this.pgId = DataPgEvidence.PGName.Mst.Customer;

                        Binding BindingCustomerF = new Binding("customer_id_from");
                        BindingCustomerF.Mode = BindingMode.TwoWay;
                        BindingCustomerF.Source = entity;
                        this.utlID_F.txtID.SetBinding(TextBox.TextProperty, BindingCustomerF);

                        Binding BindingCustomerT = new Binding("customer_id_to");
                        BindingCustomerT.Mode = BindingMode.TwoWay;
                        BindingCustomerT.Source = entity;
                        this.utlID_T.txtID.SetBinding(TextBox.TextProperty, BindingCustomerT);

                        break;

                    #endregion

                    #region 納入先

                    case Common.geWinMsterType.Supplier:
                        this.lblID.Content = "得意先";
                        this.utlID_F.MstKbn = MstData.geMDataKbn.Customer_F;
                        this.utlID_T.MstKbn = MstData.geMDataKbn.Customer_T;

                        this.utlID_F.txtID.InputMode = ExTextBox.geInputMode.ID;
                        this.utlID_F.txtID.MaxLengthB = Common.gintidFigureCustomer;
                        this.utlID_T.txtID.InputMode = ExTextBox.geInputMode.ID;
                        this.utlID_T.txtID.MaxLengthB = Common.gintidFigureCustomer;

                        this.cmbOrder.Items.Clear();
                        this.cmbOrder.Items.Add("得意先ID");
                        this.cmbOrder.Items.Add("納入先ID順");
                        this.cmbOrder.Items.Add("フリガナ順");
                        this.cmbOrder.SelectedIndex = 0;

                        this.pgId = DataPgEvidence.PGName.Mst.Supplier;

                        Binding BindingSupplierF = new Binding("customer_id_from");
                        BindingSupplierF.Mode = BindingMode.TwoWay;
                        BindingSupplierF.Source = entity;
                        this.utlID_F.txtID.SetBinding(TextBox.TextProperty, BindingSupplierF);

                        Binding BindingSupplierT = new Binding("customer_id_to");
                        BindingSupplierT.Mode = BindingMode.TwoWay;
                        BindingSupplierT.Source = entity;
                        this.utlID_T.txtID.SetBinding(TextBox.TextProperty, BindingSupplierT);

                        break;

                    #endregion

                    #region 仕入先

                    case Common.geWinMsterType.Purchase:
                        this.lblID.Content = "仕入先";
                        this.utlID_F.MstKbn = MstData.geMDataKbn.Purchase_F;
                        this.utlID_T.MstKbn = MstData.geMDataKbn.Purchase_T;

                        this.utlID_F.txtID.InputMode = ExTextBox.geInputMode.ID;
                        this.utlID_F.txtID.MaxLengthB = Common.gintidFigurePurchase;
                        this.utlID_T.txtID.InputMode = ExTextBox.geInputMode.ID;
                        this.utlID_T.txtID.MaxLengthB = Common.gintidFigurePurchase;

                        this.cmbOrder.Items.Clear();
                        this.cmbOrder.Items.Add("ID順");
                        this.cmbOrder.Items.Add("仕入先分類順");
                        this.cmbOrder.Items.Add("フリガナ順");
                        this.cmbOrder.SelectedIndex = 0;

                        this.pgId = DataPgEvidence.PGName.Mst.Purchase;

                        Binding BindingPurchaseF = new Binding("purchase_id_from");
                        BindingPurchaseF.Mode = BindingMode.TwoWay;
                        BindingPurchaseF.Source = entity;
                        this.utlID_F.txtID.SetBinding(TextBox.TextProperty, BindingPurchaseF);

                        Binding BindingPurchaseT = new Binding("purchase_id_to");
                        BindingPurchaseT.Mode = BindingMode.TwoWay;
                        BindingPurchaseT.Source = entity;
                        this.utlID_T.txtID.SetBinding(TextBox.TextProperty, BindingPurchaseT);

                        break;

                    #endregion

                    #region 担当者

                    case Common.geWinMsterType.Person:
                        this.lblID.Content = "担当者";
                        this.utlID_F.MstKbn = MstData.geMDataKbn.Person_F;
                        this.utlID_T.MstKbn = MstData.geMDataKbn.Person_T;

                        this.utlID_F.txtID.InputMode = ExTextBox.geInputMode.Number;
                        this.utlID_F.txtID.MinNumber = 1;
                        this.utlID_F.txtID.MaxNumber = 999;
                        this.utlID_F.txtID.FormatString = "000";
                        this.utlID_T.txtID.InputMode = ExTextBox.geInputMode.Number;
                        this.utlID_T.txtID.MinNumber = 1;
                        this.utlID_T.txtID.MaxNumber = 999;
                        this.utlID_T.txtID.FormatString = "000";

                        this.cmbOrder.Items.Clear();
                        this.cmbOrder.Items.Add("ID順");
                        this.cmbOrder.Items.Add("グループID順");
                        this.cmbOrder.SelectedIndex = 0;

                        this.pgId = DataPgEvidence.PGName.Mst.Person;

                        Binding BindingPersonF = new Binding("person_id_from");
                        BindingPersonF.Mode = BindingMode.TwoWay;
                        BindingPersonF.Source = entity;
                        this.utlID_F.txtID.SetBinding(TextBox.TextProperty, BindingPersonF);

                        Binding BindingPersonT = new Binding("person_id_to");
                        BindingPersonT.Mode = BindingMode.TwoWay;
                        BindingPersonT.Source = entity;
                        this.utlID_T.txtID.SetBinding(TextBox.TextProperty, BindingPersonT);

                        break;

                    #endregion

                    #region 商品

                    case Common.geWinMsterType.Commodity:
                        this.lblID.Content = "商品";
                        this.utlID_F.MstKbn = MstData.geMDataKbn.Commodity_F;
                        this.utlID_T.MstKbn = MstData.geMDataKbn.Commodity_T;

                        this.utlID_F.txtID.InputMode = ExTextBox.geInputMode.ID;
                        this.utlID_F.txtID.MaxLengthB = Common.gintidFigureCommodity;
                        this.utlID_T.txtID.InputMode = ExTextBox.geInputMode.ID;
                        this.utlID_T.txtID.MaxLengthB = Common.gintidFigureCommodity;

                        this.cmbOrder.Items.Clear();
                        this.cmbOrder.Items.Add("ID順");
                        this.cmbOrder.Items.Add("商品分類順");
                        this.cmbOrder.Items.Add("フリガナ順");
                        this.cmbOrder.SelectedIndex = 0;

                        this.pgId = DataPgEvidence.PGName.Mst.Commodity;

                        Binding BindingCommodityF = new Binding("commodity_id_from");
                        BindingCommodityF.Mode = BindingMode.TwoWay;
                        BindingCommodityF.Source = entity;
                        this.utlID_F.txtID.SetBinding(TextBox.TextProperty, BindingCommodityF);

                        Binding BindingCommodityT = new Binding("commodity_id_to");
                        BindingCommodityT.Mode = BindingMode.TwoWay;
                        BindingCommodityT.Source = entity;
                        this.utlID_T.txtID.SetBinding(TextBox.TextProperty, BindingCommodityT);

                        break;

                    #endregion

                    #region 締区分

                    case Common.geWinMsterType.Condition:
                        this.lblID.Content = "締区分";
                        this.utlID_F.MstKbn = MstData.geMDataKbn.Condition_F;
                        this.utlID_T.MstKbn = MstData.geMDataKbn.Condition_T;

                        this.utlID_F.txtID.InputMode = ExTextBox.geInputMode.Number;
                        this.utlID_F.txtID.MinNumber = 1;
                        this.utlID_F.txtID.MaxNumber = 99;
                        this.utlID_F.txtID.FormatString = "00";
                        this.utlID_T.txtID.InputMode = ExTextBox.geInputMode.Number;
                        this.utlID_T.txtID.MinNumber = 1;
                        this.utlID_T.txtID.MaxNumber = 99;
                        this.utlID_T.txtID.FormatString = "00";

                        this.cmbOrder.Items.Clear();
                        this.cmbOrder.Items.Add("ID順");
                        this.cmbOrder.SelectedIndex = 0;

                        this.pgId = DataPgEvidence.PGName.Mst.Condition;

                        Binding BindingConditionF = new Binding("condition_id_from");
                        BindingConditionF.Mode = BindingMode.TwoWay;
                        BindingConditionF.Source = entity;
                        this.utlID_F.txtID.SetBinding(TextBox.TextProperty, BindingConditionF);

                        Binding BindingConditionT = new Binding("condition_id_to");
                        BindingConditionT.Mode = BindingMode.TwoWay;
                        BindingConditionT.Source = entity;
                        this.utlID_T.txtID.SetBinding(TextBox.TextProperty, BindingConditionT);

                        break;

                    #endregion

                    #region 分類

                    case Common.geWinMsterType.Class:
                        this.lblID.Content = "分類";
                        this.utlID_F.MstKbn = MstData.geMDataKbn.Group_F;
                        this.utlID_T.MstKbn = MstData.geMDataKbn.Group_T;
                        this.utlID_F.MstGroupKbn = this.MstGroupKbn;
                        this.utlID_T.MstGroupKbn = this.MstGroupKbn;

                        this.utlID_F.txtID.InputMode = ExTextBox.geInputMode.Number;
                        this.utlID_F.txtID.MinNumber = 1;
                        this.utlID_F.txtID.MaxNumber = 999;
                        this.utlID_F.txtID.FormatString = "000";
                        this.utlID_T.txtID.InputMode = ExTextBox.geInputMode.Number;
                        this.utlID_T.txtID.MinNumber = 1;
                        this.utlID_T.txtID.MaxNumber = 999;
                        this.utlID_T.txtID.FormatString = "000";

                        this.cmbOrder.Items.Clear();
                        this.cmbOrder.Items.Add("ID順");
                        this.cmbOrder.SelectedIndex = 0;

                        this.pgId = DataPgEvidence.PGName.Mst.Class;

                        Binding BindingClassF = new Binding("class_id_from");
                        BindingClassF.Mode = BindingMode.TwoWay;
                        BindingClassF.Source = entity;
                        this.utlID_F.txtID.SetBinding(TextBox.TextProperty, BindingClassF);

                        Binding BindingClassT = new Binding("class_id_to");
                        BindingClassT.Mode = BindingMode.TwoWay;
                        BindingClassT.Source = entity;
                        this.utlID_T.txtID.SetBinding(TextBox.TextProperty, BindingClassT);

                        break;

                    #endregion
                }
            }
        }