Quintiq file version 2.0
#parent: #root
Method UpdateCheckboxState () id:Method_DialogCreateEditCampaign_MP_UpdateCheckboxState
{
  #keys: '[146302.1.810180780]'
  Body:
  [*
    // By checking duration it will HasInput to quantity if nothing is found
    durationbased := RadioButtonGroupQuantityDuration.BoundValue() = GlobalParameters_MP::GetCampaignTransitionsTypeDuration();
    quantitybased := not durationbased;
    hasoperation := Dialog.Data().CampaignType_MP().OperationInCampaignType( relsize ) > 0;
    
    // Show/hide durations
    GUIDurationSelectorMinDuration.Visible( durationbased );
    GUIDurationSelectorMaxDuration.Visible( durationbased );
    LabelMinDuration.Visible( durationbased );
    LabelMaxDuration.Visible( durationbased );
    CheckBoxHasInputMaxDuration.Visible( durationbased );
    LabelIndicatedQuantityBasedOnMinDuration.Visible( durationbased and hasoperation );
    LabelIndicatedQuantityBasedOnMaxDuration.Visible( durationbased and hasoperation );
    
    // Show/hide quantity
    EditorCampaignMinQuantity.Visible( quantitybased );
    EditorCampaignMaxQuantity.Visible( quantitybased );
    LabelMinQuantity.Visible( quantitybased );
    LabelMaxQuantity.Visible( quantitybased );
    CheckBoxHasInputMaxQuantity.Visible( quantitybased );
    LabelIndicatedDurationBasedOnMinQty.Visible( quantitybased and hasoperation );
    LabelIndicatedDurationBasedOnMaxQty.Visible( quantitybased and hasoperation );
    
    // Enable/disable
    EditorCampaignMaxQuantity.Enabled( CheckBoxHasInputMaxQuantity.Checked() );
    GUIDurationSelectorMaxDuration.Enabled( CheckBoxHasInputMaxDuration.Checked() );
    
    this.SetIndicatorValue();
  *]
}
