Quintiq file version 2.0
|
#parent: #root
|
Method ImportDataFromExcel () as Boolean id:Method_DialogImport_ImportDataFromExcel
|
{
|
#keys: '[136682.0.2008489111]'
|
Body:
|
[*
|
// Import data from excel
|
// UserData is set by text box responses depending on whether there is a user-specified path.
|
importpath := EditFieldExcelPath.Text();
|
|
binaryvalues := construct( BinaryValues );
|
broker := construct( Strings );
|
smbinaryvalues := construct ( BinaryValues );
|
smbrokers := construct( Strings );
|
fileNames := construct( Strings );
|
smFileNames := construct( Strings );
|
|
isbinary := importpath <>'';
|
//format path to correct format
|
//F.FormatPath( importpath );
|
|
is3DDrive := RadioButtonGroupSource.BoundValue() = MPSyncUtility::ID_Source_3DDrive();
|
missingFiles := construct( Strings );
|
if( is3DDrive or importpath <> '' )
|
{
|
Form.ImportFiles( importpath, binaryvalues, broker, smbinaryvalues, smbrokers, fileNames, smFileNames, missingFiles );
|
}
|
|
canimport := missingFiles.Size()=0;
|
|
|
if ( canimport /*and guard( binaryvalues.Size() >0, false )*/ )
|
{
|
// call synchronize
|
MacroPlan.Synchronize( Form.GetIsIncluded( MPSyncUtility::ID_ObjectGroup_SupplyChainParameters() ), // general
|
Form.GetIsIncluded( MPSyncUtility::ID_ObjectGroup_GlobalParameters() ), // globalparameters
|
Form.GetIsIncluded( MPSyncUtility::ID_ObjectGroup_Periods() ), // periods
|
Form.GetIsIncluded( MPSyncUtility::ID_ObjectGroup_InventorySpecifications() ), // inventoryspecifications
|
Form.GetIsIncluded( MPSyncUtility::ID_ObjectGroup_InventorySupplies() ), // inventorysupplies
|
Form.GetIsIncluded( MPSyncUtility::ID_ObjectGroup_Products() ), // products and disaggregation factor
|
Form.GetIsIncluded( MPSyncUtility::ID_ObjectGroup_Forecast() ), // salesdemands
|
Form.GetIsIncluded( MPSyncUtility::ID_ObjectGroup_ServiceLevels() ), // servicelevels
|
Form.GetIsIncluded( MPSyncUtility::ID_ObjectGroup_Campaigns() ), // campaigns and transition types
|
Form.GetIsIncluded( MPSyncUtility::ID_ObjectGroup_Entities() ), // entities
|
Form.GetIsIncluded( MPSyncUtility::ID_ObjectGroup_Costs() ), // entitiescosts
|
Form.GetIsIncluded( MPSyncUtility::ID_ObjectGroup_Lanes() ), // lanes
|
Form.GetIsIncluded( MPSyncUtility::ID_ObjectGroup_Routings() ), // routings
|
Form.GetIsIncluded( MPSyncUtility::ID_ObjectGroup_Capacities() ), // stockingpointcapacities and unitcapacities
|
Form.GetIsIncluded( MPSyncUtility::ID_ObjectGroup_SupplySpecifications() ), // supplyspecifications
|
Form.GetIsIncluded( MPSyncUtility::ID_ObjectGroup_Recipes() ), // recipes
|
Form.GetIsIncluded( MPSyncUtility::ID_ObjectGroup_Actuals() ), // actuals pispip and actual unit periods
|
Form.GetIsIncluded( MPSyncUtility::ID_ObjectGroup_Feedback() ), // feedbacks
|
Form.GetIsIncluded( MPSyncUtility::ID_ObjectGroup_OptimizerPuzzle() ), // optimizer puzzles
|
Form.GetIsIncluded( MPSyncUtility::ID_ObjectGroup_PostponementSpecAndFulfillmentRestriction() ), //Postponement spec and fulfillment restriction
|
Form.GetIsIncluded( MPSyncUtility::ID_ObjectGroup_CustomerOrder() ), // customer order
|
isbinary,
|
binaryvalues,
|
broker,
|
is3DDrive,
|
DataHolderFileItems.Data(),
|
fileNames
|
);
|
}
|
|
if ( canimport and guard( smbinaryvalues.Size() >0, false ) )
|
{
|
ScenarioManager.Import( Form.GetIsIncluded( MPSyncUtility::ID_ObjectGroup_Strategies() ), // strategies
|
Form.GetIsIncluded( MPSyncUtility::ID_ObjectGroup_Accounts() ), // accounts
|
Form.GetIsIncluded( MPSyncUtility::ID_ObjectGroup_Bookmarks() ), // bookmarks
|
Form.GetIsIncluded(MPSyncUtility::ID_ObjectGroup_KPISetting() ), // kpi settings
|
smbinaryvalues.Copy(), smbrokers, is3DDrive, DataHolderFileItems.Data(), smFileNames );
|
|
MPSync.Import( Form.GetIsIncluded( MPSyncUtility::ID_ObjectGroup_ImportProfiles() ),
|
smbinaryvalues, smbrokers, is3DDrive, DataHolderFileItems.Data(), smFileNames );
|
}
|
|
if ( not canimport )
|
{
|
WebMessageBox::Information( Translations::MP_Import_MissingFiles( missingFiles.ToString( ', ' ) ) );
|
}
|
|
|
return canimport;
|
*]
|
}
|