void ISqlStatementElement.Render(SqlTextWriter writer, SqlBuildArguments args) { writer.WriteBeginGroup(); this.WriteColumnName(writer, args); writer.WriteOperator(SqlOperator.GreaterThanOrEqual); writer.WriteParameter(args.CreateParameter(this.GetBeginDate(), System.Data.DbType.DateTime)); writer.WriteSpace(); writer.Write(SqlConstants.AND); writer.WriteSpace(); this.WriteColumnName(writer, args); writer.WriteOperator(SqlOperator.LessThanOrEqual); writer.WriteParameter(args.CreateParameter(this.GetEndDate(), System.Data.DbType.DateTime)); writer.WriteEndGroup(); }
void ISqlStatementElement.Render(SqlTextWriter writer, SqlBuildArguments args) { args.AssignAlias(this.SubQueryTable); var subquery = new SqlSelectBuilder(this.SubQueryTable); var subQueryColumn = new SqlColumn(this.SubQueryTable, this.SubQueryColumn); subQueryColumn.Aggregate = SqlAggregate.Count; subQueryColumn.Alias = "Cnt"; subquery.Columns.Add(subQueryColumn); foreach (var filter in this.SubQueryFilters) { subquery.Filters.Add(filter); } writer.WriteBeginGroup(); writer.WriteBeginGroup(); subquery.Render(writer, args); writer.WriteEndGroup(); writer.WriteSpace(); writer.WriteOperator(this.CountOperator); writer.WriteSpace(); writer.WriteParameter(args.CreateParameter(this.CountValue, System.Data.DbType.Int32)); writer.WriteEndGroup(); }
void ISqlStatementElement.Render(SqlTextWriter writer, SqlBuildArguments args) { writer.WriteBeginGroup(); writer.WriteColumnName(this.LeftColumnName, args.TableName(this.LeftTable)); writer.WriteOperator(this.Operator); writer.WriteColumnName(this.RightColumnName, args.TableName(this.RightTable)); writer.WriteEndGroup(); }
public void Render(SqlTextWriter writer, SqlBuildArguments args) { writer.WriteBeginGroup(); writer.WriteColumnName(this.ColumnName, args.TableName(this.Table)); writer.WriteOperator(this.Operator); writer.Write(this.ParameterName); writer.WriteEndGroup(); }
void ISqlStatementElement.Render(SqlTextWriter writer, SqlBuildArguments args) { writer.WriteBeginGroup(); writer.WriteColumnName(this.ColumnName, args.TableName(this.Table)); writer.WriteOperator(this.Operator); if (this.EncodeValueAsLiteral) { writer.WriteLiteralValue(this.Value); } else { writer.WriteParameter(args.CreateParameter(this.Value, this.DataType)); } writer.WriteEndGroup(); }