コード例 #1
0
        private static IEnumerable <string> GetMarketingTextIds(SiteConfigurationData siteConfig, string ageBandKey, bool registration)
        {
            ConfigurationMarketingAgeBand ageBand = DictionaryUtils.TryGetValue(siteConfig.marketing, ageBandKey);
            Dictionary <string, ConfigurationMarketingItem> configuration = GetConfiguration(ageBand, registration);

            return(GetKeysOrEmpty(configuration).Distinct());
        }
コード例 #2
0
        private static void GetDefaultAgeBand(SiteConfigurationData siteConfig, out ConfigurationAgeBand configurationAgeBand, out string configurationAgeBandKey)
        {
            Compliance compliance = siteConfig.compliance;

            configurationAgeBand    = DictionaryUtils.TryGetValue(compliance.ageBands, compliance.defaultAgeBand);
            configurationAgeBandKey = compliance.defaultAgeBand;
        }
コード例 #3
0
        private static IEnumerable <ILegalDocument> BuildLegalDocs(IDictionary <string, LegalGroup> groups, string ageBandKey, bool registration, IList <RegistrationText> legalTexts)
        {
            LegalGroup legalGroup = DictionaryUtils.TryGetValue(groups, ageBandKey);
            IEnumerable <ILegalDocument> source = (UseCreate(registration, legalGroup) ? CreateDocuments(legalGroup.CREATE, legalTexts) : CreateDocuments(legalGroup.documents, legalTexts));
            List <ILegalDocument>        list   = new List <ILegalDocument>(source.Count());

            foreach (string type in legalGroup.documentTypeOrder)
            {
                Func <ILegalDocument, bool> predicate = (ILegalDocument doc) => doc.Type == type;
                list.AddRange(source.Where(predicate));
            }
            return(list);
        }
コード例 #4
0
 private static void GetAgeBandByAge(SiteConfigurationData siteConfig, int age, out ConfigurationAgeBand configurationAgeBand, out string configurationAgeBandKey)
 {
     configurationAgeBand    = null;
     configurationAgeBandKey = null;
     foreach (KeyValuePair <string, ConfigurationAgeBand> ageBand in siteConfig.compliance.ageBands)
     {
         string key = ageBand.Key;
         ConfigurationAgeBand value = ageBand.Value;
         if (value != null && age >= value.minAge && age <= value.maxAge && ValidateAgeBandKey(key))
         {
             LegalGroup legalGroup = DictionaryUtils.TryGetValue(siteConfig.legal, key);
             if (legalGroup != null)
             {
                 configurationAgeBand    = value;
                 configurationAgeBandKey = key;
             }
         }
     }
 }
コード例 #5
0
        private static void GetAgeBandByKey(SiteConfigurationData siteConfig, string ageBandKey, out ConfigurationAgeBand configurationAgeBand, out string configurationAgeBandKey)
        {
            configurationAgeBand    = null;
            configurationAgeBandKey = null;
            if (!ValidateAgeBandKey(ageBandKey))
            {
                return;
            }
            ConfigurationAgeBand configurationAgeBand2 = DictionaryUtils.TryGetValue(siteConfig.compliance.ageBands, ageBandKey);

            if (configurationAgeBand2 != null)
            {
                LegalGroup legalGroup = DictionaryUtils.TryGetValue(siteConfig.legal, ageBandKey);
                if (legalGroup != null)
                {
                    configurationAgeBand    = configurationAgeBand2;
                    configurationAgeBandKey = ageBandKey;
                }
            }
        }
コード例 #6
0
        private static IEnumerable <IMarketingItem> BuildMarketingItems(SiteConfigurationData siteConfig, string ageBandKey, bool registration, IEnumerable <RegistrationText> legalTexts)
        {
            ConfigurationMarketingAgeBand ageBand = DictionaryUtils.TryGetValue(siteConfig.marketing, ageBandKey);

            return(GetMarketingItems(GetConfiguration(ageBand, registration), legalTexts));
        }
コード例 #7
0
        private static IEnumerable <string> GetLegalTextIds(SiteConfigurationData siteConfig, string ageBandKey, bool registration)
        {
            LegalGroup legalGroup = DictionaryUtils.TryGetValue(siteConfig.legal, ageBandKey);

            return(UseCreate(registration, legalGroup) ? legalGroup.CREATE.Select((LegalProxy proxy) => CreateTextId(proxy)) : legalGroup.documents.Keys.Distinct());
        }
コード例 #8
0
        private static IEnumerable <string> GetLegalDocumentsTypeOrder(IDictionary <string, LegalGroup> groups, string ageBandKey)
        {
            LegalGroup legalGroup = DictionaryUtils.TryGetValue(groups, ageBandKey);

            return((legalGroup != null) ? legalGroup.documentTypeOrder : Enumerable.Empty <string>());
        }
コード例 #9
0
 private static ConfigurationAgeBand GetDefaultAgeBand(Compliance compliance)
 {
     return(DictionaryUtils.TryGetValue(compliance.ageBands, compliance.defaultAgeBand));
 }
コード例 #10
0
 private static LegalGroup GetDefaultLegalGroup(SiteConfigurationData siteConfig)
 {
     return(DictionaryUtils.TryGetValue(siteConfig.legal, siteConfig.compliance.defaultAgeBand));
 }