소스 검색

Added Check to prevent Manufacturing packets without templates being created

frogsoftware 1 년 전
부모
커밋
5f5fcc6407
1개의 변경된 파일12개의 추가작업 그리고 1개의 파일을 삭제
  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)