コード例 #1
0
 /// <summary>
 /// Searches Security Entities with the specified search criteria.
 /// </summary>
 /// <param name="searchCriteria">The search criteria.</param>
 /// <returns>DataTable.</returns>
 public static DataTable Search(MSearchCriteria searchCriteria)
 {
     try
     {
         BSecurityEntity mBSecurityEntities = new BSecurityEntity(SecurityEntityUtility.CurrentProfile(), ConfigSettings.CentralManagement);
         return(mBSecurityEntities.Search(searchCriteria));
     }
     catch (IndexOutOfRangeException)
     {
         return(null);
     }
 }
コード例 #2
0
        /// <summary>
        /// Retrieves all security entities from the either the database or cache
        /// </summary>
        /// <returns>A Collection of MSecurityEntityProfile</returns>
        public static Collection <MSecurityEntityProfile> Profiles()
        {
            Collection <MSecurityEntityProfile> mRetVal = null;

            mRetVal = (Collection <MSecurityEntityProfile>)(HttpContext.Current.Cache[s_CacheName]);
            if (mRetVal == null)
            {
                BSecurityEntity mBSecurityEntity = new BSecurityEntity(DefaultProfile(), ConfigSettings.CentralManagement);
                mRetVal = mBSecurityEntity.SecurityEntities();
                CacheController.AddToCacheDependency(s_CacheName, mRetVal);
            }
            return(mRetVal);
        }
コード例 #3
0
 /// <summary>
 /// Saves the specified profile.
 /// </summary>
 /// <param name="profile">The profile.</param>
 public static void Save(MSecurityEntityProfile profile)
 {
     try
     {
         BSecurityEntity mBSecurityEntities = new BSecurityEntity(SecurityEntityUtility.CurrentProfile(), ConfigSettings.CentralManagement);
         mBSecurityEntities.Save(profile);
         CacheController.RemoveAllCache();
     }
     catch (DataAccessLayerException ex)
     {
         Logger mLog = Logger.Instance();
         mLog.Error(ex);
     }
 }
コード例 #4
0
        /// <summary>
        /// Gets the valid security entities.
        /// </summary>
        /// <param name="account">The account.</param>
        /// <param name="securityEntityId">The security entity id.</param>
        /// <param name="isSystemAdmin">if set to <c>true</c> [is system admin].</param>
        /// <returns>DataView.</returns>
        public static DataView GetValidSecurityEntities(string account, int securityEntityId, bool isSystemAdmin)
        {
            BSecurityEntity mBSecurityEntities = new BSecurityEntity(SecurityEntityUtility.CurrentProfile(), ConfigSettings.CentralManagement);

            return(mBSecurityEntities.GetValidSecurityEntities(account, securityEntityId, isSystemAdmin).DefaultView);
        }