public ActionResult ForgotPassword(string username, string role) { UserPassword user = userPasswordDal.GetUser(username); if (user == null) { ModelState.AddModelError("invalid username", "A registered username is required"); } if (user.RoleTitle == "Employer") { string contactEmail = employerDal.GetEmployer(username).ContactInfo; string newPassword = userPasswordDal.ResetPassword(username); SendEmail(contactEmail, username, newPassword); } else if (user.RoleTitle == "Student") { string contactEmail = studentDal.GetStudent(username).ContactInfo; string newPassword = userPasswordDal.ResetPassword(username); SendEmail(contactEmail, username, newPassword); } return(RedirectToAction("Index", "Home")); }
public ActionResult ViewStudent(string username) { Student model = studentDAL.GetStudent(username); return(View("ViewStudent", model)); }
// GET: Student public ActionResult Index(string username) { Student currentUser = studentDAL.GetStudent(username); return(View("Index", currentUser)); }