示例#1
0
        /// <summary>
        /// Gets the NVP.
        /// </summary>
        /// <param name="nameValuePairSeqId">The NVP seq ID.</param>
        /// <returns>MNameValuePair.</returns>
        public static MNameValuePair GetNameValuePair(int nameValuePairSeqId)
        {
            MSecurityEntityProfile mSecurityProfile = SecurityEntityUtility.CurrentProfile();
            BNameValuePairs        myNameValuePair  = new BNameValuePairs(mSecurityProfile);

            return(new MNameValuePair(myNameValuePair.GetNameValuePair(nameValuePairSeqId)));
        }
示例#2
0
        /// <summary>
        /// GetNVPs will return all Name Value Pairs avalible for a given account
        /// </summary>
        /// <param name="accountId">The account the list of NVPs are for</param>
        /// <returns>Returns a data table of name value pairs for a given account</returns>
        /// <remarks></remarks>
        public static DataTable GetNameValuePairs(int accountId)
        {
            MSecurityEntityProfile mSecurityProfile = SecurityEntityUtility.CurrentProfile();
            BNameValuePairs        myNameValuePair  = new BNameValuePairs(mSecurityProfile);

            return(myNameValuePair.GetAllNameValuePair(accountId));
        }
示例#3
0
        /// <summary>
        /// Retrieves the selected groups for the name value pair
        /// </summary>
        /// <param name="nameValuePairSeqId">The primary key of the name value pair</param>
        /// <returns>String array list of groups</returns>
        /// <remarks></remarks>
        public static string[] GetSelectedGroups(int nameValuePairSeqId)
        {
            MSecurityEntityProfile mSecurityProfile = SecurityEntityUtility.CurrentProfile();
            BNameValuePairs        myNameValuePair  = new BNameValuePairs(mSecurityProfile);
            DataTable myDataTable = myNameValuePair.GetNameValuePairGroups(nameValuePairSeqId);

            return(GetStringArrayList(myDataTable, "Groups"));
        }
示例#4
0
        /// <summary>
        /// Updates the roles.
        /// </summary>
        /// <param name="nameValuePairId">The NV p_ ID.</param>
        /// <param name="securityEntityId">The security entity ID.</param>
        /// <param name="commaSeparatedRoles">The comma separated roles.</param>
        /// <param name="nameValuePairProfile">MNameValuePair.</param>
        public static void UpdateRoles(int nameValuePairId, int securityEntityId, string commaSeparatedRoles, MNameValuePair nameValuePairProfile)
        {
            if (nameValuePairProfile == null)
            {
                throw new ArgumentNullException("nameValuePairProfile", "nameValuePairProfile cannot be a null reference (Nothing in Visual Basic)!");
            }
            MSecurityEntityProfile mSecurityProfile = SecurityEntityUtility.CurrentProfile();
            BNameValuePairs        myNameValuePair  = new BNameValuePairs(mSecurityProfile);

            myNameValuePair.UpdateRoles(nameValuePairId, securityEntityId, commaSeparatedRoles, nameValuePairProfile);
        }
示例#5
0
        /// <summary>
        /// Searches the specified search criteria.
        /// </summary>
        /// <param name="searchCriteria"></param>
        /// <returns></returns>
        public static DataTable Search(MSearchCriteria searchCriteria)
        {
            if (searchCriteria == null)
            {
                throw new ArgumentNullException("searchCriteria", "searchCriteria cannot be a null reference (Nothing in Visual Basic)!");
            }
            MSecurityEntityProfile mSecurityProfile = SecurityEntityUtility.CurrentProfile();
            BNameValuePairs        mBNameValuePairs = new BNameValuePairs(mSecurityProfile);

            return(mBNameValuePairs.Search(searchCriteria));
        }
示例#6
0
 public static void GetNameValuePairDetails(ref DataTable yourDataTable)
 {
     yourDataTable = (DataTable)HttpContext.Current.Cache[CachedNameValuePairDetailsTableName];
     if (yourDataTable == null)
     {
         MSecurityEntityProfile mSecurityProfile       = SecurityEntityUtility.CurrentProfile();
         BNameValuePairs        myNameValuePairDetails = new BNameValuePairs(mSecurityProfile);
         yourDataTable = myNameValuePairDetails.GetAllNameValuePairDetail();
         CacheController.AddToCacheDependency(CachedNameValuePairDetailsTableName, yourDataTable);
     }
 }
示例#7
0
        /// <summary>
        /// Saves the detail.
        /// </summary>
        /// <param name="profile">The profile.</param>
        /// <returns>System.Int32.</returns>
        public static void SaveDetail(MNameValuePairDetail profile)
        {
            if (profile == null)
            {
                throw new ArgumentNullException("profile", "profile cannot be a null reference (Nothing in Visual Basic)!");
            }
            MSecurityEntityProfile mSecurityProfile = SecurityEntityUtility.CurrentProfile();
            BNameValuePairs        mBNameValuePairs = new BNameValuePairs(mSecurityProfile);

            CacheController.RemoveFromCache(CachedNameValuePairDetailsTableName);
            mBNameValuePairs.SaveNameValuePairDetail(profile);
        }
示例#8
0
        /// <summary>
        /// Inserts or updates a name value pair given a NameValuePair profile
        /// </summary>
        /// <param name="profile">Details of the profile to added or updated</param>
        /// <returns>The Primary sequence ID</returns>
        /// <remarks></remarks>
        public static int Save(MNameValuePair profile)
        {
            if (profile == null)
            {
                throw new ArgumentNullException("profile", "profile cannot be a null reference (Nothing in Visual Basic)!");
            }
            int mRetVal = -1;
            MSecurityEntityProfile mSecurityProfile = SecurityEntityUtility.CurrentProfile();
            BNameValuePairs        myNameValuePair  = new BNameValuePairs(mSecurityProfile);

            CacheController.RemoveFromCache(CachedNameValuePairTableName);
            CacheController.RemoveFromCache(CachedNameValuePairDetailsTableName);
            mRetVal = myNameValuePair.Save(profile);
            return(mRetVal);
        }