Ejemplo n.º 1
0
        public List <City> GetCity(string lang)
        {
            OfferQuery offerQuery = new OfferQuery(language);

            System.Data.DataTable dataTable = conn_db.ReadTable(offerQuery.GetMasterTranslated("city", lang));

            if (dataTable.Rows.Count == 0)
            {
                throw new EmptyViewException(language);
            }

            City        city;
            List <City> cities = new List <City>();

            foreach (System.Data.DataRow row in dataTable.Rows)
            {
                city          = new City();
                city.CityId   = Convert.ToInt32(row["id"].ToString());
                city.CityName = row["city_Name"].ToString();
                cities.Add(city);
            }
            return(cities);
        }