public static List<Localidad> List(FiltroLocalidad f) { List<Localidad> resulList = new List<Localidad>(); try { LocalidadDS dataservice = new LocalidadDS(); DataSet listado = dataservice.List(f); if (listado.Tables.Count > 0) { foreach (DataRow d in listado.Tables[0].Rows) { Localidad l = new Localidad(); ORM(l, d); resulList.Add(l); } } } catch (Exception ex) { throw ex; } return resulList; }
public static List <Localidad> List(FiltroLocalidad f) { List <Localidad> resulList = new List <Localidad>(); try { LocalidadDS dataservice = new LocalidadDS(); DataSet listado = dataservice.List(f); if (listado.Tables.Count > 0) { foreach (DataRow d in listado.Tables[0].Rows) { Localidad l = new Localidad(); ORM(l, d); resulList.Add(l); } } } catch (Exception ex) { throw ex; } return(resulList); }
public static void ORM(Localidad localidad, DataRow r) { localidad._id = Int32.Parse(r[LocalidadDS.COLUMN_ID_LOCALIDAD].ToString()); localidad._idCiudad = Int32.Parse(r[LocalidadDS.COLUMN_ID_IDCIUDAD].ToString()); localidad._nombre = r[LocalidadDS.COLUMN_NOMBRE].ToString(); }