Exemplo n.º 1
0
        private void SaveToCache()
        {
            var purchasingLimitKey = PurchaseRestrictionManagerFactory.GetCacheKey(_distributorId, _currentLoggedInCountry);

            CacheFactory.Create().Add(this, purchasingLimitKey, TimeSpan.FromMinutes(Settings.GetRequiredAppSetting(
                                                                                         "PurchasingLimitsCacheMinutes",
                                                                                         30)));
        }
Exemplo n.º 2
0
        private void ExpireCache()
        {
            CacheFactory.Create().Expire(typeof(PurchaseRestrictionManager), PurchaseRestrictionManagerFactory.GetCacheKey(_distributorId, _currentLoggedInCountry));
            string cacheKey     = string.Format("{0}_{1}_{2}", "FOP_PLSOURCE", _currentLoggedInCountry, _distributorId);
            string runtimeCache = HttpRuntime.Cache[cacheKey] as string;

            if (runtimeCache != null)
            {
                HttpRuntime.Cache.Remove(cacheKey);
            }
        }
        public static IPurchaseRestrictionManager PurchaseRestrictionManager(string id)
        {
            IPurchaseRestrictionManagerFactory purchaseRestrictionManagerFactory = new PurchaseRestrictionManagerFactory();

            return(purchaseRestrictionManagerFactory.GetPurchaseRestrictionManager(id));
        }