Exemple #1
0
        internal override void BuildQueryString(StringBuilder queryStringBuilder, ConditionCollectionContext buildContext)
        {
            base.BuildQueryString(queryStringBuilder, buildContext);
            ConditionCollectionContext subQueryBuildCondition = new ConditionCollectionContext(buildContext.DataCommand);

            subQueryBuildCondition.AddedParameterNames = buildContext.AddedParameterNames;
            queryStringBuilder.Append(string.Format(" {0} {1} {2} ({3} {4})",
                                                    buildContext.IsFirstCondition ? string.Empty : this.ConditionRelationType.ToString(),
                                                    this.FieldName, GetOperatorString(this.OperatorType), this.SubQuerySQLTemplate,
                                                    ConditionConstructor.BuildQuerySqlConditionString(this.SubQueryConditions, subQueryBuildCondition)));
            buildContext.IsFirstCondition = false;
        }
Exemple #2
0
        public string BuildQuerySql()
        {
            // Build Query Condition
            ConditionCollectionContext buildContext = new ConditionCollectionContext(m_dataCommand);
            string result = m_querySqlTemplate.Replace("#StrWhere#", m_conditionConstructor.BuildQuerySqlConditionString(buildContext));

            // Build OrderBy String
            result = result.Replace("#SortColumnName#", BuildOrderByString());
            // Set Paging Information
            SetPagingInformation();
            return(result);
        }