xiaoding721
2023-11-13 e4edcfd0b987b239526f5375881b919789782dad
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
Quintiq file version 2.0
#parent: CustomDrawComponent
Response OnClick () id:Response_CustomDrawComponent_MenuImport_OnClick
{
  #keys: '[132448.0.516478609]'
  Body:
  [*
    //Import view from xml
    filename := Application.GetOpenFileName();
    
    if( filename <> '' )
    {
      feedback := '';
      xml := Application.ReadTextFile( filename );
      supplyChainViews := construct( SupplyChainViews );  
      supplyChainViews.Add( DataHolderView.Data() );
      
      if( not SupplyChainView::ImportFromXML( supplyChainViews, xml, feedback ) )
      {
        MessageBox::Warning( this, feedback, '&Ok' );
      }
    }
  *]
  CanBindMultiple: false
  DefinitionID => /CustomDrawComponent/Responsedef_CustomDrawComponent_Menu_OnClick
  Initiator: 'MenuImport'
  Precondition:
  [*
    return MacroPlan::HasMacroPlan( MacroPlan, feedback )
           and not isnull( DataHolderView.Data() );
  *]
}