public ActionResult Login( UserViewModel user ) { if (ModelState.IsValid) { UserRepository u = new UserRepository(user); if ( u.IsValid() ) { Session["COD_USER"] = user.username; Session["USUARIO"] = user.userdesc; Session["ERROR"] = ""; return RedirectToAction("Filter", "Employee"); } else { ModelState.AddModelError("Usuario", "El Usuario o Contraseña no son válidas."); } } return View(user); }
public UserRepository(UserViewModel UserModel) { UserVM = UserModel; }