Exemple #1
0
        public IEnumerable <ITreeNode> GetDisplayTreeNodes(string id)
        {
            ITreeNode node = GetTreeNode(id);

            if (node == null)
            {
                return(RootNodes);
            }

            IParamBuilder builder = TreeUtil.GetValueBuilder(fSelector, fDefinition,
                                                             TopLevel, node.Convert <NormalDataRowTreeNode>());

            builder = GetCustomParamBuilder(builder);
            if (builder == null)
            {
                return(Enumerable.Empty <ITreeNode>());
            }
            //IParamBuilder customSql = fTreeProvider.CustomSql;
            //if (builder == null && customSql == null)
            //    return TreeUtil.CreateEmptyEnumerable();
            //if (customSql != null)
            //    builder = builder == null ? customSql : SqlParamBuilder.CreateParamBuilder(builder, customSql);
            var data = TreeUtil.SelectData(fSelector, this, () => fSelector.Select(builder, fOrder), id);

            return(TreeUtil.GetDisplayTreeNodes(data, id));
        }
Exemple #2
0
        public IEnumerable <ITreeNode> GetDisplayTreeNodes(string id)
        {
            int           level   = fProvider.GetLevel(fDefinition, id);
            IParamBuilder builder = TreeUtil.GetLevelBuilder(fSelector, fDefinition,
                                                             level, id, fProvider);

            var data = TreeUtil.SelectData(fSelector, this, () => fSelector.Select(builder), id);

            return(TreeUtil.GetDisplayTreeNodes(data, id));
        }
Exemple #3
0
        private IEnumerable <ITreeNode> SelectChildNode(string parentId, int level)
        {
            string        value     = fProvider.GetSqlLikeValue(fDefinition, level, parentId);
            IFieldInfo    fieldInfo = fSelector.GetFieldInfo(fDefinition.IdField);
            IParamBuilder builder   = SqlParamBuilder.CreateSingleSql(fSelector.Context,
                                                                      fieldInfo, "LIKE", value);

            if (!string.IsNullOrEmpty(parentId))
            {
                builder = SqlParamBuilder.CreateParamBuilder(builder,
                                                             SqlParamBuilder.CreateSingleSql(fSelector.Context, fieldInfo,
                                                                                             "<>", fDefinition.IdField + 1, parentId));
            }
            return(TreeUtil.SelectData(fSelector, this, () => fSelector.Select(builder), null).ToArray());
        }
Exemple #4
0
        public IEnumerable <ITreeNode> GetChildNodes(string parentId)
        {
            TkDebug.AssertArgumentNullOrEmpty(parentId, "parentId", this);

            if (!UseCustomParamBuilder)
            {
                return(TreeUtil.SelectData(fSelector, this,
                                           () => fSelector.SelectWithParam(null, fOrder, fDefinition.ParentIdField, parentId),
                                           null).ToArray());
            }
            else
            {
                IParamBuilder builder = fSelector.CreateParamBuilder(null,
                                                                     new string[] { fDefinition.ParentIdField }, parentId);
                return(GetTreeNodes(builder).ToArray());
            }
        }
Exemple #5
0
 private IEnumerable <ITreeNode> GetTreeNodes(IParamBuilder builder)
 {
     builder = GetCustomParamBuilder(builder);
     return(TreeUtil.SelectData(fSelector, this,
                                () => fSelector.Select(builder, fOrder), null));
 }