Catch exception if one occurrs during saving

This commit is contained in:
Daniel Schick 2023-11-27 17:26:37 +01:00
parent c3f8759c70
commit c45dbc5da1

View File

@ -189,8 +189,15 @@ namespace BreCalClient
esc.ShipcallModel.Shipcall?.Participants.Clear(); esc.ShipcallModel.Shipcall?.Participants.Clear();
foreach (ParticipantAssignment pa in esc.ShipcallModel.AssignedParticipants.Values) foreach (ParticipantAssignment pa in esc.ShipcallModel.AssignedParticipants.Values)
esc.ShipcallModel.Shipcall?.Participants.Add(pa); esc.ShipcallModel.Shipcall?.Participants.Add(pa);
try
{
this._api.ShipcallsPost(esc.ShipcallModel.Shipcall); // save new ship call this._api.ShipcallsPost(esc.ShipcallModel.Shipcall); // save new ship call
this.AddShipcall(esc.ShipcallModel); this.AddShipcall(esc.ShipcallModel);
}
catch(Exception ex)
{
this.ShowErrorDialog(ex.ToString(), ex.Message);
}
_refreshImmediately = true; // set flag to avoid timer loop termination _refreshImmediately = true; // set flag to avoid timer loop termination
_tokenSource.Cancel(); // force timer loop end _tokenSource.Cancel(); // force timer loop end