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
Quintiq file version 2.0
#parent: #root
Method Synchronize (
  LibCal_StagingEvent stagingEvent_i
)
{
  TextBody:
  [*
    // Calculate EndTimeOfDay. It is not imported because this is error prone
    // (Duration and EndTimeOfDay can easily get out of sync by manual editing).
    endTimeOfDay := ( stagingEvent_i.StartTimeOfDay() + stagingEvent_i.Duration() ) mod Duration::Hours( 24 );
    isFromUI     := false;
    
    this.Update( stagingEvent_i.Subject(), stagingEvent_i.Description(), stagingEvent_i.Type(), stagingEvent_i.PartialCapacity(), stagingEvent_i.IsDefault(), 
                 stagingEvent_i.StartTimeOfDay(), endTimeOfDay, stagingEvent_i.Duration(), stagingEvent_i.IsAllDay(), isFromUI );
    
    // When the category is not found, the event is assigned to the general category.
    this.SetCategory( stagingEvent_i.Category() );
    
    // Also synchronize the RecurrencePattern.
    this.SynchronizeRecurrencePattern( stagingEvent_i );
  *]
}