Beispiel #1
0
        /// <summary>
        /// Create the country using the name, alias.
        /// </summary>
        /// <param name="country">Country to create</param>
        /// <returns></returns>
        public BoolMessageItem <Country> CreateCountry(Country country)
        {
            // Duplicate ??
            string name = country.IsAlias ? country.AliasRefName : country.Name;

            Country countrySearched = CountriesLookup[name];

            if (!country.IsAlias && countrySearched != null)
            {
                return(new BoolMessageItem <Country>(null, false, "Country with name : " + name + " already exists"));
            }
            if (country.IsAlias && countrySearched == null)
            {
                return(new BoolMessageItem <Country>(null, false, "Unknown country with name : " + name));
            }

            // Create
            if (country.IsAlias)
            {
                country.AliasRefId = countrySearched.RealId;
            }

            Countries.Create(country);
            return(new BoolMessageItem <Country>(country, country.Id > 0, ""));
        }
 public void Create(PersistenceManager persistenceManager)
 {
     persistenceManager.CreateStore("WorldBankOrganisation");
     Topics.Create(persistenceManager);
     Indicators.Create(persistenceManager);
     Countries.Create(persistenceManager);
     TopicsIndicators.Create(persistenceManager);
 }