Пример #1
0
        public static List <C_Permission> GetPermission(int userId)
        {
            var list = PermissionCacher.GetIfExist(userId);

            if (list.Any())
            {
                return(list);
            }
            var result = PermissionDataCore.GetPermission(userId);

            PermissionCacher.AddCache(userId, result);
            return(result);
        }
Пример #2
0
        public static List <C_Permission> GetPermission(string roleCode)
        {
            var list = PermissionCacher.GetIfExist(roleCode);

            if (list.Any())
            {
                return(list);
            }
            var result = PermissionDataCore.GetPermission(roleCode);

            PermissionCacher.AddCache(roleCode, result);
            return(result);
        }
Пример #3
0
 public static void Init(string connStr)
 {
     DbConnName = connStr;
     SonFact.init(connStr);
     PermissionDataCore.InitTables();
 }