Beispiel #1
0
        public LogSQLBuilder(LogInfo logInfo, DataRow srcRow, DataTable srcSchema, KeyItems srcKeysList)
        {
            _srcRow = srcRow;
            _srcSchema = srcSchema;
            _logInfo = logInfo;
            _keysList = srcKeysList;

            _columnsBuilder = new StringBuilder();
            _valuesBuilder = new StringBuilder();
        }
Beispiel #2
0
 public Boolean Log(DataRow srcRow, DataTable srcSchema, IDbConnection connection, KeyItems srcKeysList)
 {
     return Log(srcRow, srcSchema, connection, null, srcKeysList);
 }
Beispiel #3
0
        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;
        }
Beispiel #4
0
 /// <summary>
 /// Initializes a new instance of the InfoCommand class.
 /// </summary>
 public InfoCommand()
 {
     InitializeComponent();
     keyFields = new KeyItems(this, typeof(KeyItem));
     EncodingBefore = "Windows-1252";
 }