コード例 #1
0
        private object Deserialize(DssImportHistory dssImportHistory, bool isUpdate)
        {
            PriceListDetail priceListDetail = new PriceListDetail();

            PriceList priceList = priceListMgr.LoadPriceList(dssImportHistory[1].Trim());

            if (priceList != null)
            {
                priceListDetail.PriceList = priceList;
            }
            else
            {
                Party    party    = partyMgr.CheckAndLoadParty(dssImportHistory[1].Trim());
                Supplier supplier = supplierMgr.LoadSupplier(dssImportHistory[1].Trim());
                if (supplier != null)
                {
                    priceListDetail.PriceList = this.LoadPurchasePriceList(dssImportHistory[1], party);//采购价格单
                }
                else
                {
                    priceListDetail.PriceList = this.LoadSalesPriceList(dssImportHistory[1], party);//销售价格单
                }
            }

            priceListDetail.Currency  = this.currencyMgr.CheckAndLoadCurrency(dssImportHistory[2]);                                                               //货币
            priceListDetail.Item      = this.itemMgr.CheckAndLoadItem(dssImportHistory[3]);                                                                       //零件号
            priceListDetail.Uom       = this.uomMgr.CheckAndLoadUom(dssImportHistory[4]);                                                                         //单位
            priceListDetail.StartDate = dssImportHistory[6] != null?DssHelper.GetDate(dssImportHistory[6], BusinessConstants.DSS_SYSTEM_CODE_QAD) : DateTime.Now; //开始日期

            if (isUpdate)
            {
                priceListDetail.UnitPrice = decimal.Parse(dssImportHistory[5]);//单价
                if (dssImportHistory[7] != null)
                {
                    priceListDetail.EndDate = DssHelper.GetDate(dssImportHistory[7], BusinessConstants.DSS_SYSTEM_CODE_QAD);                             //结束日期
                }
            }

            #region 默认值
            priceListDetail.TaxCode               = string.Empty;//todo
            priceListDetail.IsIncludeTax          = false;
            priceListDetail.IsProvisionalEstimate = this.CheckProvisionalEstimate(priceListDetail.UnitPrice);
            #endregion

            return(priceListDetail);
        }
コード例 #2
0
        private object Deserialize(DssImportHistory dssImportHistory, bool isUpdate)
        {
            Item bomItem = this.itemMgr.CheckAndLoadItem(dssImportHistory[1]); //bom头
            Item item    = this.itemMgr.CheckAndLoadItem(dssImportHistory[2]); //零件号

            if (item.IsMes && bomItem.IsMes)
            {
                MesBomDetail mesBomDetail = new MesBomDetail();
                mesBomDetail.Bom  = this.LoadMesBom(dssImportHistory[1]);//Bom代码
                mesBomDetail.Item = item;

                mesBomDetail.StartDate = dssImportHistory[4] != null?
                                         DssHelper.GetDate(dssImportHistory[4], BusinessConstants.DSS_SYSTEM_CODE_QAD) : new DateTime(2000, 1, 1);

                if (isUpdate)
                {
                    mesBomDetail.RateQty       = decimal.Parse(dssImportHistory[5]);                                                //用量
                    mesBomDetail.StructureType = this.GetStructureType(dssImportHistory[6], BusinessConstants.DSS_SYSTEM_CODE_QAD); //类型

                    if (dssImportHistory[8] != null)
                    {
                        mesBomDetail.EndDate = DssHelper.GetDate(dssImportHistory[8], BusinessConstants.DSS_SYSTEM_CODE_QAD);                             //结束日期
                    }
                }
                return(mesBomDetail);
            }
            else
            {
                BomDetail bomDetail = new BomDetail();
                bomDetail.Bom       = this.LoadBom(dssImportHistory[1]); //Bom代码
                bomDetail.Item      = item;                              //零件号
                bomDetail.Reference = dssImportHistory[3];               //参考
                bomDetail.StartDate = dssImportHistory[4] != null?
                                      DssHelper.GetDate(dssImportHistory[4], BusinessConstants.DSS_SYSTEM_CODE_QAD) : new DateTime(2000, 1, 1);

                if (isUpdate)
                {
                    bomDetail.RateQty       = decimal.Parse(dssImportHistory[5]);                                                //用量
                    bomDetail.StructureType = this.GetStructureType(dssImportHistory[6], BusinessConstants.DSS_SYSTEM_CODE_QAD); //类型

                    if (dssImportHistory[8] != null)
                    {
                        bomDetail.EndDate = DssHelper.GetDate(dssImportHistory[8], BusinessConstants.DSS_SYSTEM_CODE_QAD);                             //结束日期
                    }
                    //回冲方式从零件上取
                    bomDetail.BackFlushMethod = bomDetail.Item.BackFlushMethod;
                    bomDetail.ScrapPercentage = decimal.Parse(dssImportHistory[10]) / 100;//废品百分比

                    bomDetail.Operation = int.Parse(dssImportHistory[12]);
                }

                #region 默认值
                bomDetail.Uom          = bomDetail.Item.Uom;
                bomDetail.Priority     = 0;
                bomDetail.NeedPrint    = true;
                bomDetail.IsShipScanHu = false;

                #endregion

                return(bomDetail);
            }
        }