Esempio n. 1
0
        public ValueTo GetPlaceDetails(string placeId)
        {
            ValueTo result         = new ValueTo();
            var     geoNamesClient = new GeoNamesClient();
            var     data           = geoNamesClient.Get(int.Parse(placeId), "cristhyan17");

            result.Value = placeId;
            result.Text  = data.Name;
            geoNamesClient.Close();
            return(result);
        }
Esempio n. 2
0
        public List <ValueTo> GetCountries()
        {
            if (_listCountries == null || _listCountries.Count == 0)
            {
                var            geoNamesClient = new GeoNamesClient();
                var            serResult      = geoNamesClient.Countries("cristhyan17");
                List <Country> result         = new List <Country>();
                if (serResult != null)
                {
                    result = serResult.ToList();
                }
                _listCountries = (from ct in result
                                  select new ValueTo {
                    Text = ct.CountryName, Value = ct.GeoNameId.ToString()
                }).ToList();
                geoNamesClient.Close();
            }

            return(_listCountries);
        }