コード例 #1
0
        /// <summary>
        /// 获取用户权限树
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="userId">用户主键</param>
        /// <param name="permissionName">权限名称</param>
        /// <param name="permissionCode">权限编号</param>
        /// <returns>用户主键</returns>
        public string[] GetPermissionTreeUserIds(string systemCode, string userId, string permissionCode, string permissionName = null)
        {
            string[] result       = null;
            string   tableName    = string.Empty;
            string   permissionId = BaseModuleManager.GetIdByCodeByCache(systemCode, permissionCode);

            if (!string.IsNullOrEmpty(permissionId))
            {
                tableName = " (SELECT ResourceId, TargetId FROM " + UserInfo.SystemCode + "PermissionScope WHERE Enabled = 1 AND DeletionStateCode = 0 AND ResourceCategory = '" + BaseUserEntity.TableName + "' AND TargetCategory = '" + BaseUserEntity.TableName + "' AND PermissionId = " + permissionId + ") T ";
                // tableName = UserInfo.SystemCode + "UserUserScope";
                string    fieldParentId = "ResourceId"; //"ManagerUserId";
                string    fieldId       = "TargetId";   // "UserId";
                string    order         = null;
                bool      idOnly        = true;
                DataTable dt            = DbLogic.GetChildrens(this.DbHelper, tableName, fieldId, userId, fieldParentId, order, idOnly);
                result = BaseBusinessLogic.FieldToArray(dt, "TargetId");
            }
            return(result);
        }
コード例 #2
0
 /// <summary>
 /// 获取子节点列表
 /// </summary>
 /// <param name="fieldId">主键字段</param>
 /// <param name="id">值</param>
 /// <param name="fieldParentId">父亲节点字段</param>
 /// <param name="order">排序</param>
 /// <returns>数据表</returns>
 public DataTable GetChildrens(string fieldId, string id, string fieldParentId, string order)
 {
     return(DbLogic.GetChildrens(DbHelper, this.CurrentTableName, fieldId, id, fieldParentId, order));
 }