public static GlobalLogin GetCurrentLogin() { GlobalLogin login = new GlobalLogin(); string globalLoginId = string.Empty; if (HttpContext.Current.User != null) { globalLoginId = HttpContext.Current.User.Identity.Name; } if (!string.IsNullOrWhiteSpace(globalLoginId)) { login = CacheFactory.GetFromDefaultCacheByKey(globalLoginId) as GlobalLogin; } if (login == null) { login = new GlobalLogin(); } if (login.View == null) { login.View = new SignInView(); } return(login); }
public static Collection <FrequencyDates> GetFrequencyDates(string catalog) { object dates = CacheFactory.GetFromDefaultCacheByKey(catalog + appDatesKey); if (dates == null) { return(new Collection <FrequencyDates>()); } return(dates as Collection <FrequencyDates>); }
public static SignInView GetSignInView() { SignInView view = new SignInView(); string signInId = HttpContext.Current.User.Identity.Name; if (!string.IsNullOrWhiteSpace(signInId)) { view = CacheFactory.GetFromDefaultCacheByKey(signInId) as SignInView; } if (view == null) { view = new SignInView(); } return(view); }
public static SignInView GetSignInView() { while (true) { string signInId = HttpContext.Current.User.Identity.Name; if (string.IsNullOrWhiteSpace(signInId)) { return(new SignInView()); } SignInView view = CacheFactory.GetFromDefaultCacheByKey(signInId) as SignInView; if (view != null) { return(view); } SetSignInView(); } }
public static MetaLogin GetCurrent(long globalLoginId) { MetaLogin login = new MetaLogin(); if (globalLoginId != 0) { login = CacheFactory.GetFromDefaultCacheByKey(globalLoginId.ToString(CultureInfo.InvariantCulture)) as MetaLogin; } if (login == null) { login = new MetaLogin(); } if (login.View == null) { login.View = new LoginView(); } return(login); }
private static string GetDictionaryValue(string key) { string globalLoginId = HttpContext.Current.User.Identity.Name; if (!string.IsNullOrWhiteSpace(globalLoginId)) { string cacheKey = "Dictionary" + globalLoginId; Dictionary <string, object> dictionary = CacheFactory.GetFromDefaultCacheByKey(cacheKey) as Dictionary <string, object>; if (dictionary != null) { object value = dictionary[key]; if (value != null) { return(Conversion.TryCastString(value)); } } } return(string.Empty); }