don't allow a changed port when creating departure after a new arrival

This commit is contained in:
Daniel Schick 2024-10-01 08:19:11 +02:00
parent 4b1f773c6f
commit e18188cd85
3 changed files with 18 additions and 14 deletions

View File

@ -363,6 +363,7 @@ namespace BreCalClient
if (BreCalLists.PortLookupDict.ContainsKey(this.ShipcallModel.Shipcall.PortId))
this.comboBoxHarbour.SelectedValue = this.ShipcallModel.Shipcall.PortId;
this.comboBoxHarbour.IsEnabled = this.ShipcallModel.AllowPortChange;
}
}

View File

@ -289,6 +289,7 @@ namespace BreCalClient
scmOut.Shipcall.ShipId = esc.ShipcallModel.Shipcall.ShipId;
scmOut.Shipcall.PortId = esc.ShipcallModel.Shipcall.PortId;
scmOut.Ship = esc.ShipcallModel.Ship;
scmOut.AllowPortChange = false;
DateTime eta = esc.ShipcallModel.Shipcall?.Eta ?? DateTime.Now;
scmOut.Shipcall.Etd = eta.AddDays(2);
scmOut.Shipcall.DepartureBerthId = esc.ShipcallModel.Shipcall?.ArrivalBerthId;

View File

@ -118,6 +118,8 @@ namespace BreCalClient
}
}
public bool AllowPortChange { get; set; } = true;
#endregion
#region public methods