public IActionResult OnPost() { i = repositorycuentas.Validar(user); if (i >= 1) { return(Redirect("/Containers/ContRuta")); } return(Redirect("/Containers/LoginS")); }
public IActionResult OnPost() { i = repositorycuentas.Validar(users); if (i >= 1 & users.Rolusuario == "Administrador") { HttpContext.Session.SetString("1", users.Usuario); HttpContext.Session.SetString("1.1", users.IdA.ToString()); HttpContext.Session.SetString("1.2", users.Rolusuario); return(Redirect("/Index")); } else { if (i >= 1 & users.Rolusuario == "Tutor") { HttpContext.Session.SetString("1", users.Usuario); HttpContext.Session.SetString("1.1", users.IdT.ToString()); HttpContext.Session.SetString("1.2", users.Rolusuario); return(Redirect("/Index")); } } return(Redirect("/Login")); }