From a31d58ae9b8aea2cab0f289d93d10178bfe453bd Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Sun, 30 Jun 2024 13:02:37 +0200 Subject: [PATCH] Only user Interval end if interval start is also unset (as suggestion in terminal control) --- src/BreCalClient/EditTimesControl.xaml.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/BreCalClient/EditTimesControl.xaml.cs b/src/BreCalClient/EditTimesControl.xaml.cs index a191187..c7480b6 100644 --- a/src/BreCalClient/EditTimesControl.xaml.cs +++ b/src/BreCalClient/EditTimesControl.xaml.cs @@ -113,14 +113,14 @@ namespace BreCalClient this.datePickerATA.Value = this.Times.Ata; this.datePickerATD.Value = this.Times.Atd; this.datePickerETABerth_End.Value = this.Times.EtaIntervalEnd; - if (this.datePickerETABerth_End.IsEnabled && (this.Times.EtaIntervalEnd == null) && (this.AgencyTimes?.EtaIntervalEnd != null) && (ShipcallModel.Shipcall?.Type == ShipcallType.Arrival)) + if (this.datePickerETABerth_End.IsEnabled && (this.Times.EtaIntervalEnd == null) && (this.Times.EtaBerth == null) && (this.AgencyTimes?.EtaIntervalEnd != null) && (ShipcallModel.Shipcall?.Type == ShipcallType.Arrival)) { this.datePickerETABerth_End.Value = this.AgencyTimes.EtaIntervalEnd; //if (this.datePickerETABerth_End.Template.FindName("PART_TextBox", this.datePickerETABerth_End) is WatermarkTextBox tb) { tb.Focus(); tb.SelectAll(); } } this.datePickerETDBerth_End.Value = this.Times.EtdIntervalEnd; - if (this.datePickerETDBerth_End.IsEnabled && (this.Times.EtdIntervalEnd == null) && (this.AgencyTimes?.EtdIntervalEnd != null) && ((ShipcallModel.Shipcall?.Type == ShipcallType.Departure) || (ShipcallModel.Shipcall?.Type == ShipcallType.Shifting))) + if (this.datePickerETDBerth_End.IsEnabled && (this.Times.EtdIntervalEnd == null) && (this.Times.EtdBerth == null) && (this.AgencyTimes?.EtdIntervalEnd != null) && ((ShipcallModel.Shipcall?.Type == ShipcallType.Departure) || (ShipcallModel.Shipcall?.Type == ShipcallType.Shifting))) { this.datePickerETDBerth_End.Value = this.AgencyTimes.EtdIntervalEnd; //if (this.datePickerETDBerth_End.Template.FindName("PART_TextBox", this.datePickerETDBerth_End) is WatermarkTextBox tb) { tb.Focus(); tb.SelectAll(); }