OpenPetra
Free Administration Software for Non-Profits
Ict.Petra.Server.MCommon.Data.Cascading.PLocationCascading Class Reference

auto generated More...

Inheritance diagram for Ict.Petra.Server.MCommon.Data.Cascading.PLocationCascading:
Ict.Common.Data.TTypedDataAccess

Public Types

enum  eSubmitChangesOperations { eUpdate = 1 , eDelete = 2 , eInsert = 4 , eAll = 7 }
 enumeration of operations that can be selected for SubmitChanges More...
 

Static Public Member Functions

static void DeleteByPrimaryKey (Int64 ASiteKey, Int32 ALocationKey, TDBTransaction ATransaction, bool AWithCascDelete)
 cascading delete More...
 
static void DeleteUsingTemplate (PLocationRow ATemplateRow, StringCollection ATemplateOperators, TDBTransaction ATransaction, bool AWithCascDelete)
 cascading delete More...
 
static int CountByPrimaryKey (Int64 ASiteKey, Int32 ALocationKey, int AMaxReferences, TDBTransaction ATransaction, bool AWithCascCount, out List< TRowReferenceInfo >AReferences, int ANestingDepth=0)
 cascading count More...
 
static int CountByPrimaryKey (Int64 ASiteKey, Int32 ALocationKey, int AMaxReferences, TDBTransaction ATransaction, bool AWithCascCount, out TVerificationResultCollection AVerificationResults, int ANestingDepth=0, TResultSeverity AResultSeverity=TResultSeverity.Resv_Critical)
 cascading count More...
 
static int CountByPrimaryKey (object[] APrimaryKeyValues, int AMaxReferences, TDBTransaction ATransaction, bool AWithCascCount, out TVerificationResultCollection AVerificationResults, int ANestingDepth=0, TResultSeverity AResultSeverity=TResultSeverity.Resv_Critical)
 cascading count More...
 
static int CountUsingTemplate (PLocationRow ATemplateRow, StringCollection ATemplateOperators, int AMaxReferences, TDBTransaction ATransaction, bool AWithCascCount, ref List< TRowReferenceInfo >AReferences, int ANestingDepth=0)
 cascading count More...
 
static bool NoDefaultColumn (String AColumnName)
 This function returns true if the column name is not one of the special columns, that are written automatically: modified date and by, created date and by, modification id More...
 
static void GetStoredModification (short ATableId, string[] AColumnNames, int[] APrimKeyColumnOrdList, DataRow ADataRow, DB.TDBTransaction ATransaction, out DateTime AModificationID, out String AModifiedBy, out System.DateTime AModifiedDate, bool ATreatRowAsAdded=false)
 This function returns the modification details of a row More...
 
static void InsertRow (short ATableId, ref DataRow ADataRow, String ACurrentUser, StringBuilder AInsertStatement, List< OdbcParameter >AInsertParameters)
 This function is called by the DataStore (SubmitChanges). it will not update the modification id. More...
 
static void InsertRow (short ATableId, ref DataRow ADataRow, TDBTransaction ATransaction, String ACurrentUser, bool ATreatRowAsAdded)
 This function is called by the DataStore (SubmitChanges). it will update the modification id. More...
 
static void UpdateRow (short ATableId, bool AThrowAwayAfterSubmitChanges, ref DataRow ADataRow, DB.TDBTransaction ATransaction, String ACurrentUser)
 This function is called by the DataStore (SubmitChanges) More...
 
static void DeleteRow (short ATableId, DataRow ADataRow, DB.TDBTransaction ATransaction)
 This function is called by the DataStore (SubmitChanges) More...
 
static String GenerateSelectClause (StringCollection AFieldList, short ATableID, bool AIncludeTableNames=false)
 This function expects a StringCollection that can be filled, empty or nil. It also needs the list of the primary key columns, because otherwise the returned row will fail the constraints. It will return a proper Select Clause. More...
 
static String GenerateSelectClauseLong (String ATableName, StringCollection AFieldList, short ATableId)
 This function expects a StringCollection that can be filled, empty or nil. It also needs the list of the primary key columns, because otherwise the returned row will fail the constraints. It will prefix all fields with the given tablename. needed for selecting from join statements. It will return a proper Select Clause. If a field has already a dot in the name, the ATablename is not put before it: That way you can do SUM(PUB_table.p_something). More...
 
static String GenerateWhereClause (string[] AColumnNames, DataRow ADataRow, StringCollection ATemplateOperators)
 This function expects an empty table that contains all existing columns, and a datarow that has a string or an empty value for each column. It will return a Where clause, using the given values. More...
 
static String GenerateWhereClause (string[] AColumnNames, DataRow ADataRow)
 This function expects an empty table that contains all existing columns, and a datarow that has a string or an empty value for each column. It will return a Where clause, using the given values. More...
 
static String GenerateWhereClause (TSearchCriteria[] ASearchCriteria)
 This function expects an empty table that contains all existing columns, and search criteria. It will return a Where clause, using the given values. More...
 
static String GenerateWhereClauseFromPrimaryKey (short ATableId)
 this function generates a where clause for the primary key of the given table More...
 
static String GenerateWhereClauseFromUniqueKey (short ATableId)
 this function generates a where clause for the unique key of the given table More...
 
static String GenerateWhereClauseLong (String ATableName, short ATableId, DataRow ADataRow, StringCollection ATemplateOperators)
 This function expects a string list of all existing columns, and a datarow that has a value or an empty value for each column. It will return a Where clause, using the given values. It does not contain the WHERE keyword. It uses the long form, table.fieldname More...
 
static String GenerateWhereClauseLong (String ATableName, TSearchCriteria[] ASearchCriteria)
 This function expects a string list of all existing columns, and a criteria list of values to search for. It will return a Where clause, using the given values. It does not contain the WHERE keyword. It uses the long form, table.fieldname More...
 
static String GenerateWhereClauseLong (String ATableName, short ATableId, DataRow ADataRow)
 This function expects a string array with the names of all existing columns, and a datarow that has a value or an empty value for each column. It will return a Where clause, using the given values. It does not contain the WHERE keyword. It uses the long form, table.fieldname More...
 
