From 30c8069a9bd4ef4b964e1f71dda01127d721e0ae Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Fri, 28 Jun 2024 10:46:45 +0200 Subject: [PATCH] For the interval, the end date is also set in the control --- src/BreCalClient/EditTimesControl.xaml.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/BreCalClient/EditTimesControl.xaml.cs b/src/BreCalClient/EditTimesControl.xaml.cs index c2a6982..a191187 100644 --- a/src/BreCalClient/EditTimesControl.xaml.cs +++ b/src/BreCalClient/EditTimesControl.xaml.cs @@ -113,7 +113,18 @@ 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)) + { + 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))) + { + 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(); } + } this.labelETA.Content = string.Format("ETA {0}", BreCalLists.TimeRefs[this.ShipcallModel.Shipcall?.TimeRefPoint ?? 0]); this.labelETD.Content = string.Format("ETD {0}", BreCalLists.TimeRefs[this.ShipcallModel.Shipcall?.TimeRefPoint ?? 0]);