Quintiq file version 2.0
#parent: pButton/ButtonCreateData
Response OnClick () id:Response_pButton_ButtonCreateData_OnClick
{
  #keys: '[414702.1.266042218]'
  CanBindMultiple: false
  DefinitionID: 'Responsedef_WebButton_OnClick'
  Precondition:
  [*
    return not isnull( GlobalOTDSOP ) and not isnull( GlobalOTDTable );
  *]
  QuillAction
  {
    Body:
    [*
      option := WebMessageBox::Question( "请选择数据源", "数据湖|测试数据|取消" );
      
      if ( option = 0 ) {
        WebMessageBox::Success( "开始拉取中，请查看拉取日志", true );
        Global_MappingAnnualBudgetData::CreateData( GlobalOTDTable, ApplicationMacroPlanner.GetUserName() );
      } else if ( option = 1 ) {
        if ( DataHolderCheckedProduct.Data().Size() = 0 ) {
          WebMessageBox::Error( "请先在左侧导航栏选择要生成测试数据的产品！", true );
        } else {
          GlobalOTDTable.CreateCapacityAndSaleBudgeTestData( GlobalOTDSOP,
                                                             GlobalOTDTable,
                                                             DataHolderCapacityAndSaleBudgeFilterYear.Data(),
                                                             DataHolderCheckedProduct.Data() );
        }
      }
    *]
    GroupServerCalls: false
  }
}
