|
@@ -18,6 +18,7 @@ using System.Reflection;
|
|
|
using System.Collections.Immutable;
|
|
|
using StagingManufacturingPacketComponent = Comal.Classes.StagingManufacturingPacketComponent;
|
|
|
using System.Threading.Tasks;
|
|
|
+using System.Windows.Media.Imaging;
|
|
|
using Columns = InABox.Core.Columns;
|
|
|
using MemoryStream = System.IO.MemoryStream;
|
|
|
|
|
@@ -257,32 +258,37 @@ public partial class StagingPanel : UserControl, IPanel<StagingSetout>
|
|
|
private void ClearDocuments()
|
|
|
{
|
|
|
Document = null;
|
|
|
- RenderDocument(null);
|
|
|
+ RenderDocuments(null);
|
|
|
}
|
|
|
|
|
|
- private byte[]? GetDocuments(StagingSetoutDocument? document)
|
|
|
+ private List<byte[]> GetDocuments(StagingSetoutDocument? document)
|
|
|
{
|
|
|
if(document is null)
|
|
|
- {
|
|
|
- return null;
|
|
|
- }
|
|
|
+ return new List<byte[]>();
|
|
|
var table = new Client<Document>().Query(
|
|
|
new Filter<Document>(x => x.ID).IsEqualTo(document.DocumentLink.ID),
|
|
|
Columns.None<Document>().Add(x => x.Data));
|
|
|
var first = table.Rows.FirstOrDefault();
|
|
|
if (first is null)
|
|
|
- return null;
|
|
|
+ return new List<byte[]>();
|
|
|
_documentdata = first.Get<Document, byte[]>(x => x.Data);
|
|
|
- return _documentdata; //ImageUtils.RenderPDFToImageBytes(_documentdata);
|
|
|
+ return ImageUtils.RenderPDFToImageBytes(_documentdata);
|
|
|
}
|
|
|
|
|
|
- private void RenderDocument(byte[]? document)
|
|
|
+ private void RenderDocuments(List<byte[]>? documents)
|
|
|
{
|
|
|
- if (document is null)
|
|
|
- return;
|
|
|
- using (var ms = new MemoryStream(document))
|
|
|
- Viewer.Load(ms);
|
|
|
-
|
|
|
+ List<BitmapImage> _images = new List<BitmapImage>();
|
|
|
+ //DocumentViewer.Children.Clear();
|
|
|
+ if(documents is not null)
|
|
|
+ {
|
|
|
+ foreach (var document in documents)
|
|
|
+ {
|
|
|
+ var image = ImageUtils.LoadImage(document);
|
|
|
+ if (image is not null)
|
|
|
+ _images.Add(image);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ DocumentViewer.ItemsSource = _images;
|
|
|
}
|
|
|
|
|
|
private void ProcessButton_Click(object sender, RoutedEventArgs e)
|
|
@@ -814,7 +820,7 @@ public partial class StagingPanel : UserControl, IPanel<StagingSetout>
|
|
|
DocumentMode.Locked;
|
|
|
|
|
|
docTask.Wait();
|
|
|
- RenderDocument(docTask.Result);
|
|
|
+ RenderDocuments(docTask.Result);
|
|
|
|
|
|
SetMode(mode);
|
|
|
}
|