QueryDC, QueryView.xaml.cs - Druck von QueryDC.Attachments
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -38,5 +38,8 @@ namespace BS.Shared.DataContracts
|
||||
|
||||
[DataMember]
|
||||
public string QueryResult { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public List<FileAttachmentDC> Attachments { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user