If the agency provided a time, display it in the BSMD column. Also corrected ETD/ETA Label right there

This commit is contained in:
Daniel Schick 2024-11-08 09:59:37 +01:00
parent b070979723
commit effbf42303
2 changed files with 7 additions and 17 deletions

View File

@ -268,22 +268,9 @@ namespace BreCalClient
else
this.imageEvaluation.ToolTip = null;
//Times? bsmdTimes = this.ShipcallControlModel?.GetTimesForParticipantType(Extensions.ParticipantType.BSMD);
//if (bsmdTimes != null)
this.textBlockBerth.Text = this.ShipcallControlModel?.GetBerthText(null);
//else
// this.textBlockBerth.Text = this.ShipcallControlModel?.Berth;
this.textBlockBerth.Text = this.ShipcallControlModel?.GetBerthText(null);
this.textBlockCallsign.Text = this.ShipcallControlModel?.Ship?.Callsign;
if (this.ShipcallControlModel?.Shipcall?.Type == ShipcallType.Arrival)
{
this.textBlockETA.Text = this.ShipcallControlModel?.Shipcall?.Eta?.ToString("dd.MM. HH:mm");
}
if ((this.ShipcallControlModel?.Shipcall?.Type == ShipcallType.Departure) || (this.ShipcallControlModel?.Shipcall?.Type == ShipcallType.Shifting))
{
this.labelETA.Text = "ETD";
this.textBlockETA.Text = this.ShipcallControlModel?.Shipcall?.Etd?.ToString("dd.MM. HH:mm");
}
this.textBlockETA.Text = this.ShipcallControlModel?.GetETAETD(true);
this.textBlockIMO.Text = this.ShipcallControlModel?.Ship?.Imo.ToString();
this.textBlockLengthWidth.Text = $"{this.ShipcallControlModel?.Ship?.Length} / {this.ShipcallControlModel?.Ship?.Width}";
@ -293,6 +280,7 @@ namespace BreCalClient
if (this.ShipcallControlModel?.Shipcall?.Type != ShipcallType.Arrival)
{
this.labelETA.Text = "ETD";
this.labelETAETDAgent.Content = "ETD";
this.labelETAETDMooring.Content = "ETD";
this.labelETAETDPilot.Content = "ETD";

View File

@ -219,7 +219,7 @@ namespace BreCalClient
return berthText;
}
public string GetETAETD()
public string GetETAETD(bool useShortVersion = false)
{
DateTime theDate = DateTime.Now;
if(this.Shipcall != null)
@ -243,6 +243,8 @@ namespace BreCalClient
theDate = agentTimes.EtdBerth.Value;
}
}
if(useShortVersion)
return theDate.ToString("dd.MM. HH:mm");
return theDate.ToString();
}