public IPurchaseRestrictionManager GetPurchaseRestrictionManager(string id)
        {
            //Load the DS/get it from cache..
            ILoader <DistributorProfileModel, GetDistributorProfileById> distributorProfileLoader = new DistributorProfileLoader();
            var locale = CultureInfo.CurrentCulture.Name;
            var currentLoggedInCounrtyCode = locale.Substring(3);
            var distributorProfileModel    = distributorProfileLoader.Load(new GetDistributorProfileById {
                Id = id
            });

            // to prevent recusive calls
            // get distributor ordering profile from Distributor_V01
            DistributorLoader distributorLoader = new DistributorLoader();
            var distributorProfile         = distributorLoader.Load(id, currentLoggedInCounrtyCode);
            var distributorOrderingProfile = DistributorOrderingProfileFactory.GetDistributorOrderingProfile(distributorProfile, currentLoggedInCounrtyCode);

            return(_Cache.Retrieve(delegate
            {
                return new PurchaseRestrictionManager(id, currentLoggedInCounrtyCode, distributorProfileModel.TypeCode, distributorProfileModel.ProcessingCountryCode, locale, distributorOrderingProfile.TinList, distributorOrderingProfile.OrderSubType);
            }, GetCacheKey(id, currentLoggedInCounrtyCode), TimeSpan.FromMinutes(Settings.GetRequiredAppSetting(
                                                                                     "PurchasingLimitsCacheMinutes",
                                                                                     30))));
        }
예제 #2
0
        public static DistributorOrderingProfile GetDistributorOrderingProfile(string memberId, string countryCode)
        {
            var distributorOrderingProfileFactory = new DistributorOrderingProfileFactory();

            return(distributorOrderingProfileFactory.GetDistributorOrderingProfile(memberId, countryCode));
        }