Esempio n. 1
0
        public static void SetUserSession(Users loginUser)
        {
            UserSession     = new UserSession();
            _mLstPermission = new List <Permissions>();
            if (loginUser != null)
            {
                UserSession.Id        = loginUser.UserId;
                UserSession.UserName  = loginUser.UserName;
                UserSession.Email     = loginUser.Email;
                UserSession.GroupId   = loginUser.UserGroupId;
                UserSession.GroupName = loginUser.UserGroup.UserGroupName;
                using (IUnitOfWork uow = new UnitOfWork())
                {
                    _mLstPermission = uow.PermissionsRepository.GetPermission(UserSession.GroupId);
                    uow.Commit();
                }
            }
            else
            {
                UserSession = null;
            }
            UserSetting setting;

            setting = UtilityFunction.DeserializeTheme();
            if (setting == null)
            {
                return;
            }
            if (UserSession != null)
            {
                UserSession.ThemeName = setting.ThemeName;
            }
        }