示例#1
0
        public void Process()
        {
            if (_table.AreAnyGeneratorsActive)
            {
                Table  table = _dataGenerationService.GenerateDataForTable(_connectionString, _table, true);
                string sql   = _sqlGenerationService.GenerateUpdateSqlForTable(table, false);

                if (String.IsNullOrEmpty(sql) == false)
                {
                    _eventAggregator.SendMessage <StatusUpdateEvent>(new StatusUpdateEvent(string.Format("Processing SQL query for table: {0}", table.FullTableName)));

                    try
                    {
                        _rowsProcessed = _databaseInteractionService.ProcessSql(_connectionString, sql);
                    }
                    catch (Exception ex)
                    {
                        _errorString = ex.ToString();
                    }
                }
            }
        }
示例#2
0
        public ObfuscationResult ObfuscateTable(ConnectionString connectionString, Table table)
        {
            ObfuscationResult result = new ObfuscationResult();

            result.DatabaseName   = connectionString.DatabaseName;
            result.StartTimeStamp = DateTime.Now;

            if (table.AreAnyGeneratorsActive)
            {
                Table  newTable = _dataGenerationService.GenerateDataForTable(connectionString, table, true);
                string sql      = _sqlGenerationService.GenerateUpdateSqlForTable(newTable, false);

                if (String.IsNullOrEmpty(sql) == false)
                {
                    _eventAggregator.SendMessage <StatusUpdateEvent>(new StatusUpdateEvent(string.Format("Processing SQL query for table: {0}", table.FullTableName)));
                    int rowsProcessed = _databaseInteractionService.ProcessSql(connectionString, sql);

                    result.TablesProcessed.Add(table.FullTableName, rowsProcessed);
                }
            }

            result.FinsihedTimeStamp = DateTime.Now;
            return(result);
        }