public static propOnlineTest GetById(int id) { propOnlineTest onlineTest = new propOnlineTest(); var data = DataAccess.OnlineTest.GetById(id); if (data == null) { return(null); } while (data.Read()) { onlineTest.id = int.Parse(data["Id"].ToString()); onlineTest.studentId = int.Parse(data["StudentId"].ToString()); onlineTest.startDate = DateTime.Parse(data["StartDate"].ToString()); onlineTest.expiryDate = DateTime.Parse(data["ExpiryDate"].ToString()); onlineTest.score = int.Parse(data["Score"].ToString()); onlineTest.submitAt = DateTime.Parse(data["SubmitAt"].ToString()); } data.Close(); return(onlineTest); }
public propScoreBoard(propGroupMember student, propOnlineTest onlineTest) { this.id = student.id; this.fullName = student.fullName; this.college = student.college; this.subject = student.subject; this.age = student.age; this.birthday = student.birthday; this.score = onlineTest.score; this.submitAt = onlineTest.submitAt; this.assigned = student.assigned; this.email = student.email; }