示例#1
0
        public ActionResult Index(ModulosUserModel model)
        {
            ViewBag.Title             = string.Format("{0} - {1}", Resources.BCMWebPublic.labelAppTitle, Resources.BCMWebPublic.labelAppSlogan);
            Session["IdEmpresa"]      = model.IdEmpresa;
            model.Perfil              = Metodos.GetPerfilData();
            model.ModulosPrincipales  = Metodos.GetModulosPrincipalesEmpresaUsuario();
            Session["IdNivelUsuario"] = Metodos.GetNivelUsuarioByUserId().ToString();

            return(View(model));
        }
示例#2
0
        public ActionResult PerfilPartial(ModulosUserModel model)
        {
            if (ModelState.IsValid)
            {
                var    authTicket      = new FormsAuthenticationTicket(1, model.Perfil.Nombre, DateTime.Now, DateTime.Now.AddMinutes(20), false, model.Perfil.IdUsuario.ToString());
                string encriptedTicket = FormsAuthentication.Encrypt(authTicket);
                var    authCookie      = new HttpCookie(FormsAuthentication.FormsCookieName, encriptedTicket);
                HttpContext.Response.Cookies.Add(authCookie);
                Metodos.SavePerfil(model.Perfil);
                string _esquema  = Request.Url.Scheme;
                string _hostName = Request.Url.Host;

                EmailManager.EnviarEmailUpdatePerfil(model.Perfil.Email, this.ControllerContext, RouteTable.Routes, _esquema, _hostName, model.Perfil);
            }
            return(RedirectToAction("Index"));
            // return PartialView("_PerfilPartialView", model);
        }