Exemplo n.º 1
0
        /*
         * Returns the total Session timeout in minutes.
         * Default: sessionState from the web.config
         * If available, from the Enterprise Application Configuration.
         *
         */
        public static int GetTotalTimeoutMinutes(int EnterpriseId)
        {
            SessionStateSection sessionSection = (SessionStateSection)WebConfigurationManager.GetSection("system.web/sessionState");
            int timeout = (int)sessionSection.Timeout.TotalMinutes;


            bool VentureMode = SessionHelper.IsVentureMode;

            if (VentureMode)
            {
                return(timeout);
            }


            EntAppConfig timeoutConfig = UAS_Business_Functions.GetEntAppConfig(UAS.Business.ConfigEnumCodes.TIMEOUT, EnterpriseId);

            if (timeoutConfig != null)
            {
                int  time;
                bool convertTimeoutString = Int32.TryParse(timeoutConfig.ConfigValue, out time);
                timeout = (convertTimeoutString) ? time : (int)sessionSection.Timeout.TotalMinutes;
            }

            return(timeout);
        }
Exemplo n.º 2
0
        internal static bool ReviewAll()
        {
            string reviewAll = SessionHelper.Read <string>("Review_All");

            if (reviewAll != null)
            {
                if (reviewAll.ToLower().Equals("true"))
                {
                    return(true);
                }
                return(false);
            }

            EntAppConfig reviewAllConfig = UAS_Business_Functions.GetEntAppConfig("REVIEW_ALL", SessionHelper.LoginStatus.EnterpriseID);

            if (reviewAllConfig != null && reviewAllConfig.ConfigValue.ToLower() != "false")
            {
                SessionHelper.Write("Review_All", "true");
                return(true);
            }
            SessionHelper.Write("Review_All", "false");
            return(false);
        }