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);
        }
Beispiel #2
0
        public ActionResult ChangeStudentInfo(Student student, bool resetPassword)
        {
            bool success = false;

            if (dao.UpdateStudent(student))
            {
                if (resetPassword)
                {
                    if (dao.UpdateUserPassword(student.StudentId, "password"))
                    {
                        success = true;
                    }
                }
                else
                {
                    success = true;
                }
            }
            if (success)
            {
                return(RedirectToAction("Index"));
            }
            else
            {
                return(View(student));
            }
        }