Ejemplo n.º 1
0
        /// <summary>
        /// Increments the number of scans for the product name passed in
        /// the <paramref name="scanProduct"/> parameter.
        /// </summary>
        /// <param name="scanProduct">The name of the product.</param>
        public void IncrementScanCount(ScanProductType scanProduct)
        {
            if (!ScanCountByProduct.ContainsKey(scanProduct))
            {
                ScanCountByProduct.Add(scanProduct, 0);
            }

            ScanCountByProduct[scanProduct] = ScanCountByProduct[scanProduct] + 1;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Updates the latest scan date for the product name passed in the
        /// <paramref name="scanProduct"/> parameter.
        /// </summary>
        /// <param name="scanTime">The time of a scan.</param>
        /// <param name="scanProduct">The product that performed the scan.</param>
        public void UpdateLatestScanDate(ScanProductType scanProduct, DateTime scanTime)
        {
            if (!LatestScanDateByProduct.ContainsKey(scanProduct))
            {
                LatestScanDateByProduct.Add(scanProduct, DateTime.MinValue);
            }

            if (LatestScanDateByProduct[scanProduct].CompareTo(scanTime) < 0)
            {
                LatestScanDateByProduct[scanProduct] = scanTime;
            }
        }