Browse Source

Added Check to prevent Manufacturing packets without templates being created

frogsoftware 1 year ago
parent
commit
5f5fcc6407
1 changed files with 12 additions and 1 deletions
  1. 12 1
      prs.desktop/Panels/Staging/StagingPanel.xaml.cs

+ 12 - 1
prs.desktop/Panels/Staging/StagingPanel.xaml.cs

@@ -266,13 +266,22 @@ public class Module
                     Progress.Show("Approving Setouts..");
                 }
             }
+            
             if(selectedSetouts.Any(x => x.UnapprovedDocuments > 0))
             {
                 MessageBox.Show("Cannot process setouts with unapproved documents.");
                 Progress.Close();
                 return;
             }
-            else if(selectedSetouts.Any(x => x.Packets == 0))
+            
+            if (ManufacturingPacketList.Packets.Any(x => x.Template.ID == Guid.Empty))
+            {
+                MessageBox.Show("Cannot process manufacturing packets without templates.");
+                Progress.Close();
+                return;
+            }
+            
+            if(selectedSetouts.Any(x => x.Packets == 0))
             {
                 if(MessageBox.Show("Warning: some setouts do not have any manufacturing packets: are you sure you wish to proceed?", "Warning", MessageBoxButton.YesNoCancel) != MessageBoxResult.Yes)
                 {
@@ -281,6 +290,8 @@ public class Module
                 }
             }
 
+
+
             string message = "Result: " + Environment.NewLine;
 
             foreach (var item in selectedSetouts)