Beispiel #1
0
 public void UpdateMinCost(Offer offer)
 {
     if (offer.Cost < MinCost)
     {
         MinCost = offer.Cost;
     }
 }
Beispiel #2
0
 public void AssortmentUpdateMinCost(Offer offer)
 {
     if (offer.AssortmentCost.HasValue)
     {
         if (!AssortmentMinCost.HasValue || offer.AssortmentCost < AssortmentMinCost)
         {
             AssortmentMinCost = offer.AssortmentCost;
         }
     }
 }
Beispiel #3
0
        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);
        }
Beispiel #4
0
 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;
 }
Beispiel #5
0
 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 }
     };                                                                                                                        // с учетом производителя
 }