public partial class Loan { public virtual PledgePriceChange InitPledgePriceChangeDocument(PledgePriceChange document) { if (document == null) document = new PledgePriceChange(); if (document.TranDate == default(DateTime)) { document.TranDate = _core.TransactionDate(); } document.CurrencyId = _config.DefaultCurrencyId; document.DocTypeId = DocumentType.PledgePriceChange; var plegde = _db.PledgeSales.Include(x => x.PledgeSaleJewelry) .Include(x => x.Items.Select(i => i.PledgeSaleJewelry)) .SingleOrDefault(x => x.Num == document.PledgeNum); if (plegde == null) throw BankCore.CreateException(String.Format("Pledge {0} does not exisis", document.PledgeNum)); plegde.Price = _core.SubAccBalByConnection(plegde.SubAccountId, AccConnection.PledgePrice, document.TranDate); foreach (var item in plegde.Items) { item.Price = _core.SubAccBalByConnection(item.SubAccountId, AccConnection.PledgePrice, document.TranDate); } document.Jewelry = (JewelrySale)plegde; return document; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)