yypsybs
2023-09-09 3cb5a54def670d97301f07170fcaad213bfc54f2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
Quintiq file version 2.0
#parent: #root
Method ImportFiles (
  structured[BaseImportObjectGroupInProfile] importobjectgroupinprofile,
  output structured[BinaryValue] binaryvalues,
  output structured[String] brokers
) id:Method_DialogImportProfile_ImportFiles
{
  #keys: '[132894.0.78291532]'
  Body:
  [*
    // Import files from client side and read into binary
    traverse( importobjectgroupinprofile, Elements, e )
    {
      filenames := e.ImportObjectGroup().GetMPSyncFileNames();
    
      traverse( filenames, Elements, filename )
      {
        excelpath := e.BaseImportProfile().ExcelPath();
        Dialog.FormatPath( excelpath );
        filepath := excelpath + filename;
      
        if( Application.ClientFileExists( filepath ) )
        {
          bindata := Application.ReadBinaryFile( filepath );
          brokername := Dialog.GetBrokerName( filename );
          
          binaryvalues.Add( bindata.AsBinaryValue() );
            
          if ( brokername.Length() > 0 )
          {
            brokers.Add( brokername );
          }
        }
      }
    }
  *]
}