yanweiyuan3
2023-08-09 588bc7829387dfc761cc25f06f77d4c81818bd10
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
Quintiq file version 2.0
#parent: #root
Method ShowHideComponents () id:Method_DialogCreateEditStrategy_ShowHideComponents
{
  #keys: '[146140.2.142759628]'
  Body:
  [*
    // Show / hide components
    
    data := DataHolderDialogData.Data();
    inbound := exists( data, KPIWeight, kpiw, kpiw.KPI().IsMaximize() and kpiw.Level() = 1 );
    invalidkpi := guard( not data.IsValidKPIWeight(), false )
    procminqtyissue := exists( data, KPIWeight, kpiw, true, kpiw.KPIName() = Translations::MP_GlobalParameters_KPIProcessMinimumQuantity() and kpiw.Level() > 1 );      
    isvisible := inbound or invalidkpi or procminqtyissue;
    text :='';
    ImageOptimizerUnbounded.Visible( isvisible );     
    
    if( inbound )
    {
      text := Translations::MP_Designer_InboundStrategy_Warning();
    }
    else if( invalidkpi )
    {
      invalidkpiweightname := guard( select( data, InvalidKPIWeight, kpiweight, true ).KPIName(), "" )
      text := Translations::Strategy_CanCopy_IsKPIWeightOK( invalidkpiweightname );
    }
    else if ( procminqtyissue ) 
    {
      text := Translations::MP_Designer_ProcessMinQtyWarning();  
    }
    ImageOptimizerUnbounded.Tooltip( text );
  *]
}