Exemple #1
0
        //JDR: OVERLOAD 5: Private method to set ActiveUser using User model object or session
        private static bool SetActiveUser(User user) //JDR: Use user for populating ActiveUser
        {
            //JDR: Set static variable for active user
            var activeUser = new
            {
                ID    = user.ID,
                Email = user.Email,
                Name  = user.FullName()
            };

            //JDR: Set static variable for active user
            UserAccount.Set(activeUser);

            return(true);
        }
Exemple #2
0
        //JDR: OVERLOAD 1: Private method to set ActiveUser using User model object or session
        private static bool SetActiveUser()
        {
            if (!UserAccount.IsLoggedIn())
            {
                return(false);
            }

            //JDR: Set static variable for active user
            var activeUser = new
            {
                ID    = HttpContext.Current.Session["UserID"],
                Email = HttpContext.Current.Session["UserEmail"],
                Name  = HttpContext.Current.Session["UserName"]
            };

            //JDR: Set static variable for active user
            UserAccount.Set(activeUser);

            return(true);
        }