public LogSQLBuilder(LogInfo logInfo, DataRow srcRow, DataTable srcSchema, KeyItems srcKeysList) { _srcRow = srcRow; _srcSchema = srcSchema; _logInfo = logInfo; _keysList = srcKeysList; _columnsBuilder = new StringBuilder(); _valuesBuilder = new StringBuilder(); }
public Boolean Log(DataRow srcRow, DataTable srcSchema, IDbConnection connection, KeyItems srcKeysList) { return Log(srcRow, srcSchema, connection, null, srcKeysList); }
public Boolean Log(DataRow srcRow, DataTable srcSchema, IDbConnection connection, IDbTransaction dbTrans, KeyItems keyList) { CheckLogField(); LogSQLBuilder logSQLBuilder = new LogSQLBuilder(this, srcRow, srcSchema, keyList); String logSQL = logSQLBuilder.GetLogSQL(connection, dbTrans); if (logSQL.Length != 0) { IDbCommand command = connection.CreateCommand(); command.CommandText = logSQL; if (dbTrans != null) { command.Transaction = dbTrans; if (command.ExecuteNonQuery() == 0) { throw new Exception(); /*return false; */} } else { if (command.ExecuteNonQuery() == 0) { return false; } } } return true; }
/// <summary> /// Initializes a new instance of the InfoCommand class. /// </summary> public InfoCommand() { InitializeComponent(); keyFields = new KeyItems(this, typeof(KeyItem)); EncodingBefore = "Windows-1252"; }