Quintiq file version 2.0
#parent: #root
Method OnOK () id:Method_DialogCreateEditOptimizerPuzzle_OnOK
{
  #keys: '[146140.1.635854957]'
  Body:
  [*
    // Clicks OK to save optimizer puzzle
    
    wip := DataHolderOptimizerPuzzleWIP.Data();
    
    // Create
    if( isnull( wip.OptimizerPuzzle() ) )
    {
      OptimizerPuzzle::Create( MacroPlan, 
                               EditFieldName.Text(),
                               EditFieldDescription.Text(),
                               false, // IsLastUsed
                               false, // isFromDB
                               wip );
    }
    else
    // Edit / Copy
    {
      wip.OptimizerPuzzle().Update( QuintiqUser::CurrentUser().Name(), 
                                    EditFieldName.Text(),
                                    EditFieldDescription.Text(),
                                    false ); // isFromDB 
    
    }
    
    // Close dialog
    this.Close();
  *]
}
