Esempio n. 1
0
        public static void SetSignInView(long signInId)
        {
            if (signInId > 0)
            {
                string key = signInId.ToString(CultureInfo.InvariantCulture);

                if (MemoryCache.Default[key] == null)
                {
                    SignInView signInView = Data.Office.User.GetSignInView(signInId);
                    Dictionary <string, object> dictionary = GetDictionary(signInView);

                    CacheFactory.AddToDefaultCache("Dictionary" + key, dictionary);
                    CacheFactory.AddToDefaultCache(key, signInView);
                }
            }
        }
Esempio n. 2
0
        public static void SetCurrentLogin(long globalLoginId)
        {
            if (globalLoginId > 0)
            {
                string key = globalLoginId.ToString(CultureInfo.InvariantCulture);

                if (MemoryCache.Default[key] == null)
                {
                    GlobalLogin globalLogin = Data.Office.User.GetGloblalLogin(globalLoginId);
                    Dictionary <string, object> dictionary = GetDictionary(globalLogin);

                    CacheFactory.AddToDefaultCache("Dictionary" + key, dictionary);
                    CacheFactory.AddToDefaultCache(key, globalLogin);
                }
            }
        }
Esempio n. 3
0
        public static void SetCurrentLogin(long globalLoginId)
        {
            if (globalLoginId <= 0)
            {
                return;
            }

            string key = globalLoginId.ToString(CultureInfo.InvariantCulture);

            if (MemoryCache.Default[key] != null)
            {
                return;
            }

            var metaLogin  = GetMetaLogin(globalLoginId);
            var dictionary = GetDictionary(metaLogin);

            CacheFactory.AddToDefaultCache("Dictionary" + key, dictionary);
            CacheFactory.AddToDefaultCache(key, metaLogin);
        }
Esempio n. 4
0
 public static void SetApplicationDates(string catalog, Collection <FrequencyDates> applicationDates)
 {
     CacheFactory.AddToDefaultCache(catalog + appDatesKey, applicationDates);
 }
Esempio n. 5
0
        private static void InitializeResourcesAsync(string tenant)
        {
            IDictionary <string, string> resources = DbResources.GetLocalizedResources(tenant);

            CacheFactory.AddToDefaultCache("Resources", resources);
        }
Esempio n. 6
0
        private static async Task InitializeResourcesAsync(string tenant)
        {
            IDictionary <string, string> resources = await DbResources.GetLocalizedResourcesAsync(tenant).ConfigureAwait(false);

            CacheFactory.AddToDefaultCache("Resources", resources);
        }