Do not allow editing on cancelled shipcalls

This commit is contained in:
Daniel Schick 2024-12-07 14:50:40 +01:00
parent c253de0ba8
commit d536d9479e
6 changed files with 9 additions and 5 deletions

View File

@ -188,6 +188,8 @@ namespace BreCalClient
void CheckForCompletion()
{
if (this.ShipcallModel.Shipcall?.Canceled ?? false) return; // Cancelled shipcall never clicks ok
bool isEnabled = true;
isEnabled &= this.comboBoxShip.SelectedItem != null;
@ -378,6 +380,8 @@ namespace BreCalClient
bool editRightGrantedForBSMD = false;
if (this.ShipcallModel.Shipcall?.Canceled ?? false) return; // do not allow edit on canceled shipcall
// Special case: Selected Agency allows BSMD to edit their fields
if (this.comboBoxAgency.SelectedIndex >= 0)
{

View File

@ -366,7 +366,7 @@ namespace BreCalClient
private void CheckOKButton()
{
this.buttonOK.IsEnabled = _editing && RequiredFieldsSet();
this.buttonOK.IsEnabled = _editing && RequiredFieldsSet() && !(this.ShipcallModel.Shipcall?.Canceled ?? false);
}
#endregion

View File

@ -356,7 +356,7 @@ namespace BreCalClient
private void CheckOKButton()
{
this.buttonOK.IsEnabled = _editing && RequiredFieldsSet();
this.buttonOK.IsEnabled = _editing && RequiredFieldsSet() && !(this.ShipcallModel.Shipcall?.Canceled ?? false);
}
#endregion

View File

@ -394,7 +394,7 @@ namespace BreCalClient
private void CheckOKButton()
{
this.buttonOK.IsEnabled = _editing && RequiredFieldsSet();
this.buttonOK.IsEnabled = _editing && RequiredFieldsSet() && !(this.ShipcallModel.Shipcall?.Canceled ?? false);
}
#endregion

View File

@ -259,7 +259,7 @@ namespace BreCalClient
// setting en/dis-abled
if (this.Times.ParticipantId != App.Participant.Id)
if ((this.Times.ParticipantId != App.Participant.Id) || (this.ShipcallModel.Shipcall?.Canceled ?? false))
{
this.buttonFixedOrder.IsEnabled = false;
this.buttonOK.IsEnabled = false;

View File

@ -217,7 +217,7 @@ namespace BreCalClient
private void EnableControls()
{
if (this.Times.ParticipantId != App.Participant.Id)
if ((this.Times.ParticipantId != App.Participant.Id) || (this.ShipcallModel.Shipcall?.Canceled ?? false))
{
this.buttonOK.IsEnabled = false;
return;