public static Lectura getAutorNombreById(int lecturaId) { LecturaDSTableAdapters.LecturasTableAdapter adapter = new LecturaDSTableAdapters.LecturasTableAdapter(); LecturaDS.LecturasDataTable table = adapter.GetLecturaById(lecturaId); var row = table[0]; Lectura obj = new Lectura(); obj.LecturaID = row.lecturaId; obj.usuarioId = row.usuarioId; obj.libroId = row.libroId; obj.fecha = row.fecha; return(obj); }
public static List <Lectura> getDescargas() { LecturaDSTableAdapters.LecturasTableAdapter adapter = new LecturaDSTableAdapters.LecturasTableAdapter(); LecturaDS.LecturasDataTable table = adapter.GetLectura(); List <Lectura> resultado = new List <Lectura>(); foreach (var row in table) { Lectura obj = new Lectura(); obj.LecturaID = row.lecturaId; obj.usuarioId = row.usuarioId; obj.libroId = row.libroId; obj.fecha = row.fecha; resultado.Add(obj); } return(resultado); }