Bug fix - GetHeaderId

This commit is contained in:
Mike Phares 2024-05-22 17:58:44 -07:00
parent 5c0a3e53d3
commit 5d16251f28
3 changed files with 24 additions and 10 deletions

View File

@ -104,12 +104,14 @@ public class FileRead : Shared.FileRead, IFileRead
}
#pragma warning disable IDE0060
private static void PostOpenInsightMetrologyViewerAttachments(DateTime dateTime, List<SECS.Description> descriptions)
private static void PostOpenInsightMetrologyViewerAttachments(List<SECS.Description> descriptions)
#pragma warning restore IDE0060
{
}
#pragma warning disable IDE0060
private Tuple<string, Test[], JsonElement[], List<FileInfo>> GetExtractResult(string reportFullPath, DateTime dateTime)
#pragma warning restore IDE0060
{
Tuple<string, Test[], JsonElement[], List<FileInfo>> results;
Tuple<string, string[], string[]> pdsf = ProcessDataStandardFormat.GetLogisticsColumnsAndBody(reportFullPath);
@ -119,7 +121,7 @@ public class FileRead : Shared.FileRead, IFileRead
List<SECS.Description> descriptions = SECS.ProcessData.GetDescriptions(jsonElements);
Test[] tests = (from l in descriptions select (Test)l.Test).ToArray();
if (_IsEAFHosted && _FileConnectorConfiguration.FileScanningIntervalInSeconds > 0)
PostOpenInsightMetrologyViewerAttachments(dateTime, descriptions);
PostOpenInsightMetrologyViewerAttachments(descriptions);
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(pdsf.Item1, tests, jsonElements, new List<FileInfo>());
return results;
}

View File

@ -78,20 +78,32 @@ public partial class WS
{
foreach (Attachment attachment in headerAttachments)
{
directory = Path.GetDirectoryName(attachment.HeaderIdDirectory) ?? throw new Exception();
File.Copy(attachment.SourceFileName, Path.Combine(directory, attachment.AttachmentId, attachment.DestinationFileName), overwrite: true);
AttachFile(url, attachment);
directory = Path.Combine(Path.GetDirectoryName(attachment.HeaderIdDirectory), attachment.AttachmentId) ?? throw new Exception();
if (!Directory.Exists(directory))
_ = Directory.CreateDirectory(directory);
File.Copy(attachment.SourceFileName, Path.Combine(directory, attachment.DestinationFileName), overwrite: true);
}
}
if (dataAttachments is not null)
{
foreach (Attachment attachment in dataAttachments)
{
directory = Path.GetDirectoryName(attachment.HeaderIdDirectory) ?? throw new Exception();
File.Copy(attachment.SourceFileName, Path.Combine(directory, attachment.AttachmentId, attachment.DestinationFileName), overwrite: true);
AttachFile(url, attachment);
directory = Path.Combine(Path.GetDirectoryName(attachment.HeaderIdDirectory.Replace("Header", "Data")), attachment.AttachmentId) ?? throw new Exception();
if (!Directory.Exists(directory))
_ = Directory.CreateDirectory(directory);
File.Copy(attachment.SourceFileName, Path.Combine(directory, attachment.DestinationFileName), overwrite: true);
}
}
if (headerAttachments is not null)
{
foreach (Attachment attachment in headerAttachments)
AttachFile(url, attachment);
}
if (dataAttachments is not null)
{
foreach (Attachment attachment in dataAttachments)
AttachFile(url, attachment);
}
//MessageBox.Show(r.ToString());
}
catch (Exception e)

View File

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.52.0.0")]
[assembly: AssemblyFileVersion("2.52.0.0")]
[assembly: AssemblyVersion("2.56.0.0")]
[assembly: AssemblyFileVersion("2.56.0.0")]