static String GenerateOrderByClause (StringCollection AOrderBy)
 This function expects a list of string, where the first string is either "order by" or "group by", and the rest of the string is e.g. "p_partner.p_partner_key_n ASC" It will return the appropriate part of the sql query More...
 
static OdbcParameter CreateOdbcParameter (short ATableId, Int32 AColumnNr, Type AType)
 This function creates an odbc parameter with the correct type, based on the obj which comes from a DataRow More...
 
static System.Object GetSafeValue (DataRow ADataRow, System.Int32 AColumnNr, DataRowVersion AVersion)
 This function returns either a valid object or System.DBNull; this is necessary because mono sometimes has a nil pointer in the DataRow for the original version etc. More...
 
static System.Object GetSafeValue (DataRow ADataRow, String AColumnName, DataRowVersion AVersion)
 This function returns either a valid object or System.DBNull; this is necessary because mono sometimes has a nil pointer in the DataRow for the original version etc. More...
 
static bool NotEquals (DataRow ADataRow, System.Int32 AColumnNr, ref System.Object ACurrentValue)
 Compare the original and the current value of a column in a datarow. Make sure some mono specific troubles are worked around. More...
 
static OdbcParameter[] GetParametersForWhereClause (short ATableId, DataRow ADataRow)
 This function provides the actual parameters for the GenerateWhereClause uses only the values that are not DBNULL More...
 
static OdbcParameter[] GetParametersForWhereClause (short ATableNumber, TSearchCriteria[] ASearchCriteria)
 This function provides the actual parameters for the GenerateWhereClause More...
 
static OdbcParameter[] GetParametersForWhereClauseWithPrimaryKey (short ATableId, DataRow ADataRow)
 This function provides the actual parameters for the GenerateWhereClause uses only the values that are not DBNULL More...
 
static List< OdbcParameter > GetParametersForInsertClause (short ATableId, ref DataRow ADataRow, Int32 ANumberDBColumns, String ACurrentUser, bool AIncludeDefaultColumns)
 This function provides the actual parameters for the GenerateInsertClause uses only the values that are not DBNULL adds the next modification ID More...
 
static OdbcParameter[] GetParametersForUpdateClause (short ATableId, ref DataRow ADataRow, int[] APrimaryKeyColumnOrd, Int32 ANumberDBColumns, String ACurrentUser)
 This function provides the actual parameters for the GenerateUpdateClause uses only the values that are changed (comparing the current and the original version of the row) More...
 
static OdbcParameter[] GetParametersForDeleteClause (short ATableId, DataRow ADataRow, int[] APrimaryKeyColumnOrd)
 This function provides the actual parameters for the GenerateDeleteClause it uses the OriginalVersion of the primary key values More...
 
static String GenerateInsertClause (String ATableName, string[] AColumnNames, DataRow ADataRow, bool AIncludeDefaultColumns)
 This function expects an empty table that contains all existing columns, and a datarow that has a value or an empty value for each column. It will return a complete INSERT Clause. More...
 
static String GenerateUpdateClause (String ATableName, string[] AColumnNames, DataRow ADataRow, int[] APrimKeyColumnOrdList)
 This function expects an empty table that contains all existing columns, and a datarow that has a value or an empty value for each column. More...
 
static DataRow LoadByPrimaryKey (short ATableId, DataSet ADataSet, System.Object[] APrimaryKeyValues, StringCollection AFieldList, TDBTransaction ATransaction, StringCollection AOrderBy, int AStartRecord, int AMaxRecords)
 load data row by primary key into a dataset More...
 
static DataRow LoadByPrimaryKey (short ATableId, TTypedDataTable ADataTable, System.Object[] APrimaryKeyValues, StringCollection AFieldList, TDBTransaction ATransaction, StringCollection AOrderBy, int AStartRecord, int AMaxRecords)
 different version for data table More...
 
static void LoadByUniqueKey (short ATableId, DataSet ADataSet, System.Object[] AUniqueKeyValues, StringCollection AFieldList, TDBTransaction ATransaction, StringCollection AOrderBy, int AStartRecord, int AMaxRecords)
 load data row by unique key into a dataset More...
 
static void LoadByUniqueKey (short ATableId, TTypedDataTable ADataTable, System.Object[] AUniqueKeyValues, StringCollection AFieldList, TDBTransaction ATransaction, StringCollection AOrderBy, int AStartRecord, int AMaxRecords)
 different version for data table More...
 
static void LoadViaForeignKey (short ATableId, short AOtherTableId, DataSet ADataSet, string[] AThisFieldNames, System.Object[] AForeignKeyValues, StringCollection AFieldList, TDBTransaction ATransaction, StringCollection AOrderBy, int AStartRecord, int AMaxRecords)
 load data for the current table via a foreign key, eg. load all extracts created by user x More...
 
static void LoadViaForeignKey (short ATableId, short AOtherTableId, TTypedDataTable ADataTable, string[] AThisFieldNames, System.Object[] AForeignKeyValues, StringCollection AFieldList, TDBTransaction ATransaction, StringCollection AOrderBy, int AStartRecord, int AMaxRecords)
 load data for the current table via a foreign key, eg. load all extracts created by user x More...
 
static void LoadViaForeignKey (short ATableId, short AOtherTableId, DataSet ADataSet, string[] AThisFieldNames, DataRow ATemplateRow, StringCollection ATemplateOperators, StringCollection AFieldList, TDBTransaction ATransaction, StringCollection AOrderBy, int AStartRecord, int AMaxRecords)
 Load via other table, using template values. More...
 
static void LoadViaForeignKey (short ATableId, short AOtherTableId, TTypedDataTable ADataTable, string[] AThisFieldNames, DataRow ATemplateRow, StringCollection ATemplateOperators, StringCollection AFieldList, TDBTransaction ATransaction, StringCollection AOrderBy, int AStartRecord, int AMaxRecords)
 Load via other table, using template values. More...
 
static void LoadViaForeignKey (short ATableId, short AOtherTableId, DataSet ADataSet, string[] AThisFieldNames, TSearchCriteria[] ASearchCriteria, StringCollection AFieldList, TDBTransaction ATransaction, StringCollection AOrderBy, int AStartRecord, int AMaxRecords)
 Load via other table, using template values. More...
 
static void LoadViaForeignKey (short ATableId, short AOtherTableId, TTypedDataTable ADataTable, string[] AThisFieldNames, TSearchCriteria[] ASearchCriteria, StringCollection AFieldList, TDBTransaction ATransaction, StringCollection AOrderBy, int AStartRecord, int AMaxRecords)
 Load via other table, using template values. More...
 
static int CountViaForeignKey (short ATableId, short AOtherTableId, string[] AThisFieldNames, System.Object[] AForeignKeyValues, TDBTransaction ATransaction)
 count the rows by the values of a foreign key More...
 
static int CountViaForeignKey (short ATableId, short AOtherTableId, string[] AThisFieldNames, DataRow ATemplateRow, StringCollection ATemplateOperators, TDBTransaction ATransaction)
 count the rows by the values of a foreign key More...
 
static int CountViaForeignKey (short ATableId, short AOtherTableId, string[] AThisFieldNames, TSearchCriteria[] ASearchCriteria, TDBTransaction ATransaction)
 count the rows by the values of a foreign key More...
 
static void DeleteByPrimaryKey (short ATableId, System.Object[] APrimaryKeyValues, TDBTransaction ATransaction)
 delete by primary key values More...
 
static bool Exists (short ATableId, System.Object[] APrimaryKeyValues, TDBTransaction ATransaction)
 check if row exists with the primary key More...
 
static bool ExistsUniqueKey (short ATableId, System.Object[] AUniqueKeyValues, TDBTransaction ATransaction)
 check if row exists with the unique key More...
 
static void LoadUsingTemplate (short ATableID, DataSet ADataSet, TSearchCriteria[] ASearchCriteria, StringCollection AFieldList, TDBTransaction ATransaction, StringCollection AOrderBy, int AStartRecord, int AMaxRecords)
 loads all rows matching certain search criteria into a dataset More...
 
static void LoadUsingTemplate (short ATableID, TTypedDataTable ATypedTableToLoad, TSearchCriteria[] ASearchCriteria, StringCollection AFieldList, TDBTransaction ATransaction, StringCollection AOrderBy, int AStartRecord, int AMaxRecords)
 loads all rows matching certain search criteria into a typed data table More...
 
static void LoadUsingTemplate (short ATableId, DataSet ADataSet, DataRow ATemplateRow, StringCollection ATemplateOperators, StringCollection AFieldList, TDBTransaction ATransaction, StringCollection AOrderBy, int AStartRecord, int AMaxRecords)
 load using a template row More...
 
static void LoadUsingTemplate (short ATableId, TTypedDataTable ADataTable, DataRow ATemplateRow, StringCollection ATemplateOperators, StringCollection AFieldList, TDBTransaction ATransaction, StringCollection AOrderBy, int AStartRecord, int AMaxRecords)
 load using a template row More...
 
static void DeleteUsingTemplate (short ATableId, DataRow ATemplateRow, StringCollection ATemplateOperators, TDBTransaction ATransaction)
 delete all rows matching the given row More...
 
static void DeleteUsingTemplate (short ATableId, TSearchCriteria[] ASearchCriteria, TDBTransaction ATransaction)
 delete all rows matching the search criteria More...
 
static void SubmitChanges (TTypedDataTable ATable, TDBTransaction ATransaction, eSubmitChangesOperations ASelectedOperations, string AUserId, string ASequenceName, string ASequenceField)
 submit those rows in the table that have been modified or created or deleted More...
 
static void SubmitChanges (TTypedDataTable ATable, TDBTransaction ATransaction, string AUserId, string ASequenceName, string ASequenceField)
 overloaded version without ASelectedOperations More...
 
static void SubmitChanges (TTypedDataTable ATable, TDBTransaction ATransaction, string AUserId)
 overloaded version without sequence More...
 
static void SubmitChanges (TTypedDataTable ATable, TDBTransaction ATransaction, eSubmitChangesOperations ASelectedOperations, string AUserId)
 overloaded version without sequence, but with ASelectedOperations More...
 
static TVerificationResultCollection BuildVerificationResultCollectionFromRefTables (string AThisTable, string AThisTableLabel, Dictionary< string, object >APKInfo, List< TRowReferenceInfo >AReferences, TResultSeverity AResultSeverity=TResultSeverity.Resv_Critical)
 Builds a TVerificationResultCollection from DB Table references created by a cascading count Method. It will contain only a single TVerificationResult. More...
 

Static Public Attributes

const string MODIFICATION_ID = "s_modification_id_t"
 name of the column used for tracking changes, one ID per change More...
 
const string MODIFIED_BY = "s_modified_by_c"
 who has last modified the row More...
 
const string MODIFIED_DATE = "s_date_modified_d"
 when was the last change to the row More...
 
const string CREATED_BY = "s_created_by_c"
 who has originally created this row More...
 
const string CREATED_DATE = "s_date_created_d"
 when was this row originally created More...
 
static readonly DateTime MODIFICATION_ID_DELETEDROW_INDICATOR = DateTime.MaxValue
 indicates whether a row has been deleted More...
 

Detailed Description

auto generated

Member Enumeration Documentation

◆ eSubmitChangesOperations

enumeration of operations that can be selected for SubmitChanges

Enumerator
eUpdate 

update records

eDelete 

delete records

eInsert 

add new records

eAll 

execute all operations, no matter if it is update, delete, insert

Member Function Documentation

◆ BuildVerificationResultCollectionFromRefTables()

static TVerificationResultCollection Ict.Common.Data.TTypedDataAccess.BuildVerificationResultCollectionFromRefTables ( string  AThisTable,
string  AThisTableLabel,
Dictionary< string, object >  APKInfo,
List< TRowReferenceInfo AReferences,
TResultSeverity  AResultSeverity = TResultSeverity.Resv_Critical 
)
inlinestaticinherited

Builds a TVerificationResultCollection from DB Table references created by a cascading count Method. It will contain only a single TVerificationResult.

Returns
TVerificationResultCollection from DB Table references created by a cascading count Method. In case AReferences does not contain elements a TVerificationResultCollection containing no elements will be returned.
Parameters
AThisTableName of the DB Table (as in the DB) that the references point to.
AThisTableLabelLabel (='friendly name' for the user) of the DB Table that the references point to.
APKInfoDictionary<T, T> consisting of a string-object pair for each Primary Key Column. The string (Key) is the Label ('friendly name' for the user) of the PK Column and the object (Value) holds the actual data of the PK Column.
AReferencesA List<T> of TRowReferenceInfo objects that contain information about the DB Table references created by a cascading count Method.
AResultSeverityAllows the specification of a TResultSeverity for the TVerificationResult that gets added to the return value. (Default=TResultSeverity.Resv_Critical.)
Returns
A TVerificationResultCollection containing a single TVerificationResult that contains information about DB Table references created by a cascading count Method.

◆ CountByPrimaryKey() [1/3]

static int Ict.Petra.Server.MCommon.Data.Cascading.PLocationCascading.CountByPrimaryKey ( Int64  ASiteKey,
Int32  ALocationKey,
int  AMaxReferences,
TDBTransaction  ATransaction,
bool  AWithCascCount,
out List< TRowReferenceInfo AReferences,
int  ANestingDepth = 0 
)
inlinestatic

cascading count

◆ CountByPrimaryKey() [2/3]

static int Ict.Petra.Server.MCommon.Data.Cascading.PLocationCascading.CountByPrimaryKey ( Int64  ASiteKey,
Int32  ALocationKey,
int  AMaxReferences,
TDBTransaction  ATransaction,
bool  AWithCascCount,
out TVerificationResultCollection  AVerificationResults,
int  ANestingDepth = 0,
TResultSeverity  AResultSeverity = TResultSeverity.Resv_Critical 
)
inlinestatic

cascading count

◆ CountByPrimaryKey() [3/3]

static int Ict.Petra.Server.MCommon.Data.Cascading.PLocationCascading.CountByPrimaryKey ( object[]  APrimaryKeyValues,
int  AMaxReferences,
TDBTransaction  ATransaction,
bool  AWithCascCount,
out TVerificationResultCollection  AVerificationResults,
int  ANestingDepth = 0,
TResultSeverity  AResultSeverity = TResultSeverity.Resv_Critical 
)
inlinestatic

cascading count

◆ CountUsingTemplate()

static int Ict.Petra.Server.MCommon.Data.Cascading.PLocationCascading.CountUsingTemplate ( PLocationRow  ATemplateRow,
StringCollection  ATemplateOperators,
int  AMaxReferences,
TDBTransaction  ATransaction,
bool  AWithCascCount,
ref List< TRowReferenceInfo AReferences,
int  ANestingDepth = 0 
)
inlinestatic

cascading count

◆ CountViaForeignKey() [1/3]

static int Ict.Common.Data.TTypedDataAccess.CountViaForeignKey ( short  ATableId,
short  AOtherTableId,
string[]  AThisFieldNames,
DataRow  ATemplateRow,
StringCollection  ATemplateOperators,
TDBTransaction  ATransaction 
)
inlinestaticinherited

count the rows by the values of a foreign key

◆ CountViaForeignKey() [2/3]

static int Ict.Common.Data.TTypedDataAccess.CountViaForeignKey ( short  ATableId,
short  AOtherTableId,
string[]  AThisFieldNames,
System.Object[]  AForeignKeyValues,
TDBTransaction  ATransaction 
)
inlinestaticinherited

count the rows by the values of a foreign key

◆ CountViaForeignKey() [3/3]

static int Ict.Common.Data.TTypedDataAccess.CountViaForeignKey ( short  ATableId,
short  AOtherTableId,
string[]  AThisFieldNames,
TSearchCriteria[]  ASearchCriteria,
TDBTransaction  ATransaction 
)
inlinestaticinherited

count the rows by the values of a foreign key

◆ CreateOdbcParameter()

static OdbcParameter Ict.Common.Data.TTypedDataAccess.CreateOdbcParameter ( short  ATableId,
Int32  AColumnNr,
Type  AType 
)
inlinestaticinherited

This function creates an odbc parameter with the correct type, based on the obj which comes from a DataRow

Parameters
ATableIdTable that we are operating on
AColumnNrwhich column should the parameter be generated for
ATypethe value that needs to be converted to OdbcParameter
Returns
the Odbc parameter

◆ DeleteByPrimaryKey() [1/2]

static void Ict.Petra.Server.MCommon.Data.Cascading.PLocationCascading.DeleteByPrimaryKey ( Int64  ASiteKey,
Int32  ALocationKey,
TDBTransaction  ATransaction,
bool  AWithCascDelete 
)
inlinestatic

cascading delete

◆ DeleteByPrimaryKey() [2/2]

static void Ict.Common.Data.TTypedDataAccess.DeleteByPrimaryKey ( short  ATableId,
System.Object[]  APrimaryKeyValues,
TDBTransaction  ATransaction 
)
inlinestaticinherited

delete by primary key values

Parameters
ATableId
APrimaryKeyValues
ATransaction

◆ DeleteRow()

static void Ict.Common.Data.TTypedDataAccess.DeleteRow ( short  ATableId,
DataRow  ADataRow,
DB.TDBTransaction  ATransaction 
)
inlinestaticinherited

This function is called by the DataStore (SubmitChanges)

Returns
void

◆ DeleteUsingTemplate() [1/3]

static void Ict.Petra.Server.MCommon.Data.Cascading.PLocationCascading.DeleteUsingTemplate ( PLocationRow  ATemplateRow,
StringCollection  ATemplateOperators,
TDBTransaction  ATransaction,
bool  AWithCascDelete 
)
inlinestatic

cascading delete

◆ DeleteUsingTemplate() [2/3]

static void Ict.Common.Data.TTypedDataAccess.DeleteUsingTemplate ( short  ATableId,
DataRow  ATemplateRow,
StringCollection  ATemplateOperators,
TDBTransaction  ATransaction 
)
inlinestaticinherited

delete all rows matching the given row

Parameters
ATableId
ATemplateRow
ATemplateOperators
ATransaction

◆ DeleteUsingTemplate() [3/3]

static void Ict.Common.Data.TTypedDataAccess.DeleteUsingTemplate ( short  ATableId,
TSearchCriteria[]  ASearchCriteria,
TDBTransaction  ATransaction 
)
inlinestaticinherited

delete all rows matching the search criteria

Parameters
ATableIdspecify which typed table is used
ASearchCriteria
ATransaction

◆ Exists()

static bool Ict.Common.Data.TTypedDataAccess.Exists ( short  ATableId,
System.Object[]  APrimaryKeyValues,
TDBTransaction  ATransaction 
)
inlinestaticinherited

check if row exists with the primary key

Parameters
ATableId
APrimaryKeyValues
ATransaction

◆ ExistsUniqueKey()

static bool Ict.Common.Data.TTypedDataAccess.ExistsUniqueKey ( short  ATableId,
System.Object[]  AUniqueKeyValues,
TDBTransaction  ATransaction 
)
inlinestaticinherited

check if row exists with the unique key

Parameters
ATableId
AUniqueKeyValues
ATransaction

◆ GenerateInsertClause()

static String Ict.Common.Data.TTypedDataAccess.GenerateInsertClause ( String  ATableName,
string[]  AColumnNames,
DataRow  ADataRow,
bool  AIncludeDefaultColumns 
)
inlinestaticinherited

This function expects an empty table that contains all existing columns, and a datarow that has a value or an empty value for each column. It will return a complete INSERT Clause.

Returns
the INSERT statement

◆ GenerateOrderByClause()

static String Ict.Common.Data.TTypedDataAccess.GenerateOrderByClause ( StringCollection  AOrderBy)
inlinestaticinherited

This function expects a list of string, where the first string is either "order by" or "group by", and the rest of the string is e.g. "p_partner.p_partner_key_n ASC" It will return the appropriate part of the sql query

Parameters
AOrderByString list with instructions how to order or group the result
Returns
the order by / group by clause

◆ GenerateSelectClause()

static String Ict.Common.Data.TTypedDataAccess.GenerateSelectClause ( StringCollection  AFieldList,
short  ATableID,
bool  AIncludeTableNames = false 
)
inlinestaticinherited

This function expects a StringCollection that can be filled, empty or nil. It also needs the list of the primary key columns, because otherwise the returned row will fail the constraints. It will return a proper Select Clause.

Returns
the Select Clause

◆ GenerateSelectClauseLong()

static String Ict.Common.Data.TTypedDataAccess.GenerateSelectClauseLong ( String  ATableName,
StringCollection  AFieldList,
short  ATableId 
)
inlinestaticinherited

This function expects a StringCollection that can be filled, empty or nil. It also needs the list of the primary key columns, because otherwise the returned row will fail the constraints. It will prefix all fields with the given tablename. needed for selecting from join statements. It will return a proper Select Clause. If a field has already a dot in the name, the ATablename is not put before it: That way you can do SUM(PUB_table.p_something).

Returns
the Select Clause

◆ GenerateUpdateClause()

static String Ict.Common.Data.TTypedDataAccess.GenerateUpdateClause ( String  ATableName,
string[]  AColumnNames,
DataRow  ADataRow,
int[]  APrimKeyColumnOrdList 
)
inlinestaticinherited

This function expects an empty table that contains all existing columns, and a datarow that has a value or an empty value for each column.

Returns
the UPDATE statement

◆ GenerateWhereClause() [1/3]

static String Ict.Common.Data.TTypedDataAccess.GenerateWhereClause ( string[]  AColumnNames,
DataRow  ADataRow 
)
inlinestaticinherited

This function expects an empty table that contains all existing columns, and a datarow that has a string or an empty value for each column. It will return a Where clause, using the given values.

Returns
the Where Clause

◆ GenerateWhereClause() [2/3]

static String Ict.Common.Data.TTypedDataAccess.GenerateWhereClause ( string[]  AColumnNames,
DataRow  ADataRow,
StringCollection  ATemplateOperators 
)
inlinestaticinherited

This function expects an empty table that contains all existing columns, and a datarow that has a string or an empty value for each column. It will return a Where clause, using the given values.

Parameters
AColumnNamesthe column names
ADataRowthe data row with the the columns for the where clause
ATemplateOperatorsEvery template field can have an operator; the default version always used = or LIKE
Returns
the Where Clause

◆ GenerateWhereClause() [3/3]

static String Ict.Common.Data.TTypedDataAccess.GenerateWhereClause ( TSearchCriteria[]  ASearchCriteria)
inlinestaticinherited

This function expects an empty table that contains all existing columns, and search criteria. It will return a Where clause, using the given values.

Parameters
ASearchCriteria
Returns
the Where Clause

◆ GenerateWhereClauseFromPrimaryKey()

static String Ict.Common.Data.TTypedDataAccess.GenerateWhereClauseFromPrimaryKey ( short  ATableId)
inlinestaticinherited

this function generates a where clause for the primary key of the given table

Parameters
ATableId
Returns

◆ GenerateWhereClauseFromUniqueKey()

static String Ict.Common.Data.TTypedDataAccess.GenerateWhereClauseFromUniqueKey ( short  ATableId)
inlinestaticinherited

this function generates a where clause for the unique key of the given table

Parameters
ATableId
Returns

◆ GenerateWhereClauseLong() [1/3]

static String Ict.Common.Data.TTypedDataAccess.GenerateWhereClauseLong ( String  ATableName,
short  ATableId,
DataRow  ADataRow 
)
inlinestaticinherited

This function expects a string array with the names of all existing columns, and a datarow that has a value or an empty value for each column. It will return a Where clause, using the given values. It does not contain the WHERE keyword. It uses the long form, table.fieldname

Parameters
ATableNamethe table that the where clause is generated for
ATableIdid of the table to get the list of all columns of that table
ADataRowcontains the values for the where clause
Returns
the Where Clause

◆ GenerateWhereClauseLong() [2/3]

static String Ict.Common.Data.TTypedDataAccess.GenerateWhereClauseLong ( String  ATableName,
short  ATableId,
DataRow  ADataRow,
StringCollection  ATemplateOperators 
)
inlinestaticinherited

This function expects a string list of all existing columns, and a datarow that has a value or an empty value for each column. It will return a Where clause, using the given values. It does not contain the WHERE keyword. It uses the long form, table.fieldname

Parameters
ATableNamethe table that the where clause is generated for
ATableIdid of the table to get the list of all columns of that table
ADataRowcontains the values for the where clause
ATemplateOperatorsEvery template field can have an operator; the default version always used = or LIKE
Returns
the Where Clause

◆ GenerateWhereClauseLong() [3/3]

static String Ict.Common.Data.TTypedDataAccess.GenerateWhereClauseLong ( String  ATableName,
TSearchCriteria[]  ASearchCriteria 
)
inlinestaticinherited

This function expects a string list of all existing columns, and a criteria list of values to search for. It will return a Where clause, using the given values. It does not contain the WHERE keyword. It uses the long form, table.fieldname

Parameters
ATableNamethe table that the where clause is generated for
ASearchCriteria
Returns
the Where Clause

◆ GetParametersForDeleteClause()

static OdbcParameter[] Ict.Common.Data.TTypedDataAccess.GetParametersForDeleteClause ( short  ATableId,
DataRow  ADataRow,
int[]  APrimaryKeyColumnOrd 
)
inlinestaticinherited

This function provides the actual parameters for the GenerateDeleteClause it uses the OriginalVersion of the primary key values

Parameters
ATableId
ADataRowvalues that are used as parameters
APrimaryKeyColumnOrdhas the order numbers of the columns that make up the primary key
Returns
an array of OdbcParameters

◆ GetParametersForInsertClause()

static List< OdbcParameter > Ict.Common.Data.TTypedDataAccess.GetParametersForInsertClause ( short  ATableId,
ref DataRow  ADataRow,
Int32  ANumberDBColumns,
String  ACurrentUser,
bool  AIncludeDefaultColumns 
)
inlinestaticinherited

This function provides the actual parameters for the GenerateInsertClause uses only the values that are not DBNULL adds the next modification ID

Parameters
ATableId
ADataRowvalues that are used as parameters
ANumberDBColumnsthe number of columns of this row that should be stored in the database; that allows some columns to be added temporarily, e.g. PPartnerLocation.BestAddress in PartnerEdit Dataset
ACurrentUserfor setting modified by
AIncludeDefaultColumnsonly useful when saving many rows in one query
Returns
an array of OdbcParameters

◆ GetParametersForUpdateClause()

static OdbcParameter[] Ict.Common.Data.TTypedDataAccess.GetParametersForUpdateClause ( short  ATableId,
ref DataRow  ADataRow,
int[]  APrimaryKeyColumnOrd,
Int32  ANumberDBColumns,
String  ACurrentUser 
)
inlinestaticinherited

This function provides the actual parameters for the GenerateUpdateClause uses only the values that are changed (comparing the current and the original version of the row)

Parameters
ATableId
ADataRowvalues that are used as parameters
APrimaryKeyColumnOrdcan be empty; is needed for the UPDATE WHERE statement; it has the order numbers of the columns that make up the primary key
ANumberDBColumnsthe number of columns of this row that should be stored in the database; that allows some columns to be added temporarily, e.g. PPartnerLocation.BestAddress in PartnerEdit Dataset
ACurrentUserfor setting modified by
Returns
an array of OdbcParameters

◆ GetParametersForWhereClause() [1/2]

static OdbcParameter[] Ict.Common.Data.TTypedDataAccess.GetParametersForWhereClause ( short  ATableId,
DataRow  ADataRow 
)
inlinestaticinherited

This function provides the actual parameters for the GenerateWhereClause uses only the values that are not DBNULL

Returns
an array of OdbcParameters

◆ GetParametersForWhereClause() [2/2]

static OdbcParameter[] Ict.Common.Data.TTypedDataAccess.GetParametersForWhereClause ( short  ATableNumber,
TSearchCriteria[]  ASearchCriteria 
)
inlinestaticinherited

This function provides the actual parameters for the GenerateWhereClause

Returns
an array of OdbcParameters

◆ GetParametersForWhereClauseWithPrimaryKey()

static OdbcParameter[] Ict.Common.Data.TTypedDataAccess.GetParametersForWhereClauseWithPrimaryKey ( short  ATableId,
DataRow  ADataRow 
)
inlinestaticinherited

This function provides the actual parameters for the GenerateWhereClause uses only the values that are not DBNULL

Parameters
ADataRowvalues that are used as parameters
ATableIdidentifier of the table to get the primary key from it
Returns
an array of OdbcParameters

◆ GetSafeValue() [1/2]

static System.Object Ict.Common.Data.TTypedDataAccess.GetSafeValue ( DataRow  ADataRow,
String  AColumnName,
DataRowVersion  AVersion 
)
inlinestaticinherited

This function returns either a valid object or System.DBNull; this is necessary because mono sometimes has a nil pointer in the DataRow for the original version etc.

Returns
either a valid object or System.DBNull

◆ GetSafeValue() [2/2]

static System.Object Ict.Common.Data.TTypedDataAccess.GetSafeValue ( DataRow  ADataRow,
System.Int32  AColumnNr,
DataRowVersion  AVersion 
)
inlinestaticinherited

This function returns either a valid object or System.DBNull; this is necessary because mono sometimes has a nil pointer in the DataRow for the original version etc.

Returns
either a valid object or System.DBNull

◆ GetStoredModification()

static void Ict.Common.Data.TTypedDataAccess.GetStoredModification ( short  ATableId,
string[]  AColumnNames,
int[]  APrimKeyColumnOrdList,
DataRow  ADataRow,
DB.TDBTransaction  ATransaction,
out DateTime  AModificationID,
out String  AModifiedBy,
out System.DateTime  AModifiedDate,
bool  ATreatRowAsAdded = false 
)
inlinestaticinherited

This function returns the modification details of a row

Returns
void

◆ InsertRow() [1/2]

static void Ict.Common.Data.TTypedDataAccess.InsertRow ( short  ATableId,
ref DataRow  ADataRow,
String  ACurrentUser,
StringBuilder  AInsertStatement,
List< OdbcParameter >  AInsertParameters 
)
inlinestaticinherited

This function is called by the DataStore (SubmitChanges). it will not update the modification id.

◆ InsertRow() [2/2]

static void Ict.Common.Data.TTypedDataAccess.InsertRow ( short  ATableId,
ref DataRow  ADataRow,
TDBTransaction  ATransaction,
String  ACurrentUser,
bool  ATreatRowAsAdded 
)
inlinestaticinherited

This function is called by the DataStore (SubmitChanges). it will update the modification id.

◆ LoadByPrimaryKey() [1/2]

static DataRow Ict.Common.Data.TTypedDataAccess.LoadByPrimaryKey ( short  ATableId,
DataSet  ADataSet,
System.Object[]  APrimaryKeyValues,
StringCollection  AFieldList,
TDBTransaction  ATransaction,
StringCollection  AOrderBy,
int  AStartRecord,
int  AMaxRecords 
)
inlinestaticinherited

load data row by primary key into a dataset

Parameters
ATableId
ADataSet
APrimaryKeyValues
AFieldList
ATransaction
AOrderBy
AStartRecord
AMaxRecords

◆ LoadByPrimaryKey() [2/2]

static DataRow Ict.Common.Data.TTypedDataAccess.LoadByPrimaryKey ( short  ATableId,
TTypedDataTable  ADataTable,
System.Object[]  APrimaryKeyValues,
StringCollection  AFieldList,
TDBTransaction  ATransaction,
StringCollection  AOrderBy,
int  AStartRecord,
int  AMaxRecords 
)
inlinestaticinherited

different version for data table

◆ LoadByUniqueKey() [1/2]

static void Ict.Common.Data.TTypedDataAccess.LoadByUniqueKey ( short  ATableId,
DataSet  ADataSet,
System.Object[]  AUniqueKeyValues,
StringCollection  AFieldList,
TDBTransaction  ATransaction,
StringCollection  AOrderBy,
int  AStartRecord,
int  AMaxRecords 
)
inlinestaticinherited

load data row by unique key into a dataset

Parameters
ATableId
ADataSet
AUniqueKeyValues
AFieldList
ATransaction
AOrderBy
AStartRecord
AMaxRecords

◆ LoadByUniqueKey() [2/2]

static void Ict.Common.Data.TTypedDataAccess.LoadByUniqueKey ( short  ATableId,
TTypedDataTable  ADataTable,
System.Object[]  AUniqueKeyValues,
StringCollection  AFieldList,
TDBTransaction  ATransaction,
StringCollection  AOrderBy,
int  AStartRecord,
int  AMaxRecords 
)
inlinestaticinherited

different version for data table

◆ LoadUsingTemplate() [1/4]

static void Ict.Common.Data.TTypedDataAccess.LoadUsingTemplate ( short  ATableId,
DataSet  ADataSet,
DataRow  ATemplateRow,
StringCollection  ATemplateOperators,
StringCollection  AFieldList,
TDBTransaction  ATransaction,
StringCollection  AOrderBy,
int  AStartRecord,
int  AMaxRecords 
)
inlinestaticinherited

load using a template row

◆ LoadUsingTemplate() [2/4]

static void Ict.Common.Data.TTypedDataAccess.LoadUsingTemplate ( short  ATableID,
DataSet  ADataSet,
TSearchCriteria[]  ASearchCriteria,
StringCollection  AFieldList,
TDBTransaction  ATransaction,
StringCollection  AOrderBy,
int  AStartRecord,
int  AMaxRecords 
)
inlinestaticinherited

loads all rows matching certain search criteria into a dataset

Parameters
ATableIDspecify which typed table is used
ADataSetthe result will be added to this dataset
ASearchCriteria
AFieldListfields to load from the database table
ATransaction
AOrderBy
AStartRecord
AMaxRecords

◆ LoadUsingTemplate() [3/4]

static void Ict.Common.Data.TTypedDataAccess.LoadUsingTemplate ( short  ATableId,
TTypedDataTable  ADataTable,
DataRow  ATemplateRow,
StringCollection  ATemplateOperators,
StringCollection  AFieldList,
TDBTransaction  ATransaction,
StringCollection  AOrderBy,
int  AStartRecord,
int  AMaxRecords 
)
inlinestaticinherited

load using a template row

◆ LoadUsingTemplate() [4/4]

static void Ict.Common.Data.TTypedDataAccess.LoadUsingTemplate ( short  ATableID,
TTypedDataTable  ATypedTableToLoad,
TSearchCriteria[]  ASearchCriteria,
StringCollection  AFieldList,
TDBTransaction  ATransaction,
StringCollection  AOrderBy,
int  AStartRecord,
int  AMaxRecords 
)
inlinestaticinherited

loads all rows matching certain search criteria into a typed data table

Parameters
ATableIDspecify which typed table is used
ATypedTableToLoadpre condition: has to have an object of the typed table
ASearchCriteria
AFieldList
ATransaction
AOrderBy
AStartRecord
AMaxRecords

◆ LoadViaForeignKey() [1/6]

static void Ict.Common.Data.TTypedDataAccess.LoadViaForeignKey ( short  ATableId,
short  AOtherTableId,
DataSet  ADataSet,
string[]  AThisFieldNames,
DataRow  ATemplateRow,
StringCollection  ATemplateOperators,
StringCollection  AFieldList,
TDBTransaction  ATransaction,
StringCollection  AOrderBy,
int  AStartRecord,
int  AMaxRecords 
)
inlinestaticinherited

Load via other table, using template values.

◆ LoadViaForeignKey() [2/6]

static void Ict.Common.Data.TTypedDataAccess.LoadViaForeignKey ( short  ATableId,
short  AOtherTableId,
DataSet  ADataSet,
string[]  AThisFieldNames,
System.Object[]  AForeignKeyValues,
StringCollection  AFieldList,
TDBTransaction  ATransaction,
StringCollection  AOrderBy,
int  AStartRecord,
int  AMaxRecords 
)
inlinestaticinherited

load data for the current table via a foreign key, eg. load all extracts created by user x

◆ LoadViaForeignKey() [3/6]

static void Ict.Common.Data.TTypedDataAccess.LoadViaForeignKey ( short  ATableId,
short  AOtherTableId,
DataSet  ADataSet,
string[]  AThisFieldNames,
TSearchCriteria[]  ASearchCriteria,
StringCollection  AFieldList,
TDBTransaction  ATransaction,
StringCollection  AOrderBy,
int  AStartRecord,
int  AMaxRecords 
)
inlinestaticinherited

Load via other table, using template values.

◆ LoadViaForeignKey() [4/6]

static void Ict.Common.Data.TTypedDataAccess.LoadViaForeignKey ( short  ATableId,
short  AOtherTableId,
TTypedDataTable  ADataTable,
string[]  AThisFieldNames,
DataRow  ATemplateRow,
StringCollection  ATemplateOperators,
StringCollection  AFieldList,
TDBTransaction  ATransaction,
StringCollection  AOrderBy,
int  AStartRecord,
int  AMaxRecords 
)
inlinestaticinherited

Load via other table, using template values.

◆ LoadViaForeignKey() [5/6]

static void Ict.Common.Data.TTypedDataAccess.LoadViaForeignKey ( short  ATableId,
short  AOtherTableId,
TTypedDataTable  ADataTable,
string[]  AThisFieldNames,
System.Object[]  AForeignKeyValues,
StringCollection  AFieldList,
TDBTransaction  ATransaction,
StringCollection  AOrderBy,
int  AStartRecord,
int  AMaxRecords 
)
inlinestaticinherited

load data for the current table via a foreign key, eg. load all extracts created by user x

◆ LoadViaForeignKey() [6/6]

static void Ict.Common.Data.TTypedDataAccess.LoadViaForeignKey ( short  ATableId,
short  AOtherTableId,
TTypedDataTable  ADataTable,
string[]  AThisFieldNames,
TSearchCriteria[]  ASearchCriteria,
StringCollection  AFieldList,
TDBTransaction  ATransaction,
StringCollection  AOrderBy,
int  AStartRecord,
int  AMaxRecords 
)
inlinestaticinherited

Load via other table, using template values.

◆ NoDefaultColumn()

static bool Ict.Common.Data.TTypedDataAccess.NoDefaultColumn ( String  AColumnName)
inlinestaticinherited

This function returns true if the column name is not one of the special columns, that are written automatically: modified date and by, created date and by, modification id

Returns
true if this is no special auto column

◆ NotEquals()

static bool Ict.Common.Data.TTypedDataAccess.NotEquals ( DataRow  ADataRow,
System.Int32  AColumnNr,
ref System.Object  ACurrentValue 
)
inlinestaticinherited

Compare the original and the current value of a column in a datarow. Make sure some mono specific troubles are worked around.

Returns
result of comparison

◆ SubmitChanges() [1/4]

static void Ict.Common.Data.TTypedDataAccess.SubmitChanges ( TTypedDataTable  ATable,
TDBTransaction  ATransaction,
eSubmitChangesOperations  ASelectedOperations,
string  AUserId 
)
inlinestaticinherited

overloaded version without sequence, but with ASelectedOperations

◆ SubmitChanges() [2/4]

static void Ict.Common.Data.TTypedDataAccess.SubmitChanges ( TTypedDataTable  ATable,
TDBTransaction  ATransaction,
eSubmitChangesOperations  ASelectedOperations,
string  AUserId,
string  ASequenceName,
string  ASequenceField 
)
inlinestaticinherited

submit those rows in the table that have been modified or created or deleted

Parameters
ATable
ATransaction
ASelectedOperations
AUserIdthe current user, for auditing
ASequenceName
ASequenceField
Returns

◆ SubmitChanges() [3/4]

static void Ict.Common.Data.TTypedDataAccess.SubmitChanges ( TTypedDataTable  ATable,
TDBTransaction  ATransaction,
string  AUserId 
)
inlinestaticinherited

overloaded version without sequence

◆ SubmitChanges() [4/4]

static void Ict.Common.Data.TTypedDataAccess.SubmitChanges ( TTypedDataTable  ATable,
TDBTransaction  ATransaction,
string  AUserId,
string  ASequenceName,
string  ASequenceField 
)
inlinestaticinherited

overloaded version without ASelectedOperations

◆ UpdateRow()

static void Ict.Common.Data.TTypedDataAccess.UpdateRow ( short  ATableId,
bool  AThrowAwayAfterSubmitChanges,
ref DataRow  ADataRow,
DB.TDBTransaction  ATransaction,
String  ACurrentUser 
)
inlinestaticinherited

This function is called by the DataStore (SubmitChanges)

Returns
void

Member Data Documentation

◆ CREATED_BY

const string Ict.Common.Data.TTypedDataAccess.CREATED_BY = "s_created_by_c"
staticinherited

who has originally created this row

◆ CREATED_DATE

const string Ict.Common.Data.TTypedDataAccess.CREATED_DATE = "s_date_created_d"
staticinherited

when was this row originally created

◆ MODIFICATION_ID

const string Ict.Common.Data.TTypedDataAccess.MODIFICATION_ID = "s_modification_id_t"
staticinherited

name of the column used for tracking changes, one ID per change

◆ MODIFICATION_ID_DELETEDROW_INDICATOR

readonly DateTime Ict.Common.Data.TTypedDataAccess.MODIFICATION_ID_DELETEDROW_INDICATOR = DateTime.MaxValue
staticinherited

indicates whether a row has been deleted

◆ MODIFIED_BY

const string Ict.Common.Data.TTypedDataAccess.MODIFIED_BY = "s_modified_by_c"
staticinherited

who has last modified the row

◆ MODIFIED_DATE

const string Ict.Common.Data.TTypedDataAccess.MODIFIED_DATE = "s_date_modified_d"
staticinherited

when was the last change to the row


The documentation for this class was generated from the following file: