From 2004362e1a0ac002e5900fb33a3ea53282af7e38 Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Fri, 31 Jan 2025 18:28:42 +0100 Subject: [PATCH] Set SetEnabled per override on top-level groupboxes. Not sure yet if this is going to cut it. --- ENI2/SheetDisplayControls/ATAControl.xaml.cs | 2 +- .../SheetDisplayControls/CrewDepartureControl.xaml | 2 +- .../CrewDepartureControl.xaml.cs | 7 ++++++- .../CrewPreArrivalControl.xaml | 2 +- .../CrewPreArrivalControl.xaml.cs | 6 ++++++ .../DangerousCargoControl.xaml | 2 +- .../DangerousCargoControl.xaml.cs | 13 ++----------- .../PassengerDepartureControl.xaml | 2 +- .../PassengerDepartureControl.xaml.cs | 6 ++++++ .../PassengerPreArrivalControl.xaml | 2 +- .../PassengerPreArrivalControl.xaml.cs | 6 ++++++ ENI2/SheetDisplayControls/PortControl.xaml.cs | 14 ++++++++++++++ ENI2/SheetDisplayControls/PreArrivalControl.xaml | 2 +- .../SheetDisplayControls/PreArrivalControl.xaml.cs | 10 ++++++++++ ENI2/SheetDisplayControls/PreDepartureControl.xaml | 2 +- .../PreDepartureControl.xaml.cs | 10 ++++++++++ ENI2/SheetDisplayControls/ShipDataControl.xaml | 2 +- ENI2/SheetDisplayControls/ShipDataControl.xaml.cs | 6 ++++++ ENI2/SheetDisplayControls/VoyageControl.xaml.cs | 6 +++++- .../SheetDisplayControls/WasteReceiptsControl.xaml | 2 +- .../WasteReceiptsControl.xaml.cs | 1 + 21 files changed, 82 insertions(+), 23 deletions(-) diff --git a/ENI2/SheetDisplayControls/ATAControl.xaml.cs b/ENI2/SheetDisplayControls/ATAControl.xaml.cs index 320fdb24..3777fc3c 100644 --- a/ENI2/SheetDisplayControls/ATAControl.xaml.cs +++ b/ENI2/SheetDisplayControls/ATAControl.xaml.cs @@ -74,7 +74,7 @@ namespace ENI2.SheetDisplayControls public override void SetEnabled(bool enabled) { base.SetEnabled(enabled); - + this.portCallGroupBox.IsEnabled = enabled; } #endregion diff --git a/ENI2/SheetDisplayControls/CrewDepartureControl.xaml b/ENI2/SheetDisplayControls/CrewDepartureControl.xaml index 6dd9958c..07f1c612 100644 --- a/ENI2/SheetDisplayControls/CrewDepartureControl.xaml +++ b/ENI2/SheetDisplayControls/CrewDepartureControl.xaml @@ -11,7 +11,7 @@ xmlns:local="clr-namespace:ENI2.SheetDisplayControls" mc:Ignorable="d" d:DesignHeight="1450" d:DesignWidth="800"> - + diff --git a/ENI2/SheetDisplayControls/CrewDepartureControl.xaml.cs b/ENI2/SheetDisplayControls/CrewDepartureControl.xaml.cs index fe5d1763..cb141300 100644 --- a/ENI2/SheetDisplayControls/CrewDepartureControl.xaml.cs +++ b/ENI2/SheetDisplayControls/CrewDepartureControl.xaml.cs @@ -88,7 +88,12 @@ namespace ENI2.SheetDisplayControls } - + public override void SetEnabled(bool enabled) + { + base.SetEnabled(enabled); + this.crewDepartureGroupBox.IsEnabled = enabled; + } + #endregion #region event handler diff --git a/ENI2/SheetDisplayControls/CrewPreArrivalControl.xaml b/ENI2/SheetDisplayControls/CrewPreArrivalControl.xaml index 16b54b20..88381b72 100644 --- a/ENI2/SheetDisplayControls/CrewPreArrivalControl.xaml +++ b/ENI2/SheetDisplayControls/CrewPreArrivalControl.xaml @@ -11,7 +11,7 @@ xmlns:local="clr-namespace:ENI2.SheetDisplayControls" mc:Ignorable="d" d:DesignHeight="1450" d:DesignWidth="800"> - + diff --git a/ENI2/SheetDisplayControls/CrewPreArrivalControl.xaml.cs b/ENI2/SheetDisplayControls/CrewPreArrivalControl.xaml.cs index 4e6cb34c..23be5067 100644 --- a/ENI2/SheetDisplayControls/CrewPreArrivalControl.xaml.cs +++ b/ENI2/SheetDisplayControls/CrewPreArrivalControl.xaml.cs @@ -93,6 +93,12 @@ namespace ENI2.SheetDisplayControls } + public override void SetEnabled(bool enabled) + { + base.SetEnabled(enabled); + this.crewPreArrivalGroupBox.IsEnabled = enabled; + } + #endregion #region event handler diff --git a/ENI2/SheetDisplayControls/DangerousCargoControl.xaml b/ENI2/SheetDisplayControls/DangerousCargoControl.xaml index 823a6cd6..a7c1261d 100644 --- a/ENI2/SheetDisplayControls/DangerousCargoControl.xaml +++ b/ENI2/SheetDisplayControls/DangerousCargoControl.xaml @@ -11,7 +11,7 @@ xmlns:local="clr-namespace:ENI2.SheetDisplayControls" mc:Ignorable="d" d:DesignHeight="1550" d:DesignWidth="800"> - + diff --git a/ENI2/SheetDisplayControls/DangerousCargoControl.xaml.cs b/ENI2/SheetDisplayControls/DangerousCargoControl.xaml.cs index 9be7d69c..45b653d2 100644 --- a/ENI2/SheetDisplayControls/DangerousCargoControl.xaml.cs +++ b/ENI2/SheetDisplayControls/DangerousCargoControl.xaml.cs @@ -7,19 +7,9 @@ using ENI2.EditControls; using ENI2.Util; using System; using System.Collections.Generic; -using System.Collections.Specialized; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; namespace ENI2.SheetDisplayControls { @@ -164,6 +154,7 @@ namespace ENI2.SheetDisplayControls public override void SetEnabled(bool enabled) { + this.dangerousCargoGroupBox.IsEnabled = enabled; this.dataGridIBCItems.IsEnabled = enabled; // this.checkBoxDangerousGoodsOnBoard.IsEnabled = enabled; this.checkBoxDGManifestOnBoard.IsEnabled = enabled; @@ -198,7 +189,7 @@ namespace ENI2.SheetDisplayControls if(this.IsDeparture) { - this.portCallGroupBox.Header = Properties.Resources.text11DangerousCargoDeparture; + this.dangerousCargoGroupBox.Header = Properties.Resources.text11DangerousCargoDeparture; this.textBlock101.Text = Properties.Resources.text111General; this.textBlock102.Text = Properties.Resources.text112IBCData; this.textBlock103.Text = Properties.Resources.text113IGCData; diff --git a/ENI2/SheetDisplayControls/PassengerDepartureControl.xaml b/ENI2/SheetDisplayControls/PassengerDepartureControl.xaml index 779af10d..1c1879a2 100644 --- a/ENI2/SheetDisplayControls/PassengerDepartureControl.xaml +++ b/ENI2/SheetDisplayControls/PassengerDepartureControl.xaml @@ -11,7 +11,7 @@ xmlns:local="clr-namespace:ENI2.SheetDisplayControls" mc:Ignorable="d" d:DesignHeight="1450" d:DesignWidth="800"> - + diff --git a/ENI2/SheetDisplayControls/PassengerDepartureControl.xaml.cs b/ENI2/SheetDisplayControls/PassengerDepartureControl.xaml.cs index c16b21f0..799684ec 100644 --- a/ENI2/SheetDisplayControls/PassengerDepartureControl.xaml.cs +++ b/ENI2/SheetDisplayControls/PassengerDepartureControl.xaml.cs @@ -89,6 +89,12 @@ namespace ENI2.SheetDisplayControls } + public override void SetEnabled(bool enabled) + { + base.SetEnabled(enabled); + this.passengerDepartureGroupBox.IsEnabled = enabled; + } + #endregion #region event handler diff --git a/ENI2/SheetDisplayControls/PassengerPreArrivalControl.xaml b/ENI2/SheetDisplayControls/PassengerPreArrivalControl.xaml index c827d017..a8ccd474 100644 --- a/ENI2/SheetDisplayControls/PassengerPreArrivalControl.xaml +++ b/ENI2/SheetDisplayControls/PassengerPreArrivalControl.xaml @@ -11,7 +11,7 @@ xmlns:local="clr-namespace:ENI2.SheetDisplayControls" mc:Ignorable="d" d:DesignHeight="1450" d:DesignWidth="800"> - + diff --git a/ENI2/SheetDisplayControls/PassengerPreArrivalControl.xaml.cs b/ENI2/SheetDisplayControls/PassengerPreArrivalControl.xaml.cs index 1cf8c157..89f475a8 100644 --- a/ENI2/SheetDisplayControls/PassengerPreArrivalControl.xaml.cs +++ b/ENI2/SheetDisplayControls/PassengerPreArrivalControl.xaml.cs @@ -89,6 +89,12 @@ namespace ENI2.SheetDisplayControls } + public override void SetEnabled(bool enabled) + { + base.SetEnabled(enabled); + this.passengerArrivalGroupBox.IsEnabled = enabled; + } + #endregion #region event handler diff --git a/ENI2/SheetDisplayControls/PortControl.xaml.cs b/ENI2/SheetDisplayControls/PortControl.xaml.cs index dbaf74f5..000daf74 100644 --- a/ENI2/SheetDisplayControls/PortControl.xaml.cs +++ b/ENI2/SheetDisplayControls/PortControl.xaml.cs @@ -185,8 +185,16 @@ namespace ENI2.SheetDisplayControls } + public override void SetEnabled(bool enabled) + { + base.SetEnabled(enabled); + this.portCallGroupBox.IsEnabled = enabled; + } + #endregion + #region event hander + private void PortControl_Loaded(object sender, RoutedEventArgs e) { // 2.1 @@ -535,6 +543,10 @@ namespace ENI2.SheetDisplayControls } } + #endregion + + #region Templates + private async Task InitTemplates() { _wsdpTemplates = await DBManagerAsync.GetWastDisposalServiceProviderTemplatesAsync(); @@ -626,6 +638,8 @@ namespace ENI2.SheetDisplayControls } } + #endregion + #region datagrid call purposes private void DataGridCallPurposes_DeleteRequested(DatabaseEntity obj) diff --git a/ENI2/SheetDisplayControls/PreArrivalControl.xaml b/ENI2/SheetDisplayControls/PreArrivalControl.xaml index efc5e14f..1bd7ef66 100644 --- a/ENI2/SheetDisplayControls/PreArrivalControl.xaml +++ b/ENI2/SheetDisplayControls/PreArrivalControl.xaml @@ -11,7 +11,7 @@ xmlns:local="clr-namespace:ENI2.SheetDisplayControls" mc:Ignorable="d" d:DesignHeight="850" d:DesignWidth="800"> - + diff --git a/ENI2/SheetDisplayControls/PreArrivalControl.xaml.cs b/ENI2/SheetDisplayControls/PreArrivalControl.xaml.cs index 31c44567..0914b860 100644 --- a/ENI2/SheetDisplayControls/PreArrivalControl.xaml.cs +++ b/ENI2/SheetDisplayControls/PreArrivalControl.xaml.cs @@ -102,8 +102,16 @@ namespace ENI2.SheetDisplayControls } + public override void SetEnabled(bool enabled) + { + base.SetEnabled(enabled); + this.preArrivalGroupBox.IsEnabled = enabled; + } + #endregion + #region event handler + private void PreArrivalControl_Loaded(object sender, RoutedEventArgs e) { // 3.1 @@ -186,6 +194,8 @@ namespace ENI2.SheetDisplayControls } } + #endregion + #region BKRA grid events private void DataGridBKRA_CreateRequested() diff --git a/ENI2/SheetDisplayControls/PreDepartureControl.xaml b/ENI2/SheetDisplayControls/PreDepartureControl.xaml index 79a5a6ee..67a6745c 100644 --- a/ENI2/SheetDisplayControls/PreDepartureControl.xaml +++ b/ENI2/SheetDisplayControls/PreDepartureControl.xaml @@ -11,7 +11,7 @@ xmlns:local="clr-namespace:ENI2.SheetDisplayControls" mc:Ignorable="d" d:DesignHeight="850" d:DesignWidth="800"> - + diff --git a/ENI2/SheetDisplayControls/PreDepartureControl.xaml.cs b/ENI2/SheetDisplayControls/PreDepartureControl.xaml.cs index 5b336776..bdba1394 100644 --- a/ENI2/SheetDisplayControls/PreDepartureControl.xaml.cs +++ b/ENI2/SheetDisplayControls/PreDepartureControl.xaml.cs @@ -92,8 +92,16 @@ namespace ENI2.SheetDisplayControls this.dataGridTowageOnDeparture.CreateRequested += DataGridTowageOnDeparture_CreateRequested; } + public override void SetEnabled(bool enabled) + { + base.SetEnabled(enabled); + this.preDepartureGroupBox.IsEnabled = enabled; + } + #endregion + #region event handler + private void PreDepartureControl_Loaded(object sender, RoutedEventArgs e) { // 4.1 @@ -172,6 +180,8 @@ namespace ENI2.SheetDisplayControls } } + #endregion + #region BKRD grid events private void DataGridBKRD_CreateRequested() diff --git a/ENI2/SheetDisplayControls/ShipDataControl.xaml b/ENI2/SheetDisplayControls/ShipDataControl.xaml index ff561b66..dbd61a7a 100644 --- a/ENI2/SheetDisplayControls/ShipDataControl.xaml +++ b/ENI2/SheetDisplayControls/ShipDataControl.xaml @@ -11,7 +11,7 @@ xmlns:local="clr-namespace:ENI2.SheetDisplayControls" mc:Ignorable="d" d:DesignHeight="1450" d:DesignWidth="800"> - + diff --git a/ENI2/SheetDisplayControls/ShipDataControl.xaml.cs b/ENI2/SheetDisplayControls/ShipDataControl.xaml.cs index f27e89f1..764ee5dd 100644 --- a/ENI2/SheetDisplayControls/ShipDataControl.xaml.cs +++ b/ENI2/SheetDisplayControls/ShipDataControl.xaml.cs @@ -112,6 +112,12 @@ namespace ENI2.SheetDisplayControls } + public override void SetEnabled(bool enabled) + { + base.SetEnabled(enabled); + this.shipDataGroupBox.IsEnabled = enabled; + } + #endregion #region event handler diff --git a/ENI2/SheetDisplayControls/VoyageControl.xaml.cs b/ENI2/SheetDisplayControls/VoyageControl.xaml.cs index 10febc3b..e4fc9824 100644 --- a/ENI2/SheetDisplayControls/VoyageControl.xaml.cs +++ b/ENI2/SheetDisplayControls/VoyageControl.xaml.cs @@ -177,8 +177,12 @@ namespace ENI2.SheetDisplayControls this.dataGridInfectedAreas.DeleteRequested += DataGridInfectedAreas_DeleteRequested; this.dataGridInfectedAreas.CreateRequested += DataGridInfectedAreas_CreateRequested; + } - + public override void SetEnabled(bool enabled) + { + base.SetEnabled(enabled); + this.voyageGroupBox.IsEnabled = enabled; } #endregion diff --git a/ENI2/SheetDisplayControls/WasteReceiptsControl.xaml b/ENI2/SheetDisplayControls/WasteReceiptsControl.xaml index 30dba09f..cbcef748 100644 --- a/ENI2/SheetDisplayControls/WasteReceiptsControl.xaml +++ b/ENI2/SheetDisplayControls/WasteReceiptsControl.xaml @@ -11,7 +11,7 @@ xmlns:local="clr-namespace:ENI2.SheetDisplayControls" mc:Ignorable="d" d:DesignHeight="600" d:DesignWidth="800"> - + diff --git a/ENI2/SheetDisplayControls/WasteReceiptsControl.xaml.cs b/ENI2/SheetDisplayControls/WasteReceiptsControl.xaml.cs index eb1c065d..142e0b88 100644 --- a/ENI2/SheetDisplayControls/WasteReceiptsControl.xaml.cs +++ b/ENI2/SheetDisplayControls/WasteReceiptsControl.xaml.cs @@ -107,6 +107,7 @@ namespace ENI2.SheetDisplayControls public override void SetEnabled(bool enabled) { base.SetEnabled(enabled); + this.wasteReceiptsGroupBox.IsEnabled = enabled; } #endregion