예제 #1
0
 public ActionResult Login(WebAdminUser usr)
 {
     //var errors = ModelState.Values.SelectMany(v => v.Errors);
     if (ModelState.IsValid)
     {
         var obj = repositorio.WebAdmin.Where(x => x.Correo.Equals(usr.Correo) && x.contraseña.Equals(usr.contraseña)).FirstOrDefault();
         if (obj != null)
         {
             return(Redirect("/Suministro/SuministrosLista"));
         }
     }
     TempData["message"] = "Usuario ó contraseña invalida";
     return(View(usr));
 }
예제 #2
0
        public ActionResult Login(WebAdminUser usr)
        {
            //var errors = ModelState.Values.SelectMany(v => v.Errors);
            if (ModelState.IsValid)
            {
                using (AlmacenEntidadesConexion context = new AlmacenEntidadesConexion())
                {
                    var obj = context.WebAdminUsers.Where(x => x.Correo.Equals(usr.Correo) && x.contraseña.Equals(usr.contraseña)).FirstOrDefault();

                    if (obj != null)
                    {
                        return(RedirectToAction("UserDashBoard"));
                    }
                }
            }
            return(View(usr));
        }