Browse Source

Made TreatmentParameter in StagingManufacturingTreatment compulsory

frogsoftware 1 year ago
parent
commit
a4d28bc3bb

+ 8 - 1
prs.desktop/Panels/Staging/Manufacturing/StagingManufacturingPacketTreatmentGrid.cs

@@ -1,4 +1,5 @@
 using System;
 using System;
+using System.Collections.Generic;
 using System.Linq;
 using System.Linq;
 using Comal.Classes;
 using Comal.Classes;
 using InABox.Core;
 using InABox.Core;
@@ -43,7 +44,6 @@ public class StagingManufacturingPacketTreatmentGrid : DynamicDataGrid<StagingMa
             options.Add(DynamicGridOption.AddRows);
             options.Add(DynamicGridOption.AddRows);
             options.Add(DynamicGridOption.EditRows);
             options.Add(DynamicGridOption.EditRows);
             options.Add(DynamicGridOption.DeleteRows);
             options.Add(DynamicGridOption.DeleteRows);
-            options.Add(DynamicGridOption.DirectEdit);
         }
         }
 
 
         options.EndUpdate();
         options.EndUpdate();
@@ -67,4 +67,11 @@ public class StagingManufacturingPacketTreatmentGrid : DynamicDataGrid<StagingMa
 
 
         return item;
         return item;
     }
     }
+
+    protected override void DoValidate(StagingManufacturingPacketTreatment[] items, List<string> errors)
+    {
+        base.DoValidate(items, errors);
+        if (items.Any(x=>x.Parameter.IsEffectivelyEqual(0.0)))
+            errors.Add("Parameter may not be zero!");
+    }
 }
 }