示例#1
0
        private void ConvertDataFormToDetail()
        {
            this.DataForm.CommitEdit();
            if (_entityListD != null)
            {
                _entityListD.Clear();
            }

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

                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;

                _entityListD.Add(entity);
            }
        }
        public override void RecordAdd()
        {
            if (Common.gblnDesynchronizeLock == true) return;

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

            EntityEstimateD entity = new EntityEstimateD();
            int cnt = 1;
            if (_entityListD != null) cnt = _entityListD.Count + 1;
            entity._rec_no = cnt;
            SetInitCombo(ref entity);   // コンボボックス初期選択
            _entityListD.Add(entity);
            dg.ScrollIntoView(entity, dg.Columns[3]);
            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 SetInitCombo(ref EntityEstimateD 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.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]);
        }
示例#4
0
        private void ConvertDetailToDataForm()
        {
            if (_entityListD == null)
            {
                // 行番号
                EntityEstimateD entity = new EntityEstimateD();
                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 <EntityEstimateD>();
                _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,
                                                               0,
                                                               0,
                                                               0
                                                               ));
            }
        }
        private void ConvertDataFormToDetail()
        {
            this.DataForm.CommitEdit();
            if (_entityListD != null) _entityListD.Clear();

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

                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;

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