//buscar comunas mediante la id de la region public List<Comunas> FindByidReg(int id_region) { List<Comunas> listcom = null; try { string sql = "select * from comunas where region_id=" + id_region.ToString() + " order by nombre"; Comunas comuns = null; listcom = new List<Comunas>(); foreach (DataRow dtrow in new Clases.Consultas().QueryDB(sql).Rows) { comuns = new Comunas(int.Parse(dtrow["id"].ToString()), dtrow["nombre"].ToString()); listcom.Add(comuns); } // end foreach return listcom; } //ent try catch (Exception ex) { return listcom; } }
} //fin constructor //buscar comunas mediante la id de la region public List<Comunas> FindByidReg(int id_region) { List<Comunas> listcom = null; try { string sql = "select * from comunas where region_id=" + id_region.ToString() + " order by nombre"; Comunas comuns = null; listcom = new List<Comunas>(); foreach (DataRow dtrow in new Clases.Consultas().QueryDB(sql).Rows) { comuns = new Comunas(int.Parse(dtrow["id"].ToString()), dtrow["nombre"].ToString()); listcom.Add(comuns); } // end foreach return listcom; } //ent try catch (Exception ex) { return listcom; } } //end metodo find comunas