Do not allow editing on cancelled shipcalls
This commit is contained in:
parent
dd3f000f84
commit
023f3357f3
@ -188,6 +188,8 @@ namespace BreCalClient
|
|||||||
|
|
||||||
void CheckForCompletion()
|
void CheckForCompletion()
|
||||||
{
|
{
|
||||||
|
if (this.ShipcallModel.Shipcall?.Canceled ?? false) return; // Cancelled shipcall never clicks ok
|
||||||
|
|
||||||
bool isEnabled = true;
|
bool isEnabled = true;
|
||||||
|
|
||||||
isEnabled &= this.comboBoxShip.SelectedItem != null;
|
isEnabled &= this.comboBoxShip.SelectedItem != null;
|
||||||
@ -378,6 +380,8 @@ namespace BreCalClient
|
|||||||
|
|
||||||
bool editRightGrantedForBSMD = false;
|
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
|
// Special case: Selected Agency allows BSMD to edit their fields
|
||||||
if (this.comboBoxAgency.SelectedIndex >= 0)
|
if (this.comboBoxAgency.SelectedIndex >= 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -366,7 +366,7 @@ namespace BreCalClient
|
|||||||
|
|
||||||
private void CheckOKButton()
|
private void CheckOKButton()
|
||||||
{
|
{
|
||||||
this.buttonOK.IsEnabled = _editing && RequiredFieldsSet();
|
this.buttonOK.IsEnabled = _editing && RequiredFieldsSet() && !(this.ShipcallModel.Shipcall?.Canceled ?? false);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
@ -356,7 +356,7 @@ namespace BreCalClient
|
|||||||
|
|
||||||
private void CheckOKButton()
|
private void CheckOKButton()
|
||||||
{
|
{
|
||||||
this.buttonOK.IsEnabled = _editing && RequiredFieldsSet();
|
this.buttonOK.IsEnabled = _editing && RequiredFieldsSet() && !(this.ShipcallModel.Shipcall?.Canceled ?? false);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
@ -394,7 +394,7 @@ namespace BreCalClient
|
|||||||
|
|
||||||
private void CheckOKButton()
|
private void CheckOKButton()
|
||||||
{
|
{
|
||||||
this.buttonOK.IsEnabled = _editing && RequiredFieldsSet();
|
this.buttonOK.IsEnabled = _editing && RequiredFieldsSet() && !(this.ShipcallModel.Shipcall?.Canceled ?? false);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
@ -259,7 +259,7 @@ namespace BreCalClient
|
|||||||
|
|
||||||
// setting en/dis-abled
|
// 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.buttonFixedOrder.IsEnabled = false;
|
||||||
this.buttonOK.IsEnabled = false;
|
this.buttonOK.IsEnabled = false;
|
||||||
|
|||||||
@ -217,7 +217,7 @@ namespace BreCalClient
|
|||||||
|
|
||||||
private void EnableControls()
|
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;
|
this.buttonOK.IsEnabled = false;
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user