yanyuan
2023-11-10 143ef74e2eeee697ac8fda3d9032a790fbb4e146
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
52
Quintiq file version 2.0
#parent: #root
Method Edit () id:Method_LibDEF_DialogEditEventCleanupDaemon_Edit
{
  #keys: '[143398.0.685637420]'
  Body:
  [*
    // Edit cleanup integration event daemon properties
    daemonName := LibDEF_DataBroker::DAEMONNAME_CleanupIntegrationEvent();
    
    daemon     := select( LibDEF_DataBroker.MDSLibDEF_DataBroker(), MDSObjectDaemons, daemon,
                          daemon.Name() = daemonName );
    
    if( not isnull( daemon ) )
    {
      lblName.Text( daemon.Name() );
      // the daemon is enabled if the frequency is not zero
      if( daemon.LocalFrequency() <> Duration::Zero() )
      {
        cbEnableDaemon.Checked( daemon.LocalFrequency() <> Duration::Zero() );
        dsDaemonFrequency.Duration( daemon.LocalFrequency() );
        if( TimeZone::HasTimeZoneSupport() )
        {
          // For timezone-aware, GMT time is needed for the selector.
          dtsDaemonStartTime.DateTime( daemon.LocalStartGMTTime() );
        }
        else
        {
          // For legacy mode, the correct datetime is constructed from StartDate and StartTimeOfDay.
          timezone  := TimeZone::Construct( this.GetUserTimeZoneID() );
          startTime := daemon.LocalStartDate().Add( timezone, daemon.LocalStartTimeOfDay() );
          dtsDaemonStartTime.DateTime( startTime );
        }
      }
      else
      {
        // set the default values
        dsDaemonFrequency.Duration( LibDEF_DataBroker::DAEMONDEFAULTFREQUENCY_CleanupIntegrationEvent() );
        dtsDaemonStartTime.DateTime ( this.GetLastSundayOfDataBroker() );
      }
    
      this.Show( "modal" );
    }
    else
    {
      WebMessageBox::Warning( Application,
                           "Daemon '" + daemonName + "' is not found in LibDMF_DataBroker dataset." + String::NewLine() +
                           "Please make sure it is created.",
                           "OK" );
    }
  *]
}