Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Version>10.9.0</Version>
<Version>10.9.1</Version>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<Title>Dynamicweb Provider</Title>
<Description>Dynamicweb Provider</Description>
Expand Down
8 changes: 8 additions & 0 deletions src/DynamicwebBulkInsertDestinationWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ public DynamicwebBulkInsertDestinationWriter(Mapping mapping, SqlCommand mockSql
if (!string.IsNullOrEmpty(userNumber))
{
userIDs = ExistingUsers.Select("AccessUserCustomerNumber='" + userNumber.Replace("'", "''") + "'").Select(r => r["AccessUserID"].ToString()).ToList();
dataRow["AssortmentPermissionCustomerNumber"] = userNumber;
}
}
var externalIdmapping = columnMappings.Find(cm => cm.DestinationColumn.Name == "AssortmentPermissionExternalID");
Expand All @@ -202,6 +203,7 @@ public DynamicwebBulkInsertDestinationWriter(Mapping mapping, SqlCommand mockSql
if (!string.IsNullOrEmpty(externalId))
{
userIDs.AddRange(ExistingUsers.Select("AccessUserExternalID='" + externalId.Replace("'", "''") + "'").Select(r => r["AccessUserID"].ToString()));
dataRow["AssortmentPermissionExternalID"] = externalId;
}
}
var userIdMapping = columnMappings.Find(cm => cm.DestinationColumn.Name == "AssortmentPermissionAccessUserID");
Expand All @@ -211,8 +213,14 @@ public DynamicwebBulkInsertDestinationWriter(Mapping mapping, SqlCommand mockSql
if (!string.IsNullOrEmpty(id))
{
userIDs.AddRange(ExistingUsers.Select("AccessUserID='" + id.Replace("'", "''") + "'").Select(r => r["AccessUserID"].ToString()));
dataRow["AssortmentPermissionAccessUserID"] = id;
}
}
dataRow["AssortmentPermissionAssortmentID"] = assortmentID;
if (discardDuplicates && duplicateRowsHandler.IsRowDuplicate(columnMappings.Where(cm => cm.Active), Mapping, dataRow, row))
{
return;
}
foreach (string userID in userIDs.Distinct())
{
DataRow relation = TableToWrite.NewRow();
Expand Down
4 changes: 2 additions & 2 deletions src/DynamicwebProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
xmlTextWriter.WriteElementString("Shop", Shop);
xmlTextWriter.WriteElementString("DeleteProductsAndGroupForSpecificLanguage", DeleteProductsAndGroupForSpecificLanguage.ToString(CultureInfo.CurrentCulture));
xmlTextWriter.WriteElementString("DefaultLanguage", DefaultLanguage);
xmlTextWriter.WriteElementString("RepositoriesIndexUpdate", RepositoriesIndexUpdate);

Check warning on line 229 in src/DynamicwebProvider.cs

View workflow job for this annotation

GitHub Actions / call-workflow / Build

'DynamicwebProvider.RepositoriesIndexUpdate' is obsolete: 'Use Job.RepositoriesIndexSettings'

Check warning on line 229 in src/DynamicwebProvider.cs

View workflow job for this annotation

GitHub Actions / call-workflow / Build

'DynamicwebProvider.RepositoriesIndexUpdate' is obsolete: 'Use Job.RepositoriesIndexSettings'
xmlTextWriter.WriteElementString("DiscardDuplicates", DiscardDuplicates.ToString(CultureInfo.CurrentCulture));
xmlTextWriter.WriteElementString("HideDeactivatedProducts", HideDeactivatedProducts.ToString(CultureInfo.CurrentCulture));
xmlTextWriter.WriteElementString("SkipFailingRows", SkipFailingRows.ToString(CultureInfo.CurrentCulture));
Expand Down Expand Up @@ -329,7 +329,7 @@
case "RepositoriesIndexUpdate":
if (node.HasChildNodes)
{
RepositoriesIndexUpdate = node.FirstChild.Value;

Check warning on line 332 in src/DynamicwebProvider.cs

View workflow job for this annotation

GitHub Actions / call-workflow / Build

'DynamicwebProvider.RepositoriesIndexUpdate' is obsolete: 'Use Job.RepositoriesIndexSettings'

Check warning on line 332 in src/DynamicwebProvider.cs

View workflow job for this annotation

GitHub Actions / call-workflow / Build

'DynamicwebProvider.RepositoriesIndexUpdate' is obsolete: 'Use Job.RepositoriesIndexSettings'
}
break;
case "DiscardDuplicates":
Expand Down Expand Up @@ -435,8 +435,8 @@
Table ecomAssortmentPermissionsTable = result.GetTables().Find(t => t.Name == "EcomAssortmentPermissions");
if (ecomAssortmentPermissionsTable != null)
{
ecomAssortmentPermissionsTable.AddColumn(new SqlColumn(("AssortmentPermissionCustomerNumber"), typeof(string), SqlDbType.NVarChar, ecomAssortmentPermissionsTable, -1, false, false, true));
ecomAssortmentPermissionsTable.AddColumn(new SqlColumn(("AssortmentPermissionExternalID"), typeof(string), SqlDbType.NVarChar, ecomAssortmentPermissionsTable, -1, false, false, true));
ecomAssortmentPermissionsTable.AddColumn(new SqlColumn(("AssortmentPermissionCustomerNumber"), typeof(string), SqlDbType.NVarChar, ecomAssortmentPermissionsTable, -1, false, true, true));
ecomAssortmentPermissionsTable.AddColumn(new SqlColumn(("AssortmentPermissionExternalID"), typeof(string), SqlDbType.NVarChar, ecomAssortmentPermissionsTable, -1, false, true, true));
}
return result;
}
Expand Down Expand Up @@ -704,15 +704,15 @@

private void MoveRepositoriesIndexToJob(Job job)
{
if (!string.IsNullOrEmpty(RepositoriesIndexUpdate))

Check warning on line 707 in src/DynamicwebProvider.cs

View workflow job for this annotation

GitHub Actions / call-workflow / Build

'DynamicwebProvider.RepositoriesIndexUpdate' is obsolete: 'Use Job.RepositoriesIndexSettings'

Check warning on line 707 in src/DynamicwebProvider.cs

View workflow job for this annotation

GitHub Actions / call-workflow / Build

'DynamicwebProvider.RepositoriesIndexUpdate' is obsolete: 'Use Job.RepositoriesIndexSettings'
{
char[] separator = [','];
// if the provider already have RepositoriesIndexUpdate set, then we move them to the job, and set the add-in to string.empty
if (job.RepositoriesIndexSettings?.RepositoriesIndexes?.Count == 0)
{
job.RepositoriesIndexSettings = new RepositoriesIndexSettings(new Collection<string>([.. RepositoriesIndexUpdate.Split(separator, StringSplitOptions.RemoveEmptyEntries)]));

Check warning on line 713 in src/DynamicwebProvider.cs

View workflow job for this annotation

GitHub Actions / call-workflow / Build

'DynamicwebProvider.RepositoriesIndexUpdate' is obsolete: 'Use Job.RepositoriesIndexSettings'

Check warning on line 713 in src/DynamicwebProvider.cs

View workflow job for this annotation

GitHub Actions / call-workflow / Build

'DynamicwebProvider.RepositoriesIndexUpdate' is obsolete: 'Use Job.RepositoriesIndexSettings'
}
RepositoriesIndexUpdate = string.Empty;

Check warning on line 715 in src/DynamicwebProvider.cs

View workflow job for this annotation

GitHub Actions / call-workflow / Build

'DynamicwebProvider.RepositoriesIndexUpdate' is obsolete: 'Use Job.RepositoriesIndexSettings'

Check warning on line 715 in src/DynamicwebProvider.cs

View workflow job for this annotation

GitHub Actions / call-workflow / Build

'DynamicwebProvider.RepositoriesIndexUpdate' is obsolete: 'Use Job.RepositoriesIndexSettings'
job.Save();
}
}
Expand Down
Loading