From 222222e1aef497940e293345ee6893ca98457c2f Mon Sep 17 00:00:00 2001 From: Dmitriy Benyuk Date: Thu, 1 Aug 2024 18:01:01 +0300 Subject: [PATCH] Add Integration - Column mapping - None | Add Conditions handling supporting Groups --- ...micweb.DataIntegration.Providers.ExcelProvider.csproj | 2 +- src/ExcelDestinationWriter.cs | 8 ++++---- src/ExcelSourceReader.cs | 9 +-------- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/src/Dynamicweb.DataIntegration.Providers.ExcelProvider.csproj b/src/Dynamicweb.DataIntegration.Providers.ExcelProvider.csproj index f240fd7..72daa26 100644 --- a/src/Dynamicweb.DataIntegration.Providers.ExcelProvider.csproj +++ b/src/Dynamicweb.DataIntegration.Providers.ExcelProvider.csproj @@ -1,6 +1,6 @@  - 10.6.0 + 10.6.1 1.0.0 Excel Provider Excel Provider diff --git a/src/ExcelDestinationWriter.cs b/src/ExcelDestinationWriter.cs index 0f85d51..2c68804 100644 --- a/src/ExcelDestinationWriter.cs +++ b/src/ExcelDestinationWriter.cs @@ -90,14 +90,14 @@ public virtual void Write(Dictionary row) { if (columnMapping.HasScriptWithValue) { - if (columnMapping.SourceColumn.Type == typeof(DateTime)) + if (columnMapping.DestinationColumn.Type == typeof(DateTime)) { DateTime theDate = DateTime.Parse(columnMapping.GetScriptValue(), CultureInfo.InvariantCulture); r[columnMapping.DestinationColumn.Name] = theDate.ToString("dd-MM-yyyy HH:mm:ss:fff", _cultureInfo); } - else if (columnMapping.SourceColumn.Type == typeof(decimal) || - columnMapping.SourceColumn.Type == typeof(double) || - columnMapping.SourceColumn.Type == typeof(float)) + else if (columnMapping.DestinationColumn.Type == typeof(decimal) || + columnMapping.DestinationColumn.Type == typeof(double) || + columnMapping.DestinationColumn.Type == typeof(float)) { r[columnMapping.DestinationColumn.Name] = ValueFormatter.GetFormattedValue(columnMapping.GetScriptValue(), _cultureInfo, columnMapping.ScriptType, columnMapping.ScriptValue); } diff --git a/src/ExcelSourceReader.cs b/src/ExcelSourceReader.cs index c757b5d..976106e 100644 --- a/src/ExcelSourceReader.cs +++ b/src/ExcelSourceReader.cs @@ -131,14 +131,7 @@ public bool IsDone() private bool RowMatchesConditions() { - foreach (MappingConditional conditional in mapping.Conditionals) - { - if (!_provider.CheckCondition(conditional, nextResult)) - { - return false; - } - } - return true; + return mapping.Conditionals?.CheckConditionals(nextResult) ?? true; } public Dictionary GetNext()