public static List <Afiliado> List(FiltroAfiliado f, out int RecordCount) { List <Afiliado> resultList = new List <Afiliado>(); try { AfiliadoDS dataservice = new AfiliadoDS(); DataSet ds = dataservice.List(f, out RecordCount); if (ds.Tables.Count > 0) { foreach (DataRow r in ds.Tables[0].Rows) { Afiliado a = new Afiliado(); ORM(a, r); resultList.Add(a); } } } catch (Exception ex) { throw ex; } return(resultList); }
public static Afiliado GetById(int id) { Afiliado afiliadoResult = null; try { AfiliadoDS afiliadoDS = new AfiliadoDS(); String objectHash = Guid.NewGuid().ToString(); DataRow dr = afiliadoDS.GetObjectById(id, objectHash); if (dr != null) { afiliadoResult = new Afiliado(); afiliadoResult._UObjectID = objectHash; ORM(afiliadoResult, dr); } } catch (Exception ex) { throw ex; } return(afiliadoResult); }