示例#1
0
            public static void SetRestriction(IElementAEO element, CRestrictionUtilisateurSurType rest)
            {
                if (m_tableElementToRestriction.Count > 100)
                {
                    m_tableElementToRestriction.Clear();
                }
                CCacheRestriction cache = new CCacheRestriction(rest, element.CodesEntitesOrganisationnelles);

                m_tableElementToRestriction[element] = cache;
            }
示例#2
0
            public static CRestrictionUtilisateurSurType GetRestriction(IElementAEO element)
            {
                CCacheRestriction cache = m_tableElementToRestriction[element] as CCacheRestriction;

                if (cache != null && ((TimeSpan)(DateTime.Now - cache.DateValeur)).TotalSeconds <= c_nDureeVieSeconde &&
                    cache.CodesEO == element.CodesEntitesOrganisationnelles)
                {
                    return(cache.Restriction);
                }
                return(null);
            }