Lai,Risheng
2023-11-02 30c02e0c981b16be0918483543f4b812956c45d4
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
53
54
55
56
57
58
Quintiq file version 2.0
#parent: #root
Method ShowAllDay () id:Method_LibCal_dlgEditTimeInterval_ShowAllDay
{
  #keys: '[131094.0.2073180542]'
  Body:
  [*
    // Show the controls according to the state of ckbAllDay.
    if( ckbIsAllDay.Checked() )
    {
      // Set to whole day if this is not yet the case.
      if( durStartTimeOfDay.Duration() <> Duration::Zero() )
      {
        durStartTimeOfDay.Duration( Duration::Zero() );
      }
      
      if( durEndTimeOfDay.Duration() <> Duration::Zero() )
      {
        durEndTimeOfDay.Duration( Duration::Zero() );
    
        // Let the end be the start of the next day.
        dsEndDate.Date( dsEndDate.Date() + 1 );
      }
    
      // Disable the controls.
      durStartTimeOfDay.Enabled( false, "All day selected" );
      durEndTimeOfDay  .Enabled( false, "All day selected" );
    }
    else
    {
      if( durStartTimeOfDay.Duration() <> dhStartTimeOfDay.Data() )
      {
        durStartTimeOfDay.Duration( dhStartTimeOfDay.Data() );
      }
      
      if( durEndTimeOfDay.Duration() <> dhEndTimeOfDay.Data() )
      {
        durEndTimeOfDay.Duration( dhEndTimeOfDay.Data() );
    
        // During initialization, just take over the value from the DataHolder.
        endDate := dsEndDate.Date();
        if( endDate.IsInfinite() )
        {
          endDate := dhEndDate.Data();
        }
        // See if the EndDate must be corrected.
        else if( dhEndTimeOfDay.Data() <> Duration::Zero() )
        {
          endDate := endDate - 1;
        }
        dsEndDate.Date( endDate );
      }
    
      durStartTimeOfDay.Enabled( true, "" );
      durEndTimeOfDay  .Enabled( true, "" );
    }
  *]
}