/// <summary> /// 初始化默认加载所有模块 /// </summary> public static void Init_sys_Module_Cache() { FrameWorkCache.Instance().Insert(keytree, new Dictionary <int, List <sys_ModuleTable> >()); FrameWorkCache.Instance().Insert(keytopModule, new Dictionary <int, List <sys_ModuleTable> >()); FrameWorkCache.Instance().Insert(keymodule, new Dictionary <int, sys_ModuleTable>()); LoadsysModuleId(setModuleCache, setTopModuleCache, setModuleTreeCache, false); }
/// <summary> /// 根据用户ID获取用户资料(从缓存中获取) /// </summary> /// <param name="UserID">用户ID</param> /// <returns></returns> public static sys_UserTable Get_sys_UserTable(int UserID) { string CacheKey = string.Format("{0}-UserInfo-{1}", Common.Get_WebCacheName, UserID); if (FrameWorkCache.Instance()[CacheKey] != null) { return((sys_UserTable)FrameWorkCache.Instance()[CacheKey]); } else { sys_UserTable sUT = BusinessFacade.sys_UserDisp(UserID); FrameWorkCache.Instance().Insert(CacheKey, sUT); return(sUT); } }
/// <summary> /// 获取用户权限Hashtable /// </summary> /// <param name="UserID">用户ID</param> /// <returns></returns> private static Hashtable Get_UserPermission(int UserID) { string Key = string.Format("{1}-Permission-{0}", UserID, Common.Get_WebCacheName); if (FrameWorkCache.Instance()[Key] != null) { return((Hashtable)FrameWorkCache.Instance()[Key]); } else { Hashtable _Temp = Get_sys_RolePermissionTable(UserID); FrameWorkCache.Instance().Insert(Key, _Temp); return(_Temp); } }
/// <summary> /// 根据用户ID移除用户资料Cache /// </summary> /// <param name="UserID"></param> public static void MoveUserCache(int UserID) { FrameWorkCache.Instance().Remove(string.Format("{0}-UserInfo-{1}", Common.Get_WebCacheName, UserID)); }
/// <summary> /// 移除用户权限Cache /// </summary> /// <param name="UserID">用户ID</param> public static void Move_UserPermissionCache(int UserID) { FrameWorkCache.Instance().Remove(string.Format("{1}-Permission-{0}", UserID, Common.Get_WebCacheName)); }
/// <summary> /// 初始化表缓存 /// </summary> static sys_ModuleExtPermission_Cache() { FrameWorkCache.Instance().Insert(key, new Dictionary <int, sys_ModuleExtPermissionTable>()); FrameWorkCache.Instance().Insert(KeyModule, new Dictionary <int, List <sys_ModuleExtPermissionTable> >()); Load_ModuleExtCache(set_ModuleExtCache); }