lazhen
2025-01-09 8afe90b633046db39042aada36b88193062f8cff
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
Quintiq file version 2.0
#parent: #root
Method ValuesRecurrenceIntervalOK () as Boolean id:Method_LibCal_dlgEvent_ValuesRecurrenceIntervalOK
{
  #keys: '[131092.1.1298272]'
  Body:
  [*
    feedback    := FeedbackObject::LocalFeedback();
    patternType := this.GetPatternType();
    unit        := "";
    
    if( patternType = LibCal_RecurrencePattern::TYPE_DAILY() and 
        guard( [Number]edtEveryNrOfDays.Text(), 0 ) = 0 )
    { 
      unit := "days";
    }
    
    else if( patternType = LibCal_RecurrencePattern::TYPE_WEEKLY() and
        guard( [Number]edtEveryNrOfWeeks.Text(), 0 ) = 0 )
    { 
      unit := "weeks";
    }
    
    else if( patternType = LibCal_RecurrencePattern::TYPE_MONTHLY() and
             ( ( ckbMonthlyDay.Checked()     and guard( [Number]edtMonthlyDayEveryNrOfMonths.Text(),     0 ) = 0 ) or
               ( ckbMonthlyPattern.Checked() and guard( [Number]edtMonthlyPatternEveryNrOfMonths.Text(), 0 ) = 0 ) ) )
    { 
      unit := "months";
    }
    
    else if( patternType = LibCal_RecurrencePattern::TYPE_YEARLY() and
             guard( [Number]edtEveryNrOfYears.Text(), 0 ) = 0 )
    { 
      unit := "years";
    }
    
    if( unit <> "" )
    {
      feedback.AddHard( Translations::Pattern_InvalidRecurrenceInterval( unit ) );
    }
    
    return feedback.IsAllowed();
  *]
}