chenqinghong
2024-05-07 3ec06a830367465068963156dcc1d8e522571c13
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
39
40
41
42
43
44
45
46
47
48
49
50
51
Quintiq file version 2.0
#parent: #root
StaticMethod CanImportFromDataManager (
  output String feedback_o,
  ScenarioManager scenariomanager,
  Boolean hassalesdemand,
  String salesdemandselection,
  Boolean ismpscdef,
  Boolean hasscmpparams,
  String scmpparams,
  Boolean hasscplan,
  String scplan,
  Boolean invalidexcelpath
) declarative remote as Boolean
{
  Description: 'Check whether we can import from data manager.'
  TextBody:
  [*
    // Adhi Nov-27-2015 (created)
    
    canImport := true
    feedback_o := '';
    
    isSDValid := hassalesdemand and not salesdemandselection = '';
    isSCMPValid :=  hasscmpparams and not scmpparams = '';
    isSCPlanValid :=  hasscplan and not scplan = '';
    eitherPlan := hasscmpparams or hasscplan
    
    if( ismpscdef )
    {
      canImport := isSDValid or isSCMPValid or isSCPlanValid;
      if( not canImport )
      {
        feedback_o := Translations::MP_GlobalParameters_MP_CanImportFromDataManager_InvalidImport();
      }
    }
    else
    {
      canImport := eitherPlan and not invalidexcelpath or isSDValid;
      if( invalidexcelpath )
      {
        feedback_o := Translations::MPSync_ImportProfile_ValidateInput_IsInvalidExcelPath();
      }
      else
      {
        feedback_o := Translations::MP_GlobalParameters_MP_CanImportFromDataManager_InvalidImport();
      }
    }
    return canImport;
  *]
}