From c11e571473b6019698ef19453f8f6cf187c47b28 Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Mon, 12 Aug 2024 12:16:25 +0200 Subject: [PATCH] Do not show ATA message as changed when changing CORE values on Overview page --- ENI2/DetailBaseControl.cs | 9 ++++++-- ENI2/DetailRootControl.xaml.cs | 2 +- .../OverViewDetailControl.xaml.cs | 22 ++++++++++++++----- 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/ENI2/DetailBaseControl.cs b/ENI2/DetailBaseControl.cs index 1414ff28..b88dd418 100644 --- a/ENI2/DetailBaseControl.cs +++ b/ENI2/DetailBaseControl.cs @@ -89,7 +89,7 @@ namespace ENI2 /// /// Eine in der Detailansicht enthaltene Meldeklasse hat sich geändert /// - public event Action NotificationClassChanged; + public event Action NotificationClassChanged; /// /// Eine Maske soll neu erzeugt werden weil sich dort "indirekt" etwas geändert hat durch eine Änderung in einer anderen Maske. @@ -258,12 +258,17 @@ namespace ENI2 { _typeMessageDict[notificationClass].IsDirty = true; // signal this notification class changed.. - this.NotificationClassChanged?.Invoke(notificationClass); + this.OnNotificationClassChanged(notificationClass); } } } } + protected void OnNotificationClassChanged(Message.NotificationClass? notificationClass) + { + this.NotificationClassChanged?.Invoke(notificationClass); + } + #region "BHV Spezial" Datetime Parsing.. protected void DateTimePicker_PreviewKeyUp(object sender, System.Windows.Input.KeyEventArgs e) diff --git a/ENI2/DetailRootControl.xaml.cs b/ENI2/DetailRootControl.xaml.cs index d50b7551..db5af5e2 100644 --- a/ENI2/DetailRootControl.xaml.cs +++ b/ENI2/DetailRootControl.xaml.cs @@ -551,7 +551,7 @@ namespace ENI2 this.DetailControl_RequestReload(this.Core.Id.Value); } - private void DetailControl_NotificationClassChanged(Message.NotificationClass notificationClass) + private void DetailControl_NotificationClassChanged(Message.NotificationClass? notificationClass) { // in der Übersicht die Meldeklasse als geändert markieren..? this.buttonSaveAll.Visibility = Visibility.Visible; diff --git a/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs b/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs index 320d9373..33d35f5a 100644 --- a/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs +++ b/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs @@ -19,6 +19,8 @@ using System.Collections.Generic; using System.Windows.Media; using Microsoft.Win32; using System.Diagnostics; +using System.ComponentModel; +using static bsmd.database.Message; namespace ENI2.DetailViewControls { @@ -46,11 +48,11 @@ namespace ENI2.DetailViewControls { // die Controls nach Änderungen monitoren // diese Einträge gehen auf core - this.RegisterTextboxChange(this.textBoxTicketNo, Message.NotificationClass.ATA); - this.RegisterTextboxChange(this.textBoxDisplayId, Message.NotificationClass.ATA); - this.RegisterTextboxChange(this.textBoxIMO, Message.NotificationClass.ATA); - this.RegisterTextboxChange(this.textBoxENI, Message.NotificationClass.ATA); - this.RegisterLocodeChange(this.locodePoC, Message.NotificationClass.ATA); + this.textBoxTicketNo.TextChanged += CoreTextBox_TextChanged; + this.textBoxDisplayId.TextChanged += CoreTextBox_TextChanged; + this.textBoxIMO.TextChanged += CoreTextBox_TextChanged; + this.textBoxENI.TextChanged += CoreTextBox_TextChanged; + this.locodePoC.PropertyChanged += CoreLocode_LocodeChanged; this.RegisterDateTimePickerChange(this.dateTimePickerATA, Message.NotificationClass.ATA); this.RegisterDateTimePickerChange(this.dateTimePickerATD, Message.NotificationClass.ATD); @@ -58,6 +60,16 @@ namespace ENI2.DetailViewControls this.RegisterDateTimePickerChange(this.dateTimePickerETD, Message.NotificationClass.NOA_NOD); } + private void CoreLocode_LocodeChanged(object sender, PropertyChangedEventArgs e) + { + this.OnNotificationClassChanged(null); + } + + private void CoreTextBox_TextChanged(object sender, TextChangedEventArgs e) + { + this.OnNotificationClassChanged(null); + } + #region Initialize public override void Initialize()