From a82080b9705cccbefc63b54bef0c1244f678cddf Mon Sep 17 00:00:00 2001 From: puls200 Date: Wed, 1 Nov 2023 11:10:28 +0100 Subject: [PATCH] Fixed berth display changing between add and update --- src/BreCalClient/MainWindow.xaml.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/BreCalClient/MainWindow.xaml.cs b/src/BreCalClient/MainWindow.xaml.cs index 08736fc..c9e49ae 100644 --- a/src/BreCalClient/MainWindow.xaml.cs +++ b/src/BreCalClient/MainWindow.xaml.cs @@ -416,8 +416,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(); }