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

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

                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._purchase_unit_price_skip_tax   = objDataFormOrderD[i].purchase_unit_price_skip_tax;
                entity._purchase_unit_price_before_tax = objDataFormOrderD[i].purchase_unit_price_before_tax;
                entity._number_decimal_digit           = objDataFormOrderD[i].number_decimal_digit;
                entity._unit_decimal_digit             = objDataFormOrderD[i].unit_decimal_digit;
                entity._purchase_order_id              = objDataFormOrderD[i].order_id;
                entity._purchase_order_number          = objDataFormOrderD[i].order_number;
                entity._purchase_order_stay_number     = objDataFormOrderD[i].order_stay_number;

                _entityListD.Add(entity);
            }
        }
Ejemplo n.º 2
0
 public static void CalRedcDetail(EntityPurchaseD _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;
 }
        public override void RecordAdd()
        {
            if (Common.gblnDesynchronizeLock == true) return;

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

            EntityPurchaseD entity = new EntityPurchaseD();
            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;
            }
        }
        private void ConvertBeforeData(EntityPurchaseH _prm_entityH,
                                       ObservableCollection<EntityPurchaseD> _prm_entityListD,
                                       EntityPurchaseH _prm_before_entityH,
                                       ObservableCollection<EntityPurchaseD> _prm_before_entityListD)
        {

            #region Set Entity Detail
            
            _prm_before_entityListD.Clear();

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

                EntityPurchaseD _entityD = new EntityPurchaseD();

                _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._purchase_order_id = _prm_entityListD[i]._purchase_order_id;
                _entityD._purchase_order_number = _prm_entityListD[i]._purchase_order_number;
                _entityD._purchase_order_stay_number = _prm_entityListD[i]._purchase_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._purchase_order_no = _prm_entityH._purchase_order_no;
            _prm_before_entityH._purchase_ymd = _prm_entityH._purchase_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._payment_close_flg = _prm_entityH._payment_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._payment_credit_price = _prm_entityH._payment_credit_price;
            _prm_before_entityH._before_payment_credit_price = _prm_entityH._before_payment_credit_price;

            _prm_before_entityH._payment_yyyymmdd = _prm_entityH._payment_yyyymmdd;
            _prm_before_entityH._credit_rate = _prm_entityH._credit_rate;
            _prm_before_entityH._payment_day = _prm_entityH._payment_day;
            _prm_before_entityH._payment_cycle_id = _prm_entityH._payment_cycle_id;
            _prm_before_entityH._payment_no = _prm_entityH._payment_no;
            _prm_before_entityH._payment_state = _prm_entityH._payment_state;
            _prm_before_entityH._payment_cash_receivable_kbn = _prm_entityH._payment_cash_receivable_kbn;
            _prm_before_entityH._payment_cash_receivable_kbn_nm = _prm_entityH._payment_cash_receivable_kbn_nm;
            _prm_before_entityH._lock_flg = _prm_entityH._lock_flg;
            _prm_before_entityH._message = _prm_entityH._message;

            #endregion
        }
        private void ConverPurchaseOrderToSales(EntityPurchaseH _EntityPurchaseH,
                                                ObservableCollection<EntityPurchaseD> _entitySalesListD,
                                                EntityPurchaseOrderH _EntityPurchaseOrderH,
                                                ObservableCollection<EntityPurchaseOrderD> _entityListOrderD)
        {
            #region Set Entity Head

            _EntityPurchaseH._purchase_order_no = _EntityPurchaseOrderH._no;
            //_EntityPurchaseH._sales_ymd = _EntityPurchaseOrderH.or;

            this.utlPurchase.Is_MstID_Changed = false;
            this.utlSupplier.Is_MstID_Changed = false;

            _EntityPurchaseH._customer_id = _EntityPurchaseOrderH._customer_id;
            _EntityPurchaseH._customer_name = _EntityPurchaseOrderH._customer_name;

            _EntityPurchaseH._supplier_id = _EntityPurchaseOrderH._supplier_id;
            _EntityPurchaseH._supplier_name = _EntityPurchaseOrderH._supplier_name;

            this.utlPurchase.Is_MstID_Changed = true;
            this.utlSupplier.Is_MstID_Changed = true;
            this.utlPurchase.MstID_Changed(_EntityPurchaseOrderH, new PropertyChangedEventArgs("customer_id"));
            this.utlSupplier.MstID_Changed(_EntityPurchaseOrderH, new PropertyChangedEventArgs("supplier_id"));

            _EntityPurchaseH._tax_change_id = _EntityPurchaseOrderH._tax_change_id;
            _EntityPurchaseH._tax_change_name = _EntityPurchaseOrderH._tax_change_name;

            _EntityPurchaseH._business_division_id = _EntityPurchaseOrderH._business_division_id;
            _EntityPurchaseH._business_division_name = _EntityPurchaseOrderH._business_division_name;

            _EntityPurchaseH._supply_ymd = _EntityPurchaseOrderH._supply_ymd;
            _EntityPurchaseH._sum_enter_number = _EntityPurchaseOrderH._sum_enter_number;
            _EntityPurchaseH._sum_case_number = _EntityPurchaseOrderH._sum_case_number;
            _EntityPurchaseH._sum_number = _EntityPurchaseOrderH._sum_number;
            _EntityPurchaseH._sum_unit_price = _EntityPurchaseOrderH._sum_unit_price;
            //_EntityPurchaseH._sum_sales_cost = _EntityPurchaseOrderH._sum_sales_cost;
            _EntityPurchaseH._sum_tax = _EntityPurchaseOrderH._sum_tax;
            _EntityPurchaseH._sum_no_tax_price = _EntityPurchaseOrderH._sum_no_tax_price;
            _EntityPurchaseH._sum_price = _EntityPurchaseOrderH._sum_price;
            //_EntityPurchaseH._sum_profits = _EntityPurchaseOrderH._sum_profits;
            //_EntityPurchaseH._profits_percent = _EntityPurchaseOrderH._profits_percent;
            //_EntityPurchaseH._credit_limit_price = _EntityPurchaseOrderH._credit_limit_price;
            _EntityPurchaseH._payment_credit_price = _EntityPurchaseOrderH._payment_credit_price;
            _EntityPurchaseH._before_payment_credit_price = _EntityPurchaseOrderH._payment_credit_price;

            _EntityPurchaseH._credit_rate = _EntityPurchaseOrderH._credit_rate;
            _EntityPurchaseH._unit_kind_id = _EntityPurchaseOrderH._unit_kind_id;

            _EntityPurchaseH._payment_state = "";
            _EntityPurchaseH._payment_cash_receivable_kbn = 1;
            _EntityPurchaseH._payment_cash_receivable_kbn_nm = "消込未";

            _EntityPurchaseH._memo = _EntityPurchaseOrderH._memo;

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

            //_EntityPurchaseH._lock_flg = (int)lockFlg;

            #endregion

            #region Set Entity Detail

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

            for (int i = 0; i <= _entityListOrderD.Count - 1; i++)
            {
                EntityPurchaseD _entityD = new EntityPurchaseD();
                _entityD._id = _EntityPurchaseH._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._purchase_order_id = _EntityPurchaseOrderH._id;
                _entityD._purchase_order_number = _entityListOrderD[i]._number;
                _entityD._purchase_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 EntityPurchaseD 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++)
            {
                EntityPurchaseD entity = new EntityPurchaseD();

                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._purchase_unit_price_skip_tax = objDataFormOrderD[i].purchase_unit_price_skip_tax;
                entity._purchase_unit_price_before_tax = objDataFormOrderD[i].purchase_unit_price_before_tax;
                entity._number_decimal_digit = objDataFormOrderD[i].number_decimal_digit;
                entity._unit_decimal_digit = objDataFormOrderD[i].unit_decimal_digit;
                entity._purchase_order_id = objDataFormOrderD[i].order_id;
                entity._purchase_order_number = objDataFormOrderD[i].order_number;
                entity._purchase_order_stay_number = objDataFormOrderD[i].order_stay_number;

                _entityListD.Add(entity);
            }
        }
        private void ConvertDetailToDataForm()
        {
            if (_entityListD == null)
            {
                // 行番号
                EntityPurchaseD entity = new EntityPurchaseD();
                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<EntityPurchaseD>();
                _entityListD.Add(entity);

                return;
            }

            for (int i = 0; i <= _entityListD.Count - 1; i++)
            {
                EntityDataFormOrderD _entityDataFormOrderD = new EntityDataFormOrderD();

                _entityDataFormOrderD.id = _entityListD[i]._id;
                _entityDataFormOrderD.rec_no = _entityListD[i]._rec_no;
                _entityDataFormOrderD.breakdown_id = _entityListD[i]._breakdown_id;
                _entityDataFormOrderD.breakdown_nm = _entityListD[i]._breakdown_nm;
                _entityDataFormOrderD.deliver_division_id = _entityListD[i]._deliver_division_id;
                _entityDataFormOrderD.deliver_division_nm = _entityListD[i]._deliver_division_nm;
                _entityDataFormOrderD.commodity_id = _entityListD[i]._commodity_id;
                _entityDataFormOrderD.commodity_name = _entityListD[i]._commodity_name;
                _entityDataFormOrderD.unit_id = _entityListD[i]._unit_id;
                _entityDataFormOrderD.unit_nm = _entityListD[i]._unit_nm;
                _entityDataFormOrderD.enter_number = _entityListD[i]._enter_number;
                _entityDataFormOrderD.case_number = _entityListD[i]._case_number;
                _entityDataFormOrderD.number = _entityListD[i]._number;
                _entityDataFormOrderD.unit_price = _entityListD[i]._unit_price;
                //_entityDataFormOrderD.sales_cost = _entityListD[i]._sales_cost;
                _entityDataFormOrderD.tax = _entityListD[i]._tax;
                _entityDataFormOrderD.no_tax_price = _entityListD[i]._no_tax_price;
                _entityDataFormOrderD.price = _entityListD[i]._price;
                //_entityDataFormOrderD.profits = _entityListD[i]._profits;
                //_entityDataFormOrderD.profits_percent = _entityListD[i]._profits_percent;
                _entityDataFormOrderD.memo = _entityListD[i]._memo;
                _entityDataFormOrderD.tax_division_id = _entityListD[i]._tax_division_id;
                _entityDataFormOrderD.tax_division_nm = _entityListD[i]._tax_division_nm;
                _entityDataFormOrderD.tax_percent = _entityListD[i]._tax_percent;
                _entityDataFormOrderD.inventory_management_division_id = _entityListD[i]._inventory_management_division_id;
                _entityDataFormOrderD.inventory_number = _entityListD[i]._inventory_number;
                _entityDataFormOrderD.retail_price_skip_tax = _entityListD[i]._retail_price_skip_tax;
                _entityDataFormOrderD.retail_price_before_tax = _entityListD[i]._retail_price_before_tax;
                _entityDataFormOrderD.sales_unit_price_skip_tax = _entityListD[i]._sales_unit_price_skip_tax;
                _entityDataFormOrderD.sales_unit_price_before_tax = _entityListD[i]._sales_unit_price_before_tax;
                _entityDataFormOrderD.sales_cost_price_skip_tax = _entityListD[i]._sales_cost_price_skip_tax;
                _entityDataFormOrderD.sales_cost_price_before_tax = _entityListD[i]._sales_cost_price_before_tax;
                _entityDataFormOrderD.purchase_unit_price_skip_tax = _entityListD[i]._purchase_unit_price_skip_tax;
                _entityDataFormOrderD.purchase_unit_price_before_tax = _entityListD[i]._purchase_unit_price_before_tax;
                _entityDataFormOrderD.id = _entityListD[i]._number_decimal_digit;
                _entityDataFormOrderD.id = _entityListD[i]._unit_decimal_digit;
                _entityDataFormOrderD.order_id = _entityListD[i]._purchase_order_id;
                _entityDataFormOrderD.order_number = _entityListD[i]._purchase_order_number;
                _entityDataFormOrderD.order_stay_number = _entityListD[i]._purchase_order_stay_number;

                objDataFormOrderD.Add(_entityDataFormOrderD);
            }
        }
        private void ConvertDetailToDataForm()
        {
            if (_entityListD == null)
            {
                // 行番号
                EntityPurchaseD entity = new EntityPurchaseD();
                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 <EntityPurchaseD>();
                _entityListD.Add(entity);

                return;
            }

            for (int i = 0; i <= _entityListD.Count - 1; i++)
            {
                EntityDataFormOrderD _entityDataFormOrderD = new EntityDataFormOrderD();

                _entityDataFormOrderD.id                  = _entityListD[i]._id;
                _entityDataFormOrderD.rec_no              = _entityListD[i]._rec_no;
                _entityDataFormOrderD.breakdown_id        = _entityListD[i]._breakdown_id;
                _entityDataFormOrderD.breakdown_nm        = _entityListD[i]._breakdown_nm;
                _entityDataFormOrderD.deliver_division_id = _entityListD[i]._deliver_division_id;
                _entityDataFormOrderD.deliver_division_nm = _entityListD[i]._deliver_division_nm;
                _entityDataFormOrderD.commodity_id        = _entityListD[i]._commodity_id;
                _entityDataFormOrderD.commodity_name      = _entityListD[i]._commodity_name;
                _entityDataFormOrderD.unit_id             = _entityListD[i]._unit_id;
                _entityDataFormOrderD.unit_nm             = _entityListD[i]._unit_nm;
                _entityDataFormOrderD.enter_number        = _entityListD[i]._enter_number;
                _entityDataFormOrderD.case_number         = _entityListD[i]._case_number;
                _entityDataFormOrderD.number              = _entityListD[i]._number;
                _entityDataFormOrderD.unit_price          = _entityListD[i]._unit_price;
                //_entityDataFormOrderD.sales_cost = _entityListD[i]._sales_cost;
                _entityDataFormOrderD.tax          = _entityListD[i]._tax;
                _entityDataFormOrderD.no_tax_price = _entityListD[i]._no_tax_price;
                _entityDataFormOrderD.price        = _entityListD[i]._price;
                //_entityDataFormOrderD.profits = _entityListD[i]._profits;
                //_entityDataFormOrderD.profits_percent = _entityListD[i]._profits_percent;
                _entityDataFormOrderD.memo            = _entityListD[i]._memo;
                _entityDataFormOrderD.tax_division_id = _entityListD[i]._tax_division_id;
                _entityDataFormOrderD.tax_division_nm = _entityListD[i]._tax_division_nm;
                _entityDataFormOrderD.tax_percent     = _entityListD[i]._tax_percent;
                _entityDataFormOrderD.inventory_management_division_id = _entityListD[i]._inventory_management_division_id;
                _entityDataFormOrderD.inventory_number               = _entityListD[i]._inventory_number;
                _entityDataFormOrderD.retail_price_skip_tax          = _entityListD[i]._retail_price_skip_tax;
                _entityDataFormOrderD.retail_price_before_tax        = _entityListD[i]._retail_price_before_tax;
                _entityDataFormOrderD.sales_unit_price_skip_tax      = _entityListD[i]._sales_unit_price_skip_tax;
                _entityDataFormOrderD.sales_unit_price_before_tax    = _entityListD[i]._sales_unit_price_before_tax;
                _entityDataFormOrderD.sales_cost_price_skip_tax      = _entityListD[i]._sales_cost_price_skip_tax;
                _entityDataFormOrderD.sales_cost_price_before_tax    = _entityListD[i]._sales_cost_price_before_tax;
                _entityDataFormOrderD.purchase_unit_price_skip_tax   = _entityListD[i]._purchase_unit_price_skip_tax;
                _entityDataFormOrderD.purchase_unit_price_before_tax = _entityListD[i]._purchase_unit_price_before_tax;
                _entityDataFormOrderD.id                = _entityListD[i]._number_decimal_digit;
                _entityDataFormOrderD.id                = _entityListD[i]._unit_decimal_digit;
                _entityDataFormOrderD.order_id          = _entityListD[i]._purchase_order_id;
                _entityDataFormOrderD.order_number      = _entityListD[i]._purchase_order_number;
                _entityDataFormOrderD.order_stay_number = _entityListD[i]._purchase_order_stay_number;

                objDataFormOrderD.Add(_entityDataFormOrderD);
            }
        }