public void RegisterStudentForReAdmissionTest() { int termId = 13; int studentNum = GetLastStudentNum(); Assert.AreNotEqual(0, studentNum); CentennialDA dao = new CentennialDA(); Student student = dao.FindStudentByStudentNum($"test{studentNum}"); Assert.IsNotNull(student); int studentId = student.StudentId; student.StudentCanRegister = false; dao.UpdateStudent(student); bool registrationEnabled = dao.StudentCanRegister(studentId); Assert.IsFalse(registrationEnabled); bool hasRegistration = dao.HasValidRegistration(studentId, termId); Assert.IsFalse(hasRegistration); dao.EnableStudentCanRegister(studentId); registrationEnabled = dao.StudentCanRegister(studentId); Assert.IsTrue(registrationEnabled); dao.ProgramRegistrationReAdmit(termId, studentId); hasRegistration = dao.HasValidRegistration(studentId, termId); Assert.IsTrue(hasRegistration); }
public ActionResult FindStudent(string StudentNum) { Student student = dao.FindStudentByStudentNum(StudentNum); if (student != null) { Session["student"] = student; return(View("ChangeStudentInfo", student)); } else { return(View("CreateStudent", new Student { StudentNum = StudentNum, StudentStartDate = DateTime.Today })); } }