/// <summary> /// Moves the specified profiles menu order. /// </summary> /// <param name="profile">The profile.</param> /// <param name="direction">The direction.</param> /// <param name="updatedBy">The updated by.</param> /// <param name="updatedDate">Up dated date.</param> public static void Move(MFunctionProfile profile, DirectionType direction, int updatedBy, DateTime updatedDate) { if (profile == null) { throw new ArgumentNullException("profile", "profile cannot be a null reference (Nothing in Visual Basic)!!"); } profile.UpdatedBy = updatedBy; profile.UpdatedDate = updatedDate; BFunctions mBAppFunctions = new BFunctions(SecurityEntityUtility.CurrentProfile(), ConfigSettings.CentralManagement); mBAppFunctions.MoveMenuOrder(profile, direction); RemoveCachedFunctions(); }
/// <summary> /// Retrieves all functions from the either the database or cache /// </summary> /// <returns>A Collection of MFunctinProfiles</returns> public static Collection <MFunctionProfile> Functions() { MSecurityEntityProfile mSecurityEntityProfile = SecurityEntityUtility.CurrentProfile(); BFunctions mBFunctions = new BFunctions(mSecurityEntityProfile, ConfigSettings.CentralManagement); String mCacheName = mSecurityEntityProfile.Id.ToString(CultureInfo.InvariantCulture) + "_Functions"; Collection <MFunctionProfile> mRetVal = null; mRetVal = (Collection <MFunctionProfile>)(HttpContext.Current.Cache[mCacheName]); if (mRetVal == null) { mRetVal = mBFunctions.GetFunctions(mSecurityEntityProfile.Id); CacheController.AddToCacheDependency(mCacheName, mRetVal); } return(mRetVal); }
/// <summary> /// Deletes the specified function given the function seq id. /// </summary> /// <param name="functionSeqId">The function seq id.</param> public static void Delete(int functionSeqId) { BFunctions mBAppFunctions = new BFunctions(SecurityEntityUtility.CurrentProfile(), ConfigSettings.CentralManagement); try { mBAppFunctions.Delete(functionSeqId); } catch (DataAccessLayerException ex) { Logger mLog = Logger.Instance(); mLog.Error(ex); } finally { RemoveCachedFunctions(); } }
/// <summary> /// Saves the specified profile. /// </summary> /// <param name="profile">The profile.</param> /// <param name="saveGroups">if set to <c>true</c> [save groups].</param> /// <param name="saveRoles">if set to <c>true</c> [save roles].</param> public static void Save(MFunctionProfile profile, bool saveGroups, bool saveRoles) { BFunctions mBAppFunctions = new BFunctions(SecurityEntityUtility.CurrentProfile(), ConfigSettings.CentralManagement); try { mBAppFunctions.Save(profile, saveGroups, saveRoles); } catch (DataAccessLayerException ex) { Logger mLog = Logger.Instance(); mLog.Error(ex); } finally { RemoveCachedFunctions(); } }
/// <summary> /// /// </summary> /// <param name="profile"></param> /// <returns></returns> public static DataTable GetFunctionMenuOrder(MFunctionProfile profile) { BFunctions mBFunctions = new BFunctions(SecurityEntityUtility.CurrentProfile(), ConfigSettings.CentralManagement); return(mBFunctions.GetMenuOrder(profile)); }
/// <summary> /// Searches the specified search criteria. /// </summary> /// <param name="searchCriteria">The search criteria.</param> /// <returns>DataTable.</returns> public static DataTable Search(MSearchCriteria searchCriteria) { BFunctions mBAppFunctions = new BFunctions(SecurityEntityUtility.CurrentProfile(), ConfigSettings.CentralManagement); return(mBAppFunctions.Search(searchCriteria)); }
///// <summary> ///// Removes the cached function types. ///// </summary> //public static void RemoveCachedFunctionTypes() //{ // CacheController.RemoveFromCache(s_FunctionTypeCachedCollectionName); // CacheController.RemoveFromCache(s_FunctionTypeCachedDVFunctions); //} ///// <summary> ///// Res the build function collection. ///// </summary> //public static void RebuildFunctionCollection() //{ // RemoveCachedFunctionTypes(); // MFunctionTypeProfile mFunctionProfileInfo = new MFunctionTypeProfile(); // mFunctionProfileInfo = GetProfile(1); //} /// <summary> /// Gets the function types. /// </summary> /// <returns>DataTable.</returns> public static DataTable FunctionTypes() { BFunctions functionTypes = new BFunctions(SecurityEntityUtility.CurrentProfile(), ConfigSettings.CentralManagement); return(functionTypes.FunctionTypes()); }