Quintiq file version 2.0
#parent: #root
Method EnableDisableComponents (
  Boolean isbatcheditcapacity,
  Boolean isbatcheditlotsize,
  Boolean isbatcheditsecondarycapacity,
  Boolean hassecondarycapacity
) id:Method_DialogCreateEditTransportCapacity_EnableDisableComponents
{
  #keys: '[139394.1.45289561]'
  Body:
  [*
    // Hide / unhide batch
    isbatchedit := DataHolderDialogDatas.Data().Size() > 1;
    
    CheckboxBatchEditCapacity.Visible( isbatchedit );
    CheckboxBatchEditLotSize.Visible( isbatchedit );
    CheckboxBatchEditSecondaryCapacity.Visible( isbatchedit );
    
    isCapacityEnabled := not isbatchedit or isbatcheditcapacity;
    DropDownStringListTimeUnit.Enabled( isCapacityEnabled, '' );
    EditFieldMinCapacity.Enabled( isCapacityEnabled, '' );
    EditFieldMaxCapacity.Enabled( isCapacityEnabled, '' );
    EditFieldLotSize.Enabled( not isbatchedit or isbatcheditlotsize, '' );
    
    isHasSecondaryCapacityEnabled := ( not isbatchedit or isbatcheditsecondarycapacity )
    isSecondaryCapacityEnabled := isHasSecondaryCapacityEnabled and hassecondarycapacity;
    CheckboxHasSecondaryCapacity.Enabled( isHasSecondaryCapacityEnabled, '' );
    DropDownListSecondaryUOM.Enabled( isSecondaryCapacityEnabled, '' );
    EditFieldSecondaryMinCapacity.Enabled( isSecondaryCapacityEnabled, '' );
    EditFieldSecondaryMaxCapacity.Enabled( isSecondaryCapacityEnabled, '' );
    EditFieldSecondaryLotSize.Enabled( isSecondaryCapacityEnabled, '' );
  *]
}
