示例#1
0
        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);
        }
示例#2
0
 public UserRepository(UserViewModel UserModel)
 {
     UserVM = UserModel;
 }