Ejemplo n.º 1
0
        public List <IndustrialArea> GetAreaByCityId(int cityId)
        {
            OfferQuery offerQuery = new OfferQuery(language);

            System.Data.DataTable dataTable = conn_db.ReadTable(offerQuery.GetObjectByColname("IndustrialAreas", "CITY_ID", cityId));

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


            IndustrialArea        industrialArea;
            List <IndustrialArea> listArea = new List <IndustrialArea>();

            foreach (System.Data.DataRow row in dataTable.Rows)
            {
                industrialArea = new IndustrialArea();

                industrialArea.id            = Convert.ToInt32(row["id"].ToString());
                industrialArea.areaName      = row["areaName"].ToString();
                industrialArea.areaNumber    = row["areaNumber"].ToString();
                industrialArea.areaLocationX = row["LocationX"].ToString();
                industrialArea.areaLocationY = row["LocationY"].ToString();
                listArea.Add(industrialArea);
            }
            return(listArea);
        }