private void ConvertDataFormToDetail()
        {
            this.DataForm.CommitEdit();
            if (_entityListD != null)
            {
                _entityListD.Clear();
            }

            for (int i = 0; i <= objDataFormOrderD.Count - 1; i++)
            {
                EntitySalesD entity = new EntitySalesD();

                entity._id                          = objDataFormOrderD[i].id;
                entity._rec_no                      = objDataFormOrderD[i].rec_no;
                entity._breakdown_id                = objDataFormOrderD[i].breakdown_id;
                entity._breakdown_nm                = objDataFormOrderD[i].breakdown_nm;
                entity._deliver_division_id         = objDataFormOrderD[i].deliver_division_id;
                entity._deliver_division_nm         = objDataFormOrderD[i].deliver_division_nm;
                entity._commodity_id                = objDataFormOrderD[i].commodity_id;
                entity._commodity_name              = objDataFormOrderD[i].commodity_name;
                entity._unit_id                     = objDataFormOrderD[i].unit_id;
                entity._unit_nm                     = objDataFormOrderD[i].unit_nm;
                entity._enter_number                = objDataFormOrderD[i].enter_number;
                entity._case_number                 = objDataFormOrderD[i].case_number;
                entity._number                      = objDataFormOrderD[i].number;
                entity._unit_price                  = objDataFormOrderD[i].unit_price;
                entity._sales_cost                  = objDataFormOrderD[i].sales_cost;
                entity._tax                         = objDataFormOrderD[i].tax;
                entity._no_tax_price                = objDataFormOrderD[i].no_tax_price;
                entity._price                       = objDataFormOrderD[i].price;
                entity._profits                     = objDataFormOrderD[i].profits;
                entity._profits_percent             = objDataFormOrderD[i].profits_percent;
                entity._memo                        = objDataFormOrderD[i].memo;
                entity._tax_division_id             = objDataFormOrderD[i].tax_division_id;
                entity._tax_division_nm             = objDataFormOrderD[i].tax_division_nm;
                entity._tax_percent                 = objDataFormOrderD[i].tax_percent;
                entity._inventory_number            = objDataFormOrderD[i].inventory_number;
                entity._retail_price_skip_tax       = objDataFormOrderD[i].retail_price_skip_tax;
                entity._retail_price_before_tax     = objDataFormOrderD[i].retail_price_before_tax;
                entity._sales_unit_price_skip_tax   = objDataFormOrderD[i].sales_unit_price_skip_tax;
                entity._sales_unit_price_before_tax = objDataFormOrderD[i].sales_unit_price_before_tax;
                entity._sales_cost_price_skip_tax   = objDataFormOrderD[i].sales_cost_price_skip_tax;
                entity._sales_cost_price_before_tax = objDataFormOrderD[i].sales_cost_price_before_tax;
                entity._number_decimal_digit        = objDataFormOrderD[i].number_decimal_digit;
                entity._unit_decimal_digit          = objDataFormOrderD[i].unit_decimal_digit;
                entity._order_id                    = objDataFormOrderD[i].order_id;
                entity._order_number                = objDataFormOrderD[i].order_number;
                entity._order_stay_number           = objDataFormOrderD[i].order_stay_number;

                _entityListD.Add(entity);
            }
        }
        private void ConvertDetailToDataForm()
        {
            if (_entityListD == null)
            {
                // 行番号
                EntitySalesD entity = new EntitySalesD();
                entity._rec_no = 1;

                // コンボボックス初期選択
                List <string> lst;
                lst = MeiNameList.GetListMei(MeiNameList.geNameKbn.BREAKDOWN_ID);
                entity._breakdown_nm = lst[0];
                lst                     = MeiNameList.GetListMei(MeiNameList.geNameKbn.UNIT_ID);
                entity._unit_nm         = lst[0];
                lst                     = MeiNameList.GetListMei(MeiNameList.geNameKbn.TAX_DIVISION_ID);
                entity._tax_division_nm = lst[0];

                _entityListD = new ObservableCollection <EntitySalesD>();
                _entityListD.Add(entity);

                return;
            }

            for (int i = 0; i <= _entityListD.Count - 1; i++)
            {
                objDataFormOrderD.Add(new EntityDataFormOrderD(_entityListD[i]._id,
                                                               _entityListD[i]._rec_no,
                                                               _entityListD[i]._breakdown_id,
                                                               _entityListD[i]._breakdown_nm,
                                                               _entityListD[i]._deliver_division_id,
                                                               _entityListD[i]._deliver_division_nm,
                                                               _entityListD[i]._commodity_id,
                                                               _entityListD[i]._commodity_name,
                                                               _entityListD[i]._unit_id,
                                                               _entityListD[i]._unit_nm,
                                                               _entityListD[i]._enter_number,
                                                               _entityListD[i]._case_number,
                                                               _entityListD[i]._number,
                                                               _entityListD[i]._unit_price,
                                                               _entityListD[i]._sales_cost,
                                                               _entityListD[i]._tax,
                                                               _entityListD[i]._no_tax_price,
                                                               _entityListD[i]._price,
                                                               _entityListD[i]._profits,
                                                               _entityListD[i]._profits_percent,
                                                               _entityListD[i]._memo,
                                                               _entityListD[i]._tax_division_id,
                                                               _entityListD[i]._tax_division_nm,
                                                               _entityListD[i]._tax_percent,
                                                               _entityListD[i]._inventory_management_division_id,
                                                               _entityListD[i]._inventory_number,
                                                               _entityListD[i]._retail_price_skip_tax,
                                                               _entityListD[i]._retail_price_before_tax,
                                                               _entityListD[i]._sales_unit_price_skip_tax,
                                                               _entityListD[i]._sales_unit_price_before_tax,
                                                               _entityListD[i]._sales_cost_price_skip_tax,
                                                               _entityListD[i]._sales_cost_price_before_tax,
                                                               _entityListD[i]._number_decimal_digit,
                                                               _entityListD[i]._unit_decimal_digit,
                                                               _entityListD[i]._order_id,
                                                               _entityListD[i]._order_number,
                                                               _entityListD[i]._order_stay_number
                                                               ));
            }
        }
        public override void RecordAdd()
        {
            if (Common.gblnDesynchronizeLock == true) return;

            if (_entityListD == null) _entityListD = new ObservableCollection<EntitySalesD>();

            EntitySalesD entity = new EntitySalesD();
            int cnt = 1;
            if (_entityListD != null) cnt = _entityListD.Count + 1;
            entity._rec_no = cnt;
            SetInitCombo(ref entity);   // コンボボックス初期選択
            _entityListD.Add(entity);
            dg.SelectedIndex = entity._rec_no - 1;
            dg.Focus();
            if (dg.CurrentColumn != null)
            {
                dg.ScrollIntoView(entity, dg.Columns[0]);
                dg.CommitEdit();
                dg.CurrentColumn = dg.Columns[0];
                dg.BeginEdit();
                dg.MoveNextCell();
            }

            // ファンクションキー設定
            string _activeCtlName = "";
            if (this.activeControl != null) _activeCtlName = ExCast.zCStr(this.activeControl.Name);
            switch (_activeCtlName)
            {
                case "cboBreakDown":
                case "cboDeliver":
                case "txtGoodsName":
                case "cboUnit":
                case "txtEnterNum":
                case "txtNumber":
                case "txtUnitPrice":
                case "txtPrice":
                case "txtCaseNum":
                case "cboTaxDivision":
                case "txtGoodsID":
                    if (this._entityListD.Count > 1)
                    {
                        ExVisualTreeHelper.SetFunctionKeyEnabled("F8", true, this);
                    }
                    else
                    {
                        ExVisualTreeHelper.SetFunctionKeyEnabled("F8", false, this);
                    }
                    break;
            }
        }
 public static void CalRedcDetail(EntitySalesD _entityD)
 {
     _entityD._case_number = _entityD._case_number * -1;
     _entityD._number = _entityD._number * -1;
     _entityD._tax = _entityD._tax * -1;
     _entityD._no_tax_price = _entityD._no_tax_price * -1;
     _entityD._price = _entityD._price * -1;
     _entityD._profits = _entityD._profits * -1;
 }
        private void ConvertBeforeData(EntitySalesH _prm_entityH,
                                       ObservableCollection<EntitySalesD> _prm_entityListD,
                                       EntitySalesH _prm_before_entityH,
                                       ObservableCollection<EntitySalesD> _prm_before_entityListD)
        {

            #region Set Entity Detail
            
            _prm_before_entityListD.Clear();

            for (int i = 0; i <= _prm_entityListD.Count - 1; i++)
            {

                EntitySalesD _entityD = new EntitySalesD();

                _entityD._id = _prm_entityListD[i]._id;
                _entityD._rec_no = _prm_entityListD[i]._rec_no;
                _entityD._breakdown_id = _prm_entityListD[i]._breakdown_id;
                _entityD._breakdown_nm = _prm_entityListD[i]._breakdown_nm;
                _entityD._deliver_division_id = _prm_entityListD[i]._deliver_division_id;
                _entityD._deliver_division_nm = _prm_entityListD[i]._deliver_division_nm;
                _entityD._commodity_id = _prm_entityListD[i]._commodity_id;
                _entityD._commodity_name = _prm_entityListD[i]._commodity_name;
                _entityD._unit_id = _prm_entityListD[i]._unit_id;
                _entityD._unit_nm = _prm_entityListD[i]._unit_nm;
                _entityD._enter_number = _prm_entityListD[i]._enter_number;
                _entityD._case_number = _prm_entityListD[i]._case_number;
                _entityD._number = _prm_entityListD[i]._number;
                _entityD._unit_price = _prm_entityListD[i]._unit_price;
                _entityD._sales_cost = _prm_entityListD[i]._sales_cost;
                _entityD._tax = _prm_entityListD[i]._tax;
                _entityD._no_tax_price = _prm_entityListD[i]._no_tax_price;
                _entityD._price = _prm_entityListD[i]._price;
                _entityD._profits = _prm_entityListD[i]._profits;
                _entityD._profits_percent = _prm_entityListD[i]._profits_percent;
                _entityD._tax_division_id = _prm_entityListD[i]._tax_division_id;
                _entityD._tax_division_nm = _prm_entityListD[i]._tax_division_nm;
                _entityD._tax_percent = _prm_entityListD[i]._tax_percent;
                _entityD._inventory_management_division_id = _prm_entityListD[i]._inventory_management_division_id;
                _entityD._inventory_number = _prm_entityListD[i]._inventory_number;
                _entityD._retail_price_skip_tax = _prm_entityListD[i]._retail_price_skip_tax;
                _entityD._retail_price_before_tax = _prm_entityListD[i]._retail_price_before_tax;
                _entityD._sales_unit_price_skip_tax = _prm_entityListD[i]._sales_unit_price_skip_tax;
                _entityD._sales_unit_price_before_tax = _prm_entityListD[i]._sales_unit_price_before_tax;
                _entityD._sales_cost_price_skip_tax = _prm_entityListD[i]._sales_cost_price_skip_tax;
                _entityD._sales_cost_price_before_tax = _prm_entityListD[i]._sales_cost_price_before_tax;
                _entityD._number_decimal_digit = _prm_entityListD[i]._number_decimal_digit;
                _entityD._unit_decimal_digit = _prm_entityListD[i]._unit_decimal_digit;
                _entityD._order_id = _prm_entityListD[i]._order_id;
                _entityD._order_number = _prm_entityListD[i]._order_number;
                _entityD._order_stay_number = _prm_entityListD[i]._order_stay_number;
                _entityD._memo = _prm_entityListD[i]._memo;
                _entityD._lock_flg = _prm_entityListD[i]._lock_flg;
                _entityD._message = _prm_entityListD[i]._message;

                _prm_before_entityListD.Add(_entityD);
            }

            #endregion

            #region Set Entity Head

            _prm_before_entityH._id = _prm_entityH._id;
            _prm_before_entityH._no = _prm_entityH._no;
            _prm_before_entityH._red_before_no = _prm_entityH._red_before_no;
            _prm_before_entityH._order_no = _prm_entityH._order_no;
            _prm_before_entityH._estimateno = _prm_entityH._estimateno;
            _prm_before_entityH._sales_ymd = _prm_entityH._sales_ymd;
            _prm_before_entityH._customer_id = _prm_entityH._customer_id;
            _prm_before_entityH._customer_name = _prm_entityH._customer_name;
            _prm_before_entityH._tax_change_id = _prm_entityH._tax_change_id;
            _prm_before_entityH._tax_change_name = _prm_entityH._tax_change_name;
            _prm_before_entityH._business_division_id = _prm_entityH._business_division_id;
            _prm_before_entityH._business_division_name = _prm_entityH._business_division_name;
            _prm_before_entityH._supplier_id = _prm_entityH._supplier_id;
            _prm_before_entityH._supplier_name = _prm_entityH._supplier_name;
            _prm_before_entityH._supply_ymd = _prm_entityH._supply_ymd;
            _prm_before_entityH._sum_enter_number = _prm_entityH._sum_enter_number;
            _prm_before_entityH._sum_case_number = _prm_entityH._sum_case_number;
            _prm_before_entityH._sum_number = _prm_entityH._sum_number;
            _prm_before_entityH._sum_unit_price = _prm_entityH._sum_unit_price;
            _prm_before_entityH._sum_sales_cost = _prm_entityH._sum_sales_cost;
            _prm_before_entityH._sum_tax = _prm_entityH._sum_tax;
            _prm_before_entityH._sum_no_tax_price = _prm_entityH._sum_no_tax_price;
            _prm_before_entityH._sum_price = _prm_entityH._sum_price;
            _prm_before_entityH._sum_profits = _prm_entityH._sum_profits;
            _prm_before_entityH._profits_percent = _prm_entityH._profits_percent;
            _prm_before_entityH._invoice_close_flg = _prm_entityH._invoice_close_flg;
            _prm_before_entityH._memo = _prm_entityH._memo;
            _prm_before_entityH._update_flg = _prm_entityH._update_flg;
            _prm_before_entityH._update_person_id = _prm_entityH._update_person_id;
            _prm_before_entityH._update_person_nm = _prm_entityH._update_person_nm;
            _prm_before_entityH._update_date = _prm_entityH._update_date;
            _prm_before_entityH._update_time = _prm_entityH._update_time;
            _prm_before_entityH._price_fraction_proc_id = _prm_entityH._price_fraction_proc_id;
            _prm_before_entityH._tax_fraction_proc_id = _prm_entityH._tax_fraction_proc_id;
            _prm_before_entityH._unit_kind_id = _prm_entityH._unit_kind_id;
            _prm_before_entityH._credit_limit_price = _prm_entityH._credit_limit_price;
            _prm_before_entityH._sales_credit_price = _prm_entityH._sales_credit_price;
            _prm_before_entityH._before_sales_credit_price = _prm_entityH._before_sales_credit_price;
            _prm_before_entityH._invoice_id = _prm_entityH._invoice_id;
            _prm_before_entityH._invoice_name = _prm_entityH._invoice_name;
            _prm_before_entityH._invoice_yyyymmdd = _prm_entityH._invoice_yyyymmdd;
            _prm_before_entityH._credit_rate = _prm_entityH._credit_rate;
            _prm_before_entityH._collect_day = _prm_entityH._collect_day;
            _prm_before_entityH._collect_cycle_id = _prm_entityH._collect_cycle_id;
            _prm_before_entityH._invoice_no = _prm_entityH._invoice_no;
            _prm_before_entityH._invoice_state = _prm_entityH._invoice_state;
            _prm_before_entityH._receipt_receivable_kbn = _prm_entityH._receipt_receivable_kbn;
            _prm_before_entityH._receipt_receivable_kbn_nm = _prm_entityH._receipt_receivable_kbn_nm;
            _prm_before_entityH._lock_flg = _prm_entityH._lock_flg;
            _prm_before_entityH._message = _prm_entityH._message;

            #endregion
        }
        private void ConverOrderToSales(EntitySalesH _entitySalesH,
                                        ObservableCollection<EntitySalesD> _entitySalesListD,
                                        EntityOrderH _entityOrderH,
                                        ObservableCollection<EntityOrderD> _entityListOrderD)
        {
            #region Set Entity Head

            _entitySalesH._estimateno = _entityOrderH._estimateno;
            //_entitySalesH._sales_ymd = _entityOrderH.or;

            this.utlCustomer.Is_MstID_Changed = false;
            this.utlSupply.Is_MstID_Changed = false;

            _entitySalesH._customer_id = _entityOrderH._customer_id;
            _entitySalesH._customer_name = _entityOrderH._customer_name;

            _entitySalesH._supplier_id = _entityOrderH._supplier_id;
            _entitySalesH._supplier_name = _entityOrderH._supplier_name;

            this.utlCustomer.Is_MstID_Changed = true;
            this.utlSupply.Is_MstID_Changed = true;
            this.utlCustomer.MstID_Changed(_entityOrderH, new PropertyChangedEventArgs("customer_id"));
            this.utlSupply.MstID_Changed(_entityOrderH, new PropertyChangedEventArgs("supplier_id"));

            _entitySalesH._tax_change_id = _entityOrderH._tax_change_id;
            _entitySalesH._tax_change_name = _entityOrderH._tax_change_name;

            _entitySalesH._business_division_id = _entityOrderH._business_division_id;
            _entitySalesH._business_division_name = _entityOrderH._business_division_name;

            _entitySalesH._supply_ymd = _entityOrderH._supply_ymd;
            _entitySalesH._sum_enter_number = _entityOrderH._sum_enter_number;
            _entitySalesH._sum_case_number = _entityOrderH._sum_case_number;
            _entitySalesH._sum_number = _entityOrderH._sum_number;
            _entitySalesH._sum_unit_price = _entityOrderH._sum_unit_price;
            _entitySalesH._sum_sales_cost = _entityOrderH._sum_sales_cost;
            _entitySalesH._sum_tax = _entityOrderH._sum_tax;
            _entitySalesH._sum_no_tax_price = _entityOrderH._sum_no_tax_price;
            _entitySalesH._sum_price = _entityOrderH._sum_price;
            _entitySalesH._sum_profits = _entityOrderH._sum_profits;
            _entitySalesH._profits_percent = _entityOrderH._profits_percent;
            _entitySalesH._credit_limit_price = _entityOrderH._credit_limit_price;
            _entitySalesH._sales_credit_price = _entityOrderH._sales_credit_price;
            _entitySalesH._before_sales_credit_price = _entityOrderH._sales_credit_price;

            _entitySalesH._invoice_id = _entityOrderH._invoice_id;
            _entitySalesH._invoice_name = _entityOrderH._invoice_name;

            _entitySalesH._credit_rate = _entityOrderH._credit_rate;
            _entitySalesH._unit_kind_id = _entityOrderH._unit_kind_id;

            _entitySalesH._invoice_state = "";
            _entitySalesH._receipt_receivable_kbn = 1;
            _entitySalesH._receipt_receivable_kbn_nm = "消込未";

            _entitySalesH._memo = _entityOrderH._memo;

            //_entitySalesH._update_person_id = ExCast.zCInt(dt.DefaultView[0]["UPDATE_PERSON_ID"]);
            //_entitySalesH._update_person_nm = ExCast.zCStr(dt.DefaultView[0]["UPDATE_PERSON_NM"]);

            //_entitySalesH._lock_flg = (int)lockFlg;

            #endregion

            #region Set Entity Detail

            if (_entitySalesListD == null) _entitySalesListD = new ObservableCollection<EntitySalesD>();
            _entitySalesListD.Clear();

            for (int i = 0; i <= _entityListOrderD.Count - 1; i++)
            {
                EntitySalesD _entityD = new EntitySalesD();
                _entityD._id = _entitySalesH._id;
                _entityD._rec_no = _entityListOrderD[i]._rec_no;
                _entityD._breakdown_id = _entityListOrderD[i]._breakdown_id;
                _entityD._breakdown_nm = _entityListOrderD[i]._breakdown_nm;
                List<string> lst;
                lst = MeiNameList.GetListMei(MeiNameList.geNameKbn.DELIVER_DIVISION_ID);
                _entityD._deliver_division_nm = lst[2];
                _entityD._deliver_division_id = MeiNameList.GetID(MeiNameList.geNameKbn.DELIVER_DIVISION_ID, lst[2]);
                //_entityD._deliver_division_id = 2;
                //_entityD._deliver_division_nm = _entityListOrderD[i]._deliver_division_nm;
                _entityD._commodity_id = _entityListOrderD[i]._commodity_id;
                _entityD._commodity_name = _entityListOrderD[i]._commodity_name;
                _entityD._unit_id = _entityListOrderD[i]._unit_id;
                _entityD._unit_nm = _entityListOrderD[i]._unit_nm;
                _entityD._enter_number = _entityListOrderD[i]._enter_number;
                _entityD._case_number = _entityListOrderD[i]._case_number;
                _entityD._number = _entityListOrderD[i]._number;
                _entityD._order_id = _entityOrderH._id;
                _entityD._order_number = _entityListOrderD[i]._number;
                _entityD._order_stay_number = 0;
                _entityD._unit_price = _entityListOrderD[i]._unit_price;
                _entityD._sales_cost = _entityListOrderD[i]._sales_cost;
                _entityD._tax = _entityListOrderD[i]._tax;
                _entityD._no_tax_price = _entityListOrderD[i]._no_tax_price;
                _entityD._price = _entityListOrderD[i]._price;
                _entityD._profits = _entityListOrderD[i]._profits;
                _entityD._profits_percent = _entityListOrderD[i]._profits_percent;
                _entityD._memo = _entityListOrderD[i]._memo;
                _entityD._tax_division_id = _entityListOrderD[i]._tax_division_id;
                _entityD._tax_division_nm = _entityListOrderD[i]._tax_division_nm;
                _entityD._tax_percent = _entityListOrderD[i]._tax_percent;
                _entityD._inventory_number = _entityListOrderD[i]._inventory_number;
                _entityD._inventory_management_division_id = _entityListOrderD[i]._inventory_management_division_id;
                _entityD._number_decimal_digit = _entityListOrderD[i]._number_decimal_digit;
                _entityD._unit_decimal_digit = _entityListOrderD[i]._unit_decimal_digit;
                _entitySalesListD.Add(_entityD);
            }

            #endregion
        }
        private void SetInitCombo(ref EntitySalesD entityD)
        {
            // コンボボックス初期選択
            List<string> lst;
            lst = MeiNameList.GetListMei(MeiNameList.geNameKbn.BREAKDOWN_ID);
            entityD._breakdown_nm = lst[0];
            entityD._breakdown_id = MeiNameList.GetID(MeiNameList.geNameKbn.BREAKDOWN_ID, lst[0]);

            lst = MeiNameList.GetListMei(MeiNameList.geNameKbn.DELIVER_DIVISION_ID);
            entityD._deliver_division_nm = lst[2];
            entityD._deliver_division_id = MeiNameList.GetID(MeiNameList.geNameKbn.DELIVER_DIVISION_ID, lst[2]);

            lst = MeiNameList.GetListMei(MeiNameList.geNameKbn.UNIT_ID);
            entityD._unit_nm = lst[0];
            entityD._unit_id = MeiNameList.GetID(MeiNameList.geNameKbn.UNIT_ID, lst[0]);

            lst = MeiNameList.GetListMei(MeiNameList.geNameKbn.TAX_DIVISION_ID);
            entityD._tax_division_nm = lst[0];
            entityD._tax_division_id = MeiNameList.GetID(MeiNameList.geNameKbn.TAX_DIVISION_ID, lst[0]);
        }
        private void ConvertDataFormToDetail()
        {
            this.DataForm.CommitEdit();
            if (_entityListD != null) _entityListD.Clear();

            for (int i = 0; i <= objDataFormOrderD.Count - 1; i++)
            {
                EntitySalesD entity = new EntitySalesD();

                entity._id = objDataFormOrderD[i].id;
                entity._rec_no = objDataFormOrderD[i].rec_no;
                entity._breakdown_id = objDataFormOrderD[i].breakdown_id;
                entity._breakdown_nm = objDataFormOrderD[i].breakdown_nm;
                entity._deliver_division_id = objDataFormOrderD[i].deliver_division_id;
                entity._deliver_division_nm = objDataFormOrderD[i].deliver_division_nm;
                entity._commodity_id = objDataFormOrderD[i].commodity_id;
                entity._commodity_name = objDataFormOrderD[i].commodity_name;
                entity._unit_id = objDataFormOrderD[i].unit_id;
                entity._unit_nm = objDataFormOrderD[i].unit_nm;
                entity._enter_number = objDataFormOrderD[i].enter_number;
                entity._case_number = objDataFormOrderD[i].case_number;
                entity._number = objDataFormOrderD[i].number;
                entity._unit_price = objDataFormOrderD[i].unit_price;
                entity._sales_cost = objDataFormOrderD[i].sales_cost;
                entity._tax = objDataFormOrderD[i].tax;
                entity._no_tax_price = objDataFormOrderD[i].no_tax_price;
                entity._price = objDataFormOrderD[i].price;
                entity._profits = objDataFormOrderD[i].profits;
                entity._profits_percent = objDataFormOrderD[i].profits_percent;
                entity._memo = objDataFormOrderD[i].memo;
                entity._tax_division_id = objDataFormOrderD[i].tax_division_id;
                entity._tax_division_nm = objDataFormOrderD[i].tax_division_nm;
                entity._tax_percent = objDataFormOrderD[i].tax_percent;
                entity._inventory_number = objDataFormOrderD[i].inventory_number;
                entity._retail_price_skip_tax = objDataFormOrderD[i].retail_price_skip_tax;
                entity._retail_price_before_tax = objDataFormOrderD[i].retail_price_before_tax;
                entity._sales_unit_price_skip_tax = objDataFormOrderD[i].sales_unit_price_skip_tax;
                entity._sales_unit_price_before_tax = objDataFormOrderD[i].sales_unit_price_before_tax;
                entity._sales_cost_price_skip_tax = objDataFormOrderD[i].sales_cost_price_skip_tax;
                entity._sales_cost_price_before_tax = objDataFormOrderD[i].sales_cost_price_before_tax;
                entity._number_decimal_digit = objDataFormOrderD[i].number_decimal_digit;
                entity._unit_decimal_digit = objDataFormOrderD[i].unit_decimal_digit;
                entity._order_id = objDataFormOrderD[i].order_id;
                entity._order_number = objDataFormOrderD[i].order_number;
                entity._order_stay_number = objDataFormOrderD[i].order_stay_number;

                _entityListD.Add(entity);
            }
        }
        private void ConvertDetailToDataForm()
        {
            if (_entityListD == null)
            {
                // 行番号
                EntitySalesD entity = new EntitySalesD();
                entity._rec_no = 1;

                // コンボボックス初期選択
                List<string> lst;
                lst = MeiNameList.GetListMei(MeiNameList.geNameKbn.BREAKDOWN_ID);
                entity._breakdown_nm = lst[0];
                lst = MeiNameList.GetListMei(MeiNameList.geNameKbn.UNIT_ID);
                entity._unit_nm = lst[0];
                lst = MeiNameList.GetListMei(MeiNameList.geNameKbn.TAX_DIVISION_ID);
                entity._tax_division_nm = lst[0];

                _entityListD = new ObservableCollection<EntitySalesD>();
                _entityListD.Add(entity);

                return;
            }

            for (int i = 0; i <= _entityListD.Count - 1; i++)
            {
                objDataFormOrderD.Add(new EntityDataFormOrderD(_entityListD[i]._id,
                                                               _entityListD[i]._rec_no,
                                                               _entityListD[i]._breakdown_id,
                                                               _entityListD[i]._breakdown_nm,
                                                               _entityListD[i]._deliver_division_id,
                                                               _entityListD[i]._deliver_division_nm,
                                                               _entityListD[i]._commodity_id,
                                                               _entityListD[i]._commodity_name,
                                                               _entityListD[i]._unit_id,
                                                               _entityListD[i]._unit_nm,
                                                               _entityListD[i]._enter_number,
                                                               _entityListD[i]._case_number,
                                                               _entityListD[i]._number,
                                                               _entityListD[i]._unit_price,
                                                               _entityListD[i]._sales_cost,
                                                               _entityListD[i]._tax,
                                                               _entityListD[i]._no_tax_price,
                                                               _entityListD[i]._price,
                                                               _entityListD[i]._profits,
                                                               _entityListD[i]._profits_percent,
                                                               _entityListD[i]._memo,
                                                               _entityListD[i]._tax_division_id,
                                                               _entityListD[i]._tax_division_nm,
                                                               _entityListD[i]._tax_percent,
                                                               _entityListD[i]._inventory_management_division_id,
                                                               _entityListD[i]._inventory_number,
                                                               _entityListD[i]._retail_price_skip_tax,
                                                               _entityListD[i]._retail_price_before_tax,
                                                               _entityListD[i]._sales_unit_price_skip_tax,
                                                               _entityListD[i]._sales_unit_price_before_tax,
                                                               _entityListD[i]._sales_cost_price_skip_tax,
                                                               _entityListD[i]._sales_cost_price_before_tax,
                                                               _entityListD[i]._number_decimal_digit,
                                                               _entityListD[i]._unit_decimal_digit,
                                                               _entityListD[i]._order_id,
                                                               _entityListD[i]._order_number,
                                                               _entityListD[i]._order_stay_number
                                                               ));
            }
        }