Skip to content

Commit

Permalink
Add Integration - Column mapping - None | Add Conditions handling sup…
Browse files Browse the repository at this point in the history
…porting Groups
  • Loading branch information
DWDBE committed Aug 1, 2024
1 parent c56c743 commit 222222e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Version>10.6.0</Version>
<Version>10.6.1</Version>
<AssemblyVersion>1.0.0</AssemblyVersion>
<Title>Excel Provider</Title>
<Description>Excel Provider</Description>
Expand Down
8 changes: 4 additions & 4 deletions src/ExcelDestinationWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,14 @@ public virtual void Write(Dictionary<string, object> 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);
}
Expand Down
9 changes: 1 addition & 8 deletions src/ExcelSourceReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, object> GetNext()
Expand Down

0 comments on commit 222222e

Please sign in to comment.