public PurchasePlaceKey(Profiler.PurchaseInfo purchaseInfo)
        {
            Place   = purchaseInfo.Place ?? string.Empty;
            Type    = purchaseInfo.Type;
            Website = purchaseInfo.Website;

            _hashCode = Place.ToLowerInvariant().GetHashCode();
        }
Esempio n. 2
0
        private void FillUserHashFromPurchaseInfo(Profiler.PurchaseInfo purchaseInfo)
        {
            if (purchaseInfo == null || !purchaseInfo.ReceivedAsGift)
            {
                return;
            }

            TryAddUser(purchaseInfo.GiftFrom);
        }
Esempio n. 3
0
        private void FillPurchasePlaceHash(Profiler.PurchaseInfo purchaseInfo)
        {
            if (purchaseInfo == null)
            {
                return;
            }

            if (!string.IsNullOrEmpty(purchaseInfo.Place))
            {
                PurchasePlace.Add(new PurchasePlaceKey(purchaseInfo));
            }
        }
Esempio n. 4
0
        private void InsertPurchase(Profiler.PurchaseInfo purchaseInfo)
        {
            if (purchaseInfo == null)
            {
                return;
            }

            IncreaseMax();

            var entity = new Entity.tPurchase()
            {
                tDVD = _currentDVDEntity,
                Date = purchaseInfo.DateSpecified ? purchaseInfo.Date : (DateTime?)null,
                PriceDenomination = purchaseInfo.Price?.Value != 0 ? purchaseInfo.Price.DenominationType : null,
                PriceValue        = purchaseInfo.Price?.Value != 0 ? (decimal)purchaseInfo.Price.Value : (decimal?)null,
                ReceivedAsGift    = purchaseInfo.ReceivedAsGift,
                tPurchasePlace    = !string.IsNullOrEmpty(purchaseInfo.Place) ? _baseData.PurchasePlace[new PurchasePlaceKey(purchaseInfo)] : null,
                tUser             = purchaseInfo.ReceivedAsGift && UserKey.IsValid(purchaseInfo.GiftFrom) ? _baseData.User[new UserKey(purchaseInfo.GiftFrom)] : null,
            };

            _context.tPurchase.Add(entity);

            IncreaseCurrent();
        }