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)); } }