Exemple #1
0
        public static MetaLogin GetCurrent(long globalLoginId)
        {
            var login = new MetaLogin();

            if (globalLoginId != 0)
            {
                var cacheObject = CacheFactory.GetFromDefaultCacheByKey(globalLoginId.ToString(CultureInfo.InvariantCulture));
                login = cacheObject as MetaLogin;
            }

            if (login == null)
            {
                login = new MetaLogin();
            }

            if (login.View == null)
            {
                login.View = new LoginView();
            }

            return login;
        }
Exemple #2
0
        private static Dictionary<string, object> GetDictionary(MetaLogin metaLogin)
        {
            var dictionary = new Dictionary<string, object>();

            if (metaLogin == null)
            {
                return dictionary;
            }

            dictionary.Add("Catalog", metaLogin.Catalog);
            dictionary.Add("Culture", metaLogin.View.Culture);
            dictionary.Add("Email", metaLogin.View.Email);
            dictionary.Add("Office", metaLogin.View.Office);
            dictionary.Add("OfficeId", metaLogin.View.OfficeId);
            dictionary.Add("OfficeName", metaLogin.View.OfficeName);
            dictionary.Add("RoleName", metaLogin.View.RoleName);
            dictionary.Add("UserId", metaLogin.View.UserId);
            dictionary.Add("UserName", metaLogin.View.Email);

            return dictionary;
        }