C# Class BF2Statistics.Database.QueryBuilder.UpdateQueryBuilder

Afficher le fichier Open project: BF2Statistics/ControlCenter Class Usage Examples

Méthodes publiques

Свойство Type Description
Table string

Protected Properties

Свойство Type Description
Driver DatabaseDriver
Fields FieldValuePair>.Dictionary
WhereStatement WhereStatement

Méthodes publiques

Méthode Description
AddWhere ( string field, Comparison @operator, object compareValue ) : WhereClause
AddWhere ( WhereClause Clause ) : void
BuildCommand ( ) : DbCommand

Builds the query string with the current SQL Statement, and returns the DbCommand to be executed. All WHERE paramenters are propery escaped, making this command SQL Injection safe.

BuildQuery ( ) : string

Builds the query string with the current SQL Statement, and returns the querystring. This method is NOT Sql Injection safe!

Execute ( ) : int

Executes the command against the database. The database driver must be set!

SetDbDriver ( DatabaseDriver Driver ) : void

Sets the database driver

SetField ( string Field, object Value ) : void

Sets a value for the specified field

SetField ( string Field, object Value, ValueMode Mode ) : void

Sets a value for the specified field

SetTable ( string Table ) : void

Sets the table name to update

SetWhereOperator ( LogicOperator @Operator ) : void

Sets the Logic Operator for the WHERE statement

UpdateQueryBuilder ( DatabaseDriver Driver ) : System

Creates a new instance of UpdateQueryBuilder with the provided Database Driver.

UpdateQueryBuilder ( string Table, DatabaseDriver Driver ) : System

Creates a new instance of UpdateQueryBuilder with the provided Database Driver.

Méthodes protégées

Méthode Description
BuildQuery ( bool BuildCommand ) : object

Builds the query string or DbCommand

GetSign ( ValueMode Mode ) : string

Returns the sign for the given value mode

Method Details

AddWhere() public méthode

public AddWhere ( string field, Comparison @operator, object compareValue ) : WhereClause
field string
@operator Comparison
compareValue object
Résultat WhereClause

AddWhere() public méthode

public AddWhere ( WhereClause Clause ) : void
Clause WhereClause
Résultat void

BuildCommand() public méthode

Builds the query string with the current SQL Statement, and returns the DbCommand to be executed. All WHERE paramenters are propery escaped, making this command SQL Injection safe.
public BuildCommand ( ) : DbCommand
Résultat System.Data.Common.DbCommand

BuildQuery() protected méthode

Builds the query string or DbCommand
protected BuildQuery ( bool BuildCommand ) : object
BuildCommand bool
Résultat object

BuildQuery() public méthode

Builds the query string with the current SQL Statement, and returns the querystring. This method is NOT Sql Injection safe!
public BuildQuery ( ) : string
Résultat string

Execute() public méthode

Executes the command against the database. The database driver must be set!
public Execute ( ) : int
Résultat int

GetSign() protected méthode

Returns the sign for the given value mode
protected GetSign ( ValueMode Mode ) : string
Mode ValueMode
Résultat string

SetDbDriver() public méthode

Sets the database driver
public SetDbDriver ( DatabaseDriver Driver ) : void
Driver DatabaseDriver
Résultat void

SetField() public méthode

Sets a value for the specified field
public SetField ( string Field, object Value ) : void
Field string The column or field name
Value object The new value to update
Résultat void

SetField() public méthode

Sets a value for the specified field
public SetField ( string Field, object Value, ValueMode Mode ) : void
Field string The column or field name
Value object The new value to update
Mode ValueMode Sets how the update value will be applied to the existing field value
Résultat void

SetTable() public méthode

Sets the table name to update
public SetTable ( string Table ) : void
Table string The name of the table to update
Résultat void

SetWhereOperator() public méthode

Sets the Logic Operator for the WHERE statement
public SetWhereOperator ( LogicOperator @Operator ) : void
@Operator LogicOperator
Résultat void

UpdateQueryBuilder() public méthode

Creates a new instance of UpdateQueryBuilder with the provided Database Driver.
public UpdateQueryBuilder ( DatabaseDriver Driver ) : System
Driver DatabaseDriver The DatabaseDriver that will be used to query this SQL statement
Résultat System

UpdateQueryBuilder() public méthode

Creates a new instance of UpdateQueryBuilder with the provided Database Driver.
public UpdateQueryBuilder ( string Table, DatabaseDriver Driver ) : System
Table string The table we are updating
Driver DatabaseDriver The DatabaseDriver that will be used to query this SQL statement
Résultat System

Property Details

Driver protected_oe property

The database driver, if using the "BuildCommand" method
protected DatabaseDriver Driver
Résultat DatabaseDriver

Fields protected_oe property

A list of FieldValuePairs
protected Dictionary Fields
Résultat FieldValuePair>.Dictionary

Table public_oe property

The table name to query
public string Table
Résultat string

WhereStatement protected_oe property

Query's where statement
protected WhereStatement WhereStatement
Résultat WhereStatement