Exemple #1
0
        public ActionResult Login(LoginViewModel model, string returnUrl)
        {

            sieteEntidades db = new sieteEntidades();
            var Existe = db.usuarios.Where(x => x.usu_email == model.Email && x.usu_clave == model.Password).Count();

            if (Existe == 0)
            {

                ViewBag.Error = "Usuarios Invalido";
                return View();
            }
            else
            {


                FormsAuthentication.SetAuthCookie(model.Email, false);
                return RedirectToAction("Index", "Home");


            }

        }