Bug fix - GetHeaderId

This commit is contained in:
2024-05-22 17:57:10 -07:00
parent 67b2ddae41
commit 8b432e886d
4 changed files with 31 additions and 17 deletions

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)