Ver Fonte

PanelHost now closes subpanels of IPanels that are linked to it.

Kenric Nugteren há 7 meses atrás
pai
commit
2f748591f4

+ 4 - 0
prs.desktop/Panels/PanelHost.cs

@@ -530,6 +530,10 @@ public class PanelHost : IPanelHost
             Heartbeat(DateTime.Now - TrackedTicks, true);
             try
             {
+                if(CurrentPanel is ISubPanelHost host)
+                {
+                    host.ShutdownSubPanels(cancel);
+                }
                 CurrentPanel.Shutdown(cancel);
                 if (cancel?.Cancel == true)
                 {

+ 3 - 3
prs.desktop/Panels/PurchaseOrders/SupplierPurchaseOrderPanel.xaml.cs

@@ -117,8 +117,8 @@ public partial class SupplierPurchaseOrderPanel : UserControl, IPanel<PurchaseOr
         {
             return;
         }
-        var result = MessageBox.Show("You have an unsaved Purchase Order; do you wish to save these changes?", "Save Changes?", MessageBoxButton.YesNoCancel);
-        if (result == MessageBoxResult.Yes)
+        var result = MessageWindow.ShowYesNoCancel("You have an unsaved Purchase Order; do you wish to save these changes?", "Save Changes?");
+        if (result == MessageWindowResult.Yes)
         {
             PurchaseOrder.SaveItem(cancel);
             if (!cancel.Cancel)
@@ -126,7 +126,7 @@ public partial class SupplierPurchaseOrderPanel : UserControl, IPanel<PurchaseOr
                 MessageBox.Show("Purchase Order saved.");
             }
         }
-        else if (result == MessageBoxResult.Cancel)
+        else if (result == MessageWindowResult.Cancel)
         {
             cancel.Cancel = true;
         }

+ 0 - 5
prs.shared/Grids/ScheduleItemGrid.cs

@@ -244,11 +244,6 @@ namespace PRS.Shared
             }
         }
 
-        protected override Dictionary<string, object?> EditorValueChanged(IDynamicEditorForm editor, Schedule[] items, string name, object value)
-        {
-            return base.EditorValueChanged(editor, items, name, value);
-        }
-
         protected override BaseEditor? GetEditor(object item, DynamicGridColumn column)
         {
             var types = new List<Type> { typeof(CustomModule), typeof(ScheduledScript), typeof(Employee), typeof(Equipment) };