陈清红
2025-04-14 880f3c0257eeb8c37761d484258fdd102a369a19
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
Method Edit (
  GlobalParameters_MP selection,
  internal[GUIComponent] parent
) id:Method_DialogEditGlobalParameter_Edit
{
  #keys: '[108486.1.1039359704]'
  Body:
  [*
    // Edit global parameter
    
    data := shadow( selection );
    Dialog.Data( data );
    
    result := Dialog.DoModal(  parent );
    
    if ( result > 0  )
    {
      edit := true;
      hasnewleadtimestrategy := false;
      // Prompt user with warning that plan will be reset in case of change of lead time strategy
      if( ApplicationLibMacroPlanner.GetChangeOfLeadTimeStrategyWarningDialog( selection,
                                                                            hasnewleadtimestrategy,
                                                                            Dialog.StringSelectionLanesLeadTimeLogic().Text(),
                                                                            Dialog.StringSelectionOperationLeadTimeLogic().Text() ) )                                                    
      {
        selection.HasNewLeadTimeStrategy( hasnewleadtimestrategy );
      
        if( selection.StartOfKPIHorizon() <> Dialog.GUIDateTimeSelectorStartOfKPIHorizon().DateTime().Date()
            or selection.EndOfKPIHorizon() <> Dialog.GUIDateTimeSelectorEndOfKPIHorizon().DateTime().Date() )
        {
          selection.HasNewKPIHorizon( true );
        }
    
      }   
      else
      {
        // Cancel action
        edit := false;
      }
    
      if( edit )
      {
       // Prompt message to warn user on forecast netting rule changed
       ApplicationLibMacroPlanner.GetChangeOfForecastNettingRuleWarningDialog( selection, Dialog.StringSelectionForecastNettingRule().Text() );
       data.Commit();
      }
    }
  *]
}