Quintiq file version 2.0
#parent: #root
Method ImportDataFromDM () id:Method_DialogEDIImport_ImportDataFromDM
{
  #keys: '[132444.0.94011018]'
  Body:
  [*
    // Import data from data manager
    folderpath := EditorMPSCExcelPath.Text();
    mpscparam := BinaryValue::Construct();
    detailedschedule := BinaryValue::Construct();
    isdef := RadioButtonGroupMPSCMode.BoundValue() = 'DEF';
    
    if( not isdef )
    {
      if( CheckBoxSC_MPParamsDM.Checked() )
      {
        filename := MPSyncUtility::GetImportFileName( typeof( MPSync_ImportSCMPParamsFromExcelBroker ).Name() );
        mpscparam := Application.ReadBinaryFile( folderpath + filename ).AsBinaryValue();
      }
      if( CheckBoxSCPlanDM.Checked() )
      {
        filename := MPSyncUtility::GetImportFileName( typeof( MPSync_ImportDetailedScheduleFromExcelBroker ).Name() );
        detailedschedule := Application.ReadBinaryFile( folderpath + filename ).AsBinaryValue();
      }
    }
    
    MacroPlan.ImportFromDM( MPSync,
                            CheckBoxSalesDemandsDM.Checked(), 
                            SelectionSalesDemand.Data(),
                            isdef,
                            CheckBoxSC_MPParamsDM.Checked(), 
                            SelectionSC_MPSParams.Data(),
                            mpscparam,
                            CheckBoxSCPlanDM.Checked(), 
                            SelectionSCPlan.Data(),
                            detailedschedule
                            );
  *]
}
