Quintiq file version 2.0
#parent: #root
Method EnableDisableComponents (
  Boolean isbatcheditcapacity,
  Boolean isbatcheditmaxload,
  Boolean isbatcheditnrofunits
) id:Method_DialogCreateEditQuantityCapacity_EnableDisableComponents
{
  #keys: '[139394.1.98476813]'
  Body:
  [*
    // Hide / unhide batch
    isbatchedit := DataHolderDialogDatas.Data().Size() > 1;
    
    CheckboxBatchEditCapacity.Visible( isbatchedit );
    CheckboxBatchEditMaxLoadPercentage.Visible( isbatchedit );
    CheckboxBatchEditNrOfUnitsOpen.Visible( isbatchedit );
    
    isCapacityEnabled := not isbatchedit or isbatcheditcapacity;
    DropDownStringListTimeUnit.Enabled( isCapacityEnabled, '' );
    EditFieldMinCapacity.Enabled( isCapacityEnabled, '' );
    EditFieldMaxCapacity.Enabled( isCapacityEnabled, '' );
    
    EditFieldMaxLoadPercentage.Enabled( not isbatchedit or isbatcheditmaxload, '' );
    EditFieldNumberOfUnits.Enabled( not isbatchedit or isbatcheditnrofunits, '' );
  *]
}
