Esempio n. 1
0
        /// <summary>
        /// the method constructs a dictionary from a Countries DataTable, id - lang,  counryname - name of language
        /// </summary>
        public static Dictionary <int, string> GetCountries()
        {
            DataTable countriesdt = GeneralDB.ReturnCountries();

            if (countriesdt == null)
            {
                return(null);
            }
            Dictionary <int, string> CountryDic = new Dictionary <int, string>();

            foreach (DataRow row in countriesdt.Rows)
            {
                int    countryid   = (int)row["ID"];
                string CountryName = (string)row["Name"].ToString();
                CountryDic.Add(countryid, CountryName);
            }
            return(CountryDic);
        }