|  |  |  | 
|---|
|  |  |  | newscenario := null( Scenario ); | 
|---|
|  |  |  | strategy := null( Strategy ); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // New version | 
|---|
|  |  |  | globalotdtable := GlobalOTDTable; | 
|---|
|  |  |  | testbusinesstype := "集团"; | 
|---|
|  |  |  | if( data.IsCreateNewVersion() ){ | 
|---|
|  |  |  | VersionControl::CreateNewSceneVersion( globalotdtable, testbusinesstype ); | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | VersionControl::CopyVersion( globalotdtable, testbusinesstype ); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | versionname := VersionControl::GetVersionInfo( globalotdtable, testbusinesstype ).Element( 3 ); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // Get Version Name | 
|---|
|  |  |  | if( data.Name() = "" ){ | 
|---|
|  |  |  | data.Name( versionname ); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // Copy scenario | 
|---|
|  |  |  | if( isnull( data.WrappedInstance() ) ) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | 
|---|
|  |  |  | // sync data | 
|---|
|  |  |  | if( data.EnableSync() ) { | 
|---|
|  |  |  | MacroPlan::DoSync( macroPlanNew, | 
|---|
|  |  |  | data.BusinessType(), data.IsKeyProduct(), data.CreatePurchaseSupplyMaterial() ); | 
|---|
|  |  |  | data.BusinessType(), data.IsKeyProduct(), data.CreatePurchaseSupplyMaterial() ,GlobalOTDTable); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | this.Close(); | 
|---|