public ActionResult Login(User user) { string message = ""; if (ModelState.IsValid) { if (dalc.CheckUserLogin(user) > 0) { message = "succes"; } else { message = "Usuario y contrasena incorrectos"; } } else { message = "Todos los campos requeridos"; } if (Request.IsAjaxRequest()) { return(Json(message, JsonRequestBehavior.AllowGet)); } else { return(RedirectToAction("Index", "Home")); } }
public ActionResult Index(User User) { if (oDalc.CheckUserLogin(User) > 0) { return(RedirectToAction("Index", "Home")); } return(View()); }