public IActionResult Index(string email, string password) { var user = UsersDAO.GetByEmail(email); if (user != null) { var person = PersonsDAO.GetById(user.ID); HttpContext.Session.SetInt32("userId", user.ID); HttpContext.Session.SetString("userEmail", user.Email); HttpContext.Session.SetString("userType", user.Type); HttpContext.Session.SetString("userName", person.Name); HttpContext.Session.SetInt32("clinicId", person.ClinicID); return(RedirectToAction("Index", "Dashboard")); } ViewBag.Error = "E-mail ou senha inválidos"; return(View()); }