public List <StudentsAttendence> getStudentAttendenceList(SqlDataReader reader) { List <StudentsAttendence> studentAttendenceList = new List <StudentsAttendence>(); while (reader.HasRows) { while (reader.Read()) { StudentsAttendence studentAttendence = new StudentsAttendence(); studentAttendence.ID = reader.GetInt32(0); studentAttendence.TimetableID = reader.GetInt32(1); studentAttendence.StudentID = reader.GetInt32(2); studentAttendence.FirstName = reader.GetString(3); studentAttendence.LastName = reader.GetString(4); studentAttendence.ClassStartTime = reader.GetTimeSpan(5); studentAttendence.ClassEndTime = reader.GetTimeSpan(6); studentAttendence.ModuleName = reader.GetString(7); studentAttendence.Date = reader.GetDateTime(8).Date; studentAttendence.Condition = reader.GetString(9); studentAttendenceList.Add(studentAttendence); } reader.NextResult(); } con.Close(); return(studentAttendenceList); }
public StudentsAttendence ReadStudentAttendence(SqlDataReader reader) { StudentsAttendence studentAttendence = new StudentsAttendence(); while (reader.Read()) { studentAttendence.ID = reader.GetInt32(0); studentAttendence.TimetableID = reader.GetInt32(1); studentAttendence.StudentID = reader.GetInt32(2); studentAttendence.FirstName = reader.GetString(3); studentAttendence.LastName = reader.GetString(4); studentAttendence.ClassStartTime = reader.GetTimeSpan(5); studentAttendence.ClassEndTime = reader.GetTimeSpan(6); studentAttendence.ModuleName = reader.GetString(7); studentAttendence.Date = reader.GetDateTime(8).Date; studentAttendence.Condition = reader.GetString(9); } return(studentAttendence); }