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

            if (isUpdate)
            {
                if (dssImportHistory[1] != null)
                {
                    itemReference.Party = partyMgr.CheckAndLoadParty(dssImportHistory[1]);
                }
                if (dssImportHistory[2] != null)
                {
                    itemReference.ReferenceCode = dssImportHistory[2];
                }
                if (dssImportHistory[3] != null)
                {
                    itemReference.Item = itemMgr.CheckAndLoadItem(dssImportHistory[3]);
                }
            }

            #region 默认值
            itemReference.IsActive = true;
            #endregion

            return(itemReference);
        }
コード例 #2
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);
        }