QueryDC, QueryView.xaml.cs - Druck von QueryDC.Attachments

This commit is contained in:
2024-02-07 13:20:16 +01:00
parent dd6ef407c1
commit c2f6e0b191
2 changed files with 18 additions and 0 deletions

View File

@@ -30,6 +30,8 @@ using DevExpress.Xpf.Grid;
using BeWo.Core.Service;
using BeWo.ViewModel;
using Microsoft.Win32;
using System.Text;
using DevExpress.XtraReports.UI;
namespace BeWo.View.Detail.Report
{
@@ -1065,7 +1067,20 @@ namespace BeWo.View.Detail.Report
if (sf.ShowDialog() != true)
return;
if (result.Attachments != null)
{
var directoryName = Path.GetDirectoryName(sf.FileName);
foreach (var item in result.Attachments)
{
var pdfFilename = Path.Combine(directoryName, item.FileName);
File.WriteAllBytes(pdfFilename, item.BinaryData);
}
}
BeWoUtils.WriteFile(result.QueryResult, sf.FileName);
}));
}
else

View File

@@ -38,5 +38,8 @@ namespace BS.Shared.DataContracts
[DataMember]
public string QueryResult { get; set; }
[DataMember]
public List<FileAttachmentDC> Attachments { get; set; }
}
}