Quintiq file version 2.0
#parent: #root
Method EditCampaign (
  Campaign_MP campaign,
  internal[GUIComponent] parent
) id:Method_DialogCreateEditCampaign_MP_EditCampaign
{
  #keys: '[110880.4.851637494]'
  Body:
  [*
    // Edit campaign
    
    data := shadow( campaign );
    Dialog.Data( data );
    this.InitializeDialog();
    
    result := Dialog.DoModal( parent );
    if( result > 0 )
    {
     campaign.Update( SelectionCampaignType.Data().Unit(),
                      data.EarliestStart(),
                      data.SequenceNumberForExcel(),
                      data.MinQuantity(),
                      data.MaxQuantity(),
                      data.MinDuration(),
                      data.MaxDuration(),
                      SelectionCampaignType.Data().Name(),
                      data.CampaignID(),
                      data.Comment(),
                      data.HasInputMaxQuantity() and RadioButtonGroupQuantityDuration.BoundValue() = GlobalParameters_MP::GetCampaignTransitionsTypeQuantity(),
                      data.HasInputMaxDuration() and RadioButtonGroupQuantityDuration.BoundValue() = GlobalParameters_MP::GetCampaignTransitionsTypeDuration(),
                      false );
    }
  *]
}
