Exemplo n.º 1
0
        private void mySession(Sec_User user)
        {
            if (user != null)
            {
                LoginInformation li = new LoginInformation();

                Sec_PermissionBL   pl  = new Sec_PermissionBL();
                Sec_UserSettingsDL udl = new Sec_UserSettingsDL();
                var per  = pl.ToList("byUserId_ModuleId", user.UserId.ToString(), "AIRIVEW_PORTAL");
                var Pper = udl.GetDataTable("UserProjects", user.UserId.ToString(), null, null);
                Session["user"] = null;
                //System.Web.HttpContext.Current.Application["UserId"] = user.UserId.ToString();
                //System.Web.HttpContext.Current.Application.Add(user.UserId.ToString(), user.UserId.ToString());
                System.Web.HttpContext.Current.Application["User"] = li.set_user_data(user, per, Pper);
                Session.Add("user", li.set_user_data(user, per, Pper));
            }
        }
Exemplo n.º 2
0
        public static void UpdateSession(string Username)
        {
            Sec_User   user = new Sec_User();
            Sec_UserBL ubl  = new Sec_UserBL();

            user = ubl.Single("Login", Username);
            if (user != null)
            {
                LoginInformation li = new LoginInformation();

                Sec_PermissionBL   pl  = new Sec_PermissionBL();
                Sec_UserSettingsDL udl = new Sec_UserSettingsDL();
                var per  = pl.ToList("byUserId_ModuleId", user.UserId.ToString(), "AIRIVEW_PORTAL");
                var Pper = udl.GetDataTable("UserProjects", user.UserId.ToString(), null, null);
                var obj  = li.set_user_data(user, per, Pper);
                HttpContext.Current.Session["user"] = null;
                HttpContext.Current.Session["user"] = obj;
            }
        }