From 213b3e51d95b4a470769b21a6ed472919d1afe37 Mon Sep 17 00:00:00 2001 From: puls200 Date: Thu, 26 Oct 2023 09:35:13 +0200 Subject: [PATCH] 5.+6.:ETD and correct terminal display for outgoing / shifting calls --- src/BreCalClient/MainWindow.xaml.cs | 12 ++++++++++-- src/BreCalClient/ShipcallControl.xaml.cs | 4 ++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/BreCalClient/MainWindow.xaml.cs b/src/BreCalClient/MainWindow.xaml.cs index 6df2daf..f565e62 100644 --- a/src/BreCalClient/MainWindow.xaml.cs +++ b/src/BreCalClient/MainWindow.xaml.cs @@ -374,8 +374,16 @@ namespace BreCalClient Shipcall shipcall = scm.Shipcall; if (BreCalLists.ShipLookupDict.ContainsKey(shipcall.ShipId)) scm.Ship = BreCalLists.ShipLookupDict[shipcall.ShipId]; - if (BreCalLists.BerthLookupDict.ContainsKey(shipcall.ArrivalBerthId ?? 0)) - scm.Berth = BreCalLists.BerthLookupDict[shipcall.ArrivalBerthId ?? 0].Name; + if (shipcall.Type == 1) + { + if (BreCalLists.BerthLookupDict.ContainsKey(shipcall.ArrivalBerthId ?? 0)) + scm.Berth = BreCalLists.BerthLookupDict[shipcall.ArrivalBerthId ?? 0].Name; + } + else + { + if (BreCalLists.BerthLookupDict.ContainsKey(shipcall.DepartureBerthId ?? 0)) + scm.Berth = BreCalLists.BerthLookupDict[shipcall.DepartureBerthId ?? 0].Name; + } scm.AssignParticipants(); this.Dispatcher.Invoke(() => diff --git a/src/BreCalClient/ShipcallControl.xaml.cs b/src/BreCalClient/ShipcallControl.xaml.cs index a087172..06ba11f 100644 --- a/src/BreCalClient/ShipcallControl.xaml.cs +++ b/src/BreCalClient/ShipcallControl.xaml.cs @@ -191,11 +191,11 @@ namespace BreCalClient this.textBlockBerth.Text = this.ShipcallControlModel?.Berth; this.textBlockCallsign.Text = this.ShipcallControlModel?.Ship?.Callsign; - if ((this.ShipcallControlModel?.Shipcall?.Type == 1) || (this.ShipcallControlModel?.Shipcall?.Type == 3)) + if (this.ShipcallControlModel?.Shipcall?.Type == 1) { this.textBlockETA.Text = this.ShipcallControlModel?.Shipcall?.Eta?.ToString("dd.MM. HH:mm"); } - if (this.ShipcallControlModel?.Shipcall?.Type == 2) + if ((this.ShipcallControlModel?.Shipcall?.Type == 2) || (this.ShipcallControlModel?.Shipcall?.Type == 3)) { this.labelETA.Text = "ETD"; this.textBlockETA.Text = this.ShipcallControlModel?.Shipcall?.Etd?.ToString("dd.MM. HH:mm");