public List<Afp> findAll() { List<Afp> list = null; try { String sql = "select * from afp"; Afp afp = null; list = new List<Afp>(); foreach (DataRow dtRow in new Clases.Consultas().QueryDB(sql).Rows) { afp = new Afp(int.Parse(dtRow["id_afp"].ToString()), dtRow["nombre"].ToString(), double.Parse(dtRow["descuento"].ToString())); list.Add(afp); }return list; }catch(Exception e) { Console.Write("error: " + e.Message); return list; } }
public List <Afp> findAll() { List <Afp> list = null; try { String sql = "select * from afp"; Afp afp = null; list = new List <Afp>(); foreach (DataRow dtRow in new Clases.Consultas().QueryDB(sql).Rows) { afp = new Afp(int.Parse(dtRow["id_afp"].ToString()), dtRow["nombre"].ToString(), double.Parse(dtRow["descuento"].ToString())); list.Add(afp); } return(list); }catch (Exception e) { Console.Write("error: " + e.Message); return(list); } }