public ActionResult Index(Usuario model)
        {
            if (model.Login == model.Password)
            {
                var iden=new GenericIdentity(model.Login);
                var prin=new GenericPrincipal(iden,new[] {"usuario"});

                Thread.CurrentPrincipal = prin;
                FormsAuthentication.SetAuthCookie(model.Login,false);

                return RedirectToAction("Index", "Home");

            }
            ModelState.AddModelError("Error","Autenticacion incorrecta");
            return View(model);
        }
        public ActionResult Index(Usuario model)
        {
            if (model.Login.Equals(model.Password))
            {
                var iden = new GenericIdentity(model.Login);

                //asigna el usuario en el rol
                var prin = new GenericPrincipal(iden, new[] { "usuario" });

                //HttpContext.User = prin;
                Thread.CurrentPrincipal = prin;
                FormsAuthentication.SetAuthCookie(model.Login, false);
                return RedirectToAction("Index", "Home");
            }
            ModelState.AddModelError("err", "Autentitacion incorrecta");

            return View(model);
        }