コード例 #1
0
        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);
        }
コード例 #2
0
ファイル: Dates.cs プロジェクト: AYCHErp/AYCH-mixerp
        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>);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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();
            }
        }
コード例 #5
0
ファイル: AppUsers.cs プロジェクト: AYCHErp/AYCH-mixerp
        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);
        }
コード例 #6
0
ファイル: ReportParser.cs プロジェクト: phuctanpham/mixerp
        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);
        }