Bugfix: avoid clearing of all assigned participants (they are *not* set in this dialog!(any more))

This commit is contained in:
Daniel Schick 2023-10-13 13:24:46 +02:00 committed by puls200
parent 35f0f8b204
commit 1e9636c47c

View File

@ -162,11 +162,6 @@ namespace BreCalClient
this.ShipcallModel.Shipcall.DepartureBerthId = (this.comboBoxDepartureBerth.SelectedItem != null) ? ((Berth)this.comboBoxDepartureBerth.SelectedItem).Id : null;
// remove all and add selected participants
this.ShipcallModel.Shipcall.Participants.Clear();
this.ShipcallModel.AssignedParticipants.Clear();
Participant? participant;
participant = (Participant?)this.comboBoxAgency.SelectedItem;
if (participant != null)
@ -178,6 +173,12 @@ namespace BreCalClient
};
this.ShipcallModel.AssignedParticipants[Extensions.ParticipantType.AGENCY] = pa;
}
else
{
// AGENCY was set before and now is set to nothing
if (this.ShipcallModel.AssignedParticipants.ContainsKey(ParticipantType.AGENCY))
this.ShipcallModel.AssignedParticipants.Remove(ParticipantType.AGENCY);
}
// BSMD and port authority are always added