Esempio n. 1
0
        public static CustomNames GetCustomNames(Guid OrgID, int departmentId)
        {
            if (System.Web.HttpContext.Current == null)
            {
                return(new CustomNames(OrgID, departmentId));
            }

            CustomNames returnValue;

            returnValue = (CustomNames)System.Web.HttpContext.Current.Cache.Get("CustomNamesDepartment_" + GetCurrentOrgID(OrgID).ToString() + "_" + departmentId);

            if (returnValue == null)
            {
                returnValue = new CustomNames(OrgID, departmentId);
                System.Web.HttpContext.Current.Cache.Add("CustomNamesDepartment_" + GetCurrentOrgID(OrgID).ToString() + "_" + departmentId, returnValue, null, System.Web.Caching.Cache.NoAbsoluteExpiration, TimeSpan.FromDays(1), System.Web.Caching.CacheItemPriority.Normal, null);
            }

            return(returnValue);
        }
Esempio n. 2
0
        public static CustomNames GetCustomNames(Guid OrgID, int departmentId)
        {
            if (System.Web.HttpContext.Current == null) return new CustomNames(OrgID, departmentId);

            CustomNames returnValue;

            returnValue = (CustomNames)System.Web.HttpContext.Current.Cache.Get("CustomNamesDepartment_" + GetCurrentOrgID(OrgID).ToString() + "_" + departmentId);

            if (returnValue == null)
            {
                returnValue = new CustomNames(OrgID, departmentId);
                System.Web.HttpContext.Current.Cache.Add("CustomNamesDepartment_" + GetCurrentOrgID(OrgID).ToString() + "_" + departmentId, returnValue, null, System.Web.Caching.Cache.NoAbsoluteExpiration, TimeSpan.FromDays(1), System.Web.Caching.CacheItemPriority.Normal, null);
            }

            return returnValue;
        }