chenqinghong
2024-05-07 3ec06a830367465068963156dcc1d8e522571c13
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
Quintiq file version 2.0
#parent: #root
Method UpdateTextualInfo () id:Method_LibCal_dlgEvent_UpdateTextualInfo
{
  #keys: '[146730.0.1532612650]'
  Body:
  [*
    // Skip if the StartDate is not initialized yet.
    if( dsStartDate.Date().IsFinite() )
    {
      value       := "";
      patternType := this.GetPatternType();
      periodType  := this.GetPeriodType();
      timezone    := this.GetCalendarTimeZone();
      
      if( patternType = LibCal_RecurrencePattern::TYPE_NONE() )
      {
        // No recurrence
        value := LibCal_Participation::GetInfoNonRecurring( dsStartDate.Date(), durStartTimeOfDay.Duration(),
                                                            dsEndDate  .Date(), durEndTimeOfDay  .Duration(),
                                                            timezone, dhDuration.Data() );
      }
      
      else
      {
        // RecurrencePattern
        if( patternType = LibCal_RecurrencePattern::TYPE_DAILY() )
        {
          value := LibCal_RecurrencePatternDaily::GetInfo( this.GetRecurrenceInterval(),
                                                           ckbEveryWeekday.Checked() );
        }
      
        else if( patternType = LibCal_RecurrencePattern::TYPE_WEEKLY() )
        {
          value := LibCal_RecurrencePatternWeekly::GetInfo( this.GetRecurrenceInterval(),
                                                            btnMonday  .IsPressed(), btnTuesday.IsPressed(), btnWednesday.IsPressed(),
                                                            btnThursday.IsPressed(), btnFriday .IsPressed(), btnSaturday .IsPressed(), btnSunday.IsPressed() );
        }
      
        else if( patternType = LibCal_RecurrencePattern::TYPE_MONTHLY() )
        {
          value := LibCal_RecurrencePatternMonthly::GetInfo( this.GetRecurrenceInterval(), ckbMonthlyDay.Checked(),
                                                             [Number]edtMonthlyDay.Text(),
                                                             lblMonthlyPatternWeekOfMonth.Text(), lblMonthlyPatternDayOfWeek.Text() );
        
        }
      
        else if( patternType = LibCal_RecurrencePattern::TYPE_YEARLY() )
        {
          yearly_IsDate := ckbYearlyDay.Checked();
          month         := ifexpr( yearly_IsDate, lblYearlyMonth.Text(), lblYearlyPatternMonth.Text() );
          
          value := LibCal_RecurrencePatternYearly::GetInfo( this.GetRecurrenceInterval(), yearly_IsDate,
                                                            this.GetNrOfMonth( month ), [Number]lblYearlyDayOfMonth.Text(),
                                                            lblYearlyPatternWeekOfMonth.Text(),  lblYearlyPatternDayOfWeek.Text() );
        }
      
        fromTo := " from  " + durStartTimeOfDay.Duration().Format( "H:m" )
                + " to "    + durEndTimeOfDay.Duration()  .Format( "H:m" );
      
        value := value + fromTo;
      
        // RecurrencePeriod
        periodText      := "";
        periodStartDate := dsStartOfPeriod.Date();
        periodEndDate   := dsEndOfPeriod.Date();
        nrOfOccurrences := [Number]edtNrOfOccurrences.Text();
        
        if( periodType = LibCal_RecurrencePeriod::TYPE_WITHOUTEND() )
        {
          periodText := LibCal_RecurrencePeriodWithoutEnd::GetInfo( periodStartDate );
        }  
        
        else if( periodType = LibCal_RecurrencePeriod::TYPE_NROFOCCURRENCES() )
        {
          periodText := LibCal_RecurrencePeriodNrOfOccurrences::GetInfo( periodStartDate, nrOfOccurrences, periodEndDate );
        }  
      
        else if( periodType = LibCal_RecurrencePeriod::TYPE_WITHENDDATE() )
        {
          periodText := LibCal_RecurrencePeriodWithEndDate::GetInfo( periodStartDate, periodEndDate );
        }
        
        value := value + ", " + periodText;
      }
      
      lblInformation.Text( "Occurs " + value );
    }
  *]
}