Quintiq file version 2.0
#parent: #root
Method EditStrategyLevel (
  internal[GUIComponent] parent,
  structured[StrategyLevel] selection
) id:Method_ScenarioManager_DialogCreateEditStrategyLevel_EditStrategyLevel
{
  #keys: '[11660.0.763179500]'
  Body:
  [*
    // Edit strategy levels
    
    isbatchedit := selection.Size() > 1;
    usinghierarchical := exists( selection, Elements.Strategy, s, true, s.UseHierarchicalSolver() ); 
    Dialog.ShowHideComponentForBatchEdit( isbatchedit, usinghierarchical );
    
    data := shadow( selection.Element( 0 ) );
    Dialog.Data( data );
    
    
    result := this.DoModal( parent );
    
    if( result > 0 )
    {
      StrategyLevel::Update( selection,
                             ifexpr( isbatchedit, CheckBoxBatchEditTimeLimit.Checked(), true ),
                             data.TimeLimit(),
                             ifexpr( isbatchedit, CheckBoxBatchEditGap.Checked(), true ),
                             data.UseAbsoluteGap(),
                             data.AbsoluteGap(),
                             data.RelativeGap(),
                             ifexpr( isbatchedit, CheckBoxBatchEditRelativeGoalSlack.Checked(), true ),
                             data.RelativeGoalSlack(),
                             ifexpr( isbatchedit, CheckBoxBatchEditSolverSettingGroup.Checked(), true ),
                             data.SolverSettingGroup().Name(), 
                             ifexpr( isbatchedit, CheckBoxBatchEditHierarchalSettings.Checked(), true), 
                             data.UseHierarchicalSolverAbsTolerance(), 
                             data.UseHierarchicalSolverRelTolerance(), 
                             data.HierarchicalSolverAbsTolerance(),
                             data.HierarchicalSolverRelTolerance() ); 
    }
  *]
}
