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
34
35
36
37
38
39
40
Quintiq file version 2.0
#parent: #root
Method Update (
  Date startDate_i,
  Date endDate_i
)
{
  TextBody:
  [*
    // First validate the dates.
    // Use a FeedbackObject to collect the validation feedback.
    feedback := LibCal_Validate::FeedbackObject();
    
    LibCal_Validate::Participation_StartDate_EndDate( startDate_i, endDate_i );
    
    // Process the feedback that has been registered by the validation (if any).
    LibCal_Util::ProcessFeedbackObject( feedback );
    
    // The below is only executed when no validation errors were encountered.
    // Register if there are changes.
    isChanged := this.StartDate() <> startDate_i
              or this.EndDate()   <> endDate_i;
    
    if( isChanged )
    {
      this.IsChanged( true );
    }
    
    this.StartDate( startDate_i );
    this.EndDate(   endDate_i   );
    
    // Also update the Subscriptions
    traverse( this, Subscription, subscription )
    {
      subscription.StartDate( startDate_i );
      subscription.EndDate(   endDate_i   );
    }
  *]
  InterfaceProperties { Accessibility: 'Module' }
}