Example #1
0
 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;
      }
 }
Example #2
0
        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);
            }
        }