|
@@ -105,7 +105,8 @@ public class StagingSetoutGrid : DynamicDataGrid<StagingSetout>
|
|
|
private readonly BitmapImage packets = PRSDesktop.Resources.factory.AsBitmapImage();
|
|
|
private readonly BitmapImage tick = PRSDesktop.Resources.tick.AsBitmapImage();
|
|
|
private readonly BitmapImage warning = PRSDesktop.Resources.warning.AsBitmapImage();
|
|
|
- private readonly BitmapImage rejected = PRSDesktop.Resources.disabled.AsBitmapImage();
|
|
|
+ private readonly BitmapImage rejected = PRSDesktop.Resources.disabled.AsBitmapImage();
|
|
|
+ private readonly BitmapImage forms = PRSDesktop.Resources.quality.AsBitmapImage();
|
|
|
|
|
|
private Button CopyPacketsButton;
|
|
|
private Button PastePacketsButton;
|
|
@@ -128,7 +129,9 @@ public class StagingSetoutGrid : DynamicDataGrid<StagingSetout>
|
|
|
HiddenColumns.Add(x => x.UnapprovedDocuments);
|
|
|
HiddenColumns.Add(x => x.UnprocessedPackets);
|
|
|
HiddenColumns.Add(x => x.Task.ID);
|
|
|
-
|
|
|
+ HiddenColumns.Add(x => x.Forms);
|
|
|
+ HiddenColumns.Add(x=>x.OpenForms);
|
|
|
+
|
|
|
ActionColumns.Add(new DynamicTickColumn<StagingSetout, Guid>(x => x.Setout.ID, revision, revision, null)
|
|
|
{
|
|
|
ToolTip = Revision_Tooltip,
|
|
@@ -140,6 +143,12 @@ public class StagingSetoutGrid : DynamicDataGrid<StagingSetout>
|
|
|
ToolTip = Locked_Tooltip,
|
|
|
Position = DynamicActionColumnPosition.End
|
|
|
});
|
|
|
+
|
|
|
+ ActionColumns.Add(new DynamicImageColumn(FormsImage)
|
|
|
+ {
|
|
|
+ ToolTip = Forms_Tooltip,
|
|
|
+ Position = DynamicActionColumnPosition.End
|
|
|
+ });
|
|
|
|
|
|
ActionColumns.Add(new DynamicImageColumn(DesignImage)
|
|
|
{
|
|
@@ -358,6 +367,8 @@ public class StagingSetoutGrid : DynamicDataGrid<StagingSetout>
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
private void Menu_Build(DynamicMenuColumn column, CoreRow? row)
|
|
|
{
|
|
|
if (row is null)
|
|
@@ -366,6 +377,17 @@ public class StagingSetoutGrid : DynamicDataGrid<StagingSetout>
|
|
|
}
|
|
|
|
|
|
column.AddItem("Import Components", PRSDesktop.Resources.doc_xls, ImportComponents);
|
|
|
+ column.AddSeparator();
|
|
|
+ Guid designID = row.Get<StagingSetout, Guid>(x => x.ID);
|
|
|
+ var formsItem = column.AddItem("Digital Forms", PRSDesktop.Resources.quality, null);
|
|
|
+ DynamicGridUtils.PopulateFormMenu<StagingSetoutForm, StagingSetout, StagingSetoutLink>(
|
|
|
+ formsItem,
|
|
|
+ designID,
|
|
|
+ () => new Client<StagingSetout>().Query(
|
|
|
+ new Filter<StagingSetout>(x => x.ID).IsEqualTo(designID),
|
|
|
+ Columns.Required<StagingSetout>()).ToObjects<StagingSetout>()
|
|
|
+ .FirstOrDefault() ?? new StagingSetout()
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
private void ImportComponents(CoreRow? row)
|
|
@@ -411,6 +433,35 @@ public class StagingSetoutGrid : DynamicDataGrid<StagingSetout>
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ private BitmapImage? FormsImage(CoreRow? arg)
|
|
|
+ {
|
|
|
+ if (arg is null)
|
|
|
+ return forms;
|
|
|
+ if (arg.Get<StagingSetout, int>(x => x.Forms) == 0)
|
|
|
+ return null;
|
|
|
+ if (arg.Get<StagingSetout, int>(x => x.OpenForms) == 0)
|
|
|
+ return tick;
|
|
|
+ return warning;
|
|
|
+ }
|
|
|
+
|
|
|
+ private FrameworkElement? Forms_Tooltip(DynamicActionColumn column, CoreRow? row)
|
|
|
+ {
|
|
|
+ if (row is null)
|
|
|
+ return column.TextToolTip("Are there Open Digital Forms?");
|
|
|
+
|
|
|
+ var openforms = row.Get<StagingSetout, int>(x => x.OpenForms);
|
|
|
+ if (openforms != 0)
|
|
|
+ return column.TextToolTip("There are open forms!");
|
|
|
+
|
|
|
+ var allforms = row.Get<StagingSetout, int>(x => x.Forms);
|
|
|
+ if (allforms != 0)
|
|
|
+ return column.TextToolTip("All forms have been completed!");
|
|
|
+
|
|
|
+ return column.TextToolTip($"There are no forms for this design.");
|
|
|
+ }
|
|
|
+
|
|
|
private BitmapImage? DesignImage(CoreRow? arg)
|
|
|
{
|
|
|
if (arg is null)
|