public void UpdateMinCost(Offer offer) { if (offer.Cost < MinCost) { MinCost = offer.Cost; } }
public void AssortmentUpdateMinCost(Offer offer) { if (offer.AssortmentCost.HasValue) { if (!AssortmentMinCost.HasValue || offer.AssortmentCost < AssortmentMinCost) { AssortmentMinCost = offer.AssortmentCost; } } }
private SpecShortReportData FindItem(Hashtable hash, Offer offer, List <SpecShortReportData> data) { var key = GetKey(offer); var item = (SpecShortReportData)hash[key]; if (item == null) { item = new SpecShortReportData(offer); hash[key] = item; data.Add(item); } return(item); }
public SpecShortReportData(Offer offer) { Code = offer.AssortmentCode; CodeCr = offer.AssortmentCodeCr; ProductName = offer.ProductName; ProducerName = offer.ProducerName; MinCost = offer.Cost; AssortmentQuantity = offer.AssortmentQuantity; if (!String.IsNullOrEmpty(offer.CodeWithoutProducer)) { CodeWithoutProducer = offer.CodeWithoutProducer; } SupplierId = offer.SupplierId; }
private object GetKey(Offer offer) { if (offer.AssortmentCoreId.HasValue) { return(offer.AssortmentCoreId); } else if (_reportType <= 2) { return new { CatalogId = _calculateByCatalog ? offer.CatalogId : offer.ProductId, ProducerId = 0 } } ; else { return new { CatalogId = _calculateByCatalog ? offer.CatalogId : offer.ProductId, offer.ProducerId } }; // с учетом производителя }