Skip to content
Open
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
4 changes: 2 additions & 2 deletions src/OmniaMigrationTool/Services/ExportBlobsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ private async Task Process(string outputPath)
{
var file = (CloudBlockBlob) listBlobItem;
var fileName = GetFileName("Binary", file.Name);
var destinationFile = Path.Combine(outputPath, $"files/{fileName}");
fileName = fileName.Replace(":", "%3A");
var destinationFile = Path.Combine(outputPath, $"files\\{fileName}");
Console.WriteLine("Downloading file {0}", fileName);

using (var encryptedMemoryStream = new MemoryStream())
Expand All @@ -70,7 +71,6 @@ private async Task Process(string outputPath)

var encryptedArray = encryptedMemoryStream.ToArray();
var decryptedStream = new MemoryStream(DecryptByteArray(encryptedArray, _encryptionKey));

await File.WriteAllBytesAsync(destinationFile, decryptedStream.ToArray());
}
}
Expand Down
6 changes: 6 additions & 0 deletions src/OmniaMigrationTool/Services/ExportService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,8 @@ object Map(object value)

case EntityMapDefinition.AttributeMap.AttributeType.Decimal:
if (value is decimal) return value;
if (value is string && value.ToString().Contains("%"))
return Convert.ToDecimal(value.ToString().Replace("%", ""));
return Convert.ToDecimal(value);

case EntityMapDefinition.AttributeMap.AttributeType.Date:
Expand All @@ -535,6 +537,10 @@ object Map(object value)
default:
if (attribute.Target.Equals("_code"))
return value.ToString().Substring(0, Math.Min(31, value.ToString().Length)); // TODO: Deal the the difference of size in codes
// Remove spaces from the IncidentCategory code
if (attribute.Target.Equals("IncidentCategory"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change shouldn't be part of this project, since it seems a scenario specific from your application.

return value.ToString().Replace(" ", "");

return value.ToString();
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/OmniaMigrationTool/Services/ImportBlobsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ private async Task Process(string mappingsFolderPath, string filesFolderPath)

for (var f = 0; f<sourceFilesNames.Length; f++)
{
var sourceFileName = sourceFilesNames[f];
var sourceFileName = sourceFilesNames[f].Replace(":", "%3A");
var targetFileName = targetFilesNames[f];
Console.Write($"Importing file: {sourceFileName}.");

var exportedFilePath = exportedFiles.FirstOrDefault(f => f.EndsWith($"\\{sourceFileName}", StringComparison.InvariantCultureIgnoreCase));
var exportedFilePath = exportedFiles.FirstOrDefault(newF => newF.EndsWith($"\\{sourceFileName}", StringComparison.InvariantCultureIgnoreCase));
if (string.IsNullOrEmpty(exportedFilePath))
{
Console.WriteLine($"File not found in exported files folder - ignored.");
Expand Down