Quintiq file version 2.0
#parent: #root
Method EnableDisableComponents () id:Method_DialogCreateEditServiceLevel_EnableDisableComponents
{
  #keys: '[113694.2.1012445984]'
  Body:
  [*
    // Enable disable components
    if( DataHolderChildProducts.Data().Size() > 0 )
    {
      if( CheckBoxProduct.Checked() )
      {
        SelectionProduct.Enabled( true );
      }
      else
      {
        SelectionProduct.DisableWithUserFeedback( Translations::MP_Designer_DialogCreateEditServiceLevel_DisableProduct() );
      }
    }
    else
    {  
      CheckBoxProduct.Checked( false );
      CheckBoxProduct.DisableWithUserFeedback( Translations::MP_InventorySpecification_CanCreateNew_EmptyProductNavSelection() );
      SelectionProduct.DisableWithUserFeedback( Translations::MP_InventorySpecification_CanCreateNew_EmptyProductNavSelection() );
    }
    
    if( DataHolderChildStockingPoints.Data().Size() > 0 )
    {
      if( CheckBoxStockingPoint.Checked() )
      {
        SelectionStockingPoint.Enabled( true );
      }
      else
      {
        SelectionStockingPoint.DisableWithUserFeedback( Translations::MP_Designer_DialogCreateEditServiceLevel_DisableStockingPoint() );
      }
    }
    else
    {  
      CheckBoxStockingPoint.Checked( false );
      CheckBoxStockingPoint.DisableWithUserFeedback( Translations::MP_InventorySpecification_CanCreateNew_EmptyStockingPointNavSelection() );
      SelectionStockingPoint.DisableWithUserFeedback( Translations::MP_InventorySpecification_CanCreateNew_EmptyStockingPointNavSelection() );
    }
  *]
}
