Пример #1
0
        private static IEnumerable <SelfCertCountry> fetchSelfCertOptions(string targetNodeId, bool selectProf)
        {
            var targetNode       = new DynamicNode();
            var complianceString = "";
            var countryList      = new List <SelfCertCountry>();

            if (NodeFacade.NodeExists(targetNodeId, out targetNode))
            {
                if (NodeFacade.NodeHasCompliance(targetNode, out complianceString))
                {
                    // return a list of countries, where the counties are active if the compliance matches the compliance string
                    var rawList = fetchSelfCertData();
                    foreach (string eachComplianceGroup in rawList.Keys)
                    {
                        var isActive = (complianceString.Contains("," + eachComplianceGroup + ","));
                        if (rawList[eachComplianceGroup].IsProf == selectProf)
                        {
                            foreach (SelfCertCountry eachCountry in rawList[eachComplianceGroup].Countries)
                            {
                                eachCountry.IsActive        = isActive;
                                eachCountry.ComplianceGroup = eachComplianceGroup;
                                countryList.Add(eachCountry);
                            }
                        }
                    }
                }
            }

            return(countryList.OrderBy(x => x.CountryName));
        }
Пример #2
0
        public static string CountryName(string countryNodeId, string language)
        {
            string countryName = string.Empty;

            DynamicNode countryNode;

            if (NodeFacade.NodeExists(countryNodeId, out countryNode))
            {
                countryName = countryNode.Name;

                if (language == Languages.German)
                {
                    // Override the English if there is a german name present.
                    var germanCountryName = countryNode.SafeProperty(Languages.German);

                    if (!string.IsNullOrEmpty(germanCountryName))
                    {
                        countryName = germanCountryName;
                    }
                }
            }

            return(countryName);
        }