Pflichtfelder bei Neuanlage gefixt
This commit is contained in:
parent
08edd7d1d8
commit
ee071d6b9d
@ -145,8 +145,32 @@ namespace BreCalClient
|
||||
|
||||
isEnabled &= this.comboBoxShip.SelectedItem != null;
|
||||
isEnabled &= this.comboBoxCategories.SelectedItem != null;
|
||||
isEnabled &= ((this.comboBoxArrivalBerth.SelectedItem != null) || (this.comboBoxDepartureBerth.SelectedItem != null));
|
||||
isEnabled &= (this.datePickerETA.Value.HasValue || this.datePickerETD.Value.HasValue);
|
||||
|
||||
if (comboBoxCategories.SelectedItem == null)
|
||||
{
|
||||
isEnabled = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
TypeEnum callType = (TypeEnum)comboBoxCategories.SelectedItem;
|
||||
switch (callType)
|
||||
{
|
||||
case TypeEnum.Outgoing:
|
||||
isEnabled &= this.comboBoxDepartureBerth.SelectedItem != null;
|
||||
isEnabled &= this.datePickerETD.Value.HasValue;
|
||||
break;
|
||||
case TypeEnum.Incoming:
|
||||
isEnabled &= this.comboBoxArrivalBerth.SelectedItem != null;
|
||||
isEnabled &= this.datePickerETA.Value.HasValue;
|
||||
break;
|
||||
case TypeEnum.Shifting:
|
||||
isEnabled &= ((this.comboBoxDepartureBerth.SelectedItem != null) && (this.comboBoxArrivalBerth.SelectedItem != null));
|
||||
isEnabled &= this.datePickerETD.Value.HasValue;
|
||||
isEnabled &= this.datePickerETA.Value.HasValue;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
isEnabled &= this.comboBoxAgency.SelectedItem != null;
|
||||
|
||||
this.buttonOK.IsEnabled = isEnabled;
|
||||
|
||||
Reference in New Issue
Block a user