|
@@ -64,41 +64,44 @@ namespace comal.timesheets
|
|
|
x => x.JobLink.Name,
|
|
|
x => x.ManufacturingPacketLink.SetoutLink.Number,
|
|
|
x => x.ManufacturingPacketLink.SetoutLink.Description,
|
|
|
- x => x.ManufacturingPacketLink.Serial
|
|
|
+ x => x.ManufacturingPacketLink.Serial,
|
|
|
+ x => x.SetoutLink.ID
|
|
|
));
|
|
|
|
|
|
if (items.Rows.Any())
|
|
|
{
|
|
|
item = items.Rows.FirstOrDefault().ToObject<DeliveryItem>();
|
|
|
|
|
|
- Task.Run(() =>
|
|
|
- {
|
|
|
- CoreTable docs = new Client<SetoutDocument>().Query(
|
|
|
- new Filter<SetoutDocument>(x => x.EntityLink.ID).IsEqualTo(item.ManufacturingPacketLink.SetoutLink.ID).And(x => x.Superceded).IsEqualTo(DateTime.MinValue),
|
|
|
- new Columns<SetoutDocument>(x => x.DocumentLink.FileName, x => x.DocumentLink.ID)
|
|
|
- );
|
|
|
-
|
|
|
- foreach (var row in docs.Rows)
|
|
|
- {
|
|
|
- if (string.IsNullOrWhiteSpace(row.Get<SetoutDocument, string>(x => x.DocumentLink.FileName)))
|
|
|
- continue;
|
|
|
-
|
|
|
- MaterialButton button = new MaterialButton();
|
|
|
- button.Text = row.Get<SetoutDocument, String>(x => x.DocumentLink.FileName);
|
|
|
- button.Padding = new Thickness(0, 10, 0, 10);
|
|
|
- button.ButtonType = MaterialButtonType.Elevated;
|
|
|
- button.Clicked += ViewPDF;
|
|
|
- button.HorizontalOptions = LayoutOptions.FillAndExpand;
|
|
|
- pdfs[button] = row.Get<SetoutDocument, Guid>(x => x.DocumentLink.ID);
|
|
|
- }
|
|
|
-
|
|
|
- Device.BeginInvokeOnMainThread(() =>
|
|
|
- {
|
|
|
- this.documents.Children.Clear();
|
|
|
- foreach (var button in pdfs.Keys)
|
|
|
- this.documents.Children.Add(button);
|
|
|
- });
|
|
|
- });
|
|
|
+ if (item.SetoutLink.ID != Guid.Empty)
|
|
|
+ Task.Run(() =>
|
|
|
+ {
|
|
|
+ CoreTable docs = new Client<SetoutDocument>().Query(
|
|
|
+ new Filter<SetoutDocument>(x => x.EntityLink.ID).IsEqualTo(item.SetoutLink.ID)
|
|
|
+ .And(x => x.Superceded).IsEqualTo(DateTime.MinValue),
|
|
|
+ new Columns<SetoutDocument>(x => x.DocumentLink.FileName, x => x.DocumentLink.ID)
|
|
|
+ );
|
|
|
+
|
|
|
+ foreach (var row in docs.Rows)
|
|
|
+ {
|
|
|
+ if (string.IsNullOrWhiteSpace(row.Get<SetoutDocument, string>(x => x.DocumentLink.FileName)))
|
|
|
+ continue;
|
|
|
+
|
|
|
+ MaterialButton button = new MaterialButton();
|
|
|
+ button.Text = row.Get<SetoutDocument, String>(x => x.DocumentLink.FileName);
|
|
|
+ button.Padding = new Thickness(0, 10, 0, 10);
|
|
|
+ button.ButtonType = MaterialButtonType.Elevated;
|
|
|
+ button.Clicked += ViewPDF;
|
|
|
+ button.HorizontalOptions = LayoutOptions.FillAndExpand;
|
|
|
+ pdfs[button] = row.Get<SetoutDocument, Guid>(x => x.DocumentLink.ID);
|
|
|
+ }
|
|
|
+
|
|
|
+ Device.BeginInvokeOnMainThread(() =>
|
|
|
+ {
|
|
|
+ this.documents.Children.Clear();
|
|
|
+ foreach (var button in pdfs.Keys)
|
|
|
+ this.documents.Children.Add(button);
|
|
|
+ });
|
|
|
+ });
|
|
|
}
|
|
|
else
|
|
|
item = new DeliveryItem();
|
|
@@ -106,7 +109,7 @@ namespace comal.timesheets
|
|
|
Device.BeginInvokeOnMainThread(() =>
|
|
|
{
|
|
|
if (item != null)
|
|
|
- this.BindingContext = item;
|
|
|
+ this.BindingContext = item;
|
|
|
});
|
|
|
}
|
|
|
}
|