陈清红
2025-04-14 880f3c0257eeb8c37761d484258fdd102a369a19
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
Quintiq file version 2.0
#parent: #root
Method CreateUpdateEventAndParticipation () as LibCal_Event id:Method_LibCal_dlgMultipleEvent_CreateUpdateEventAndParticipation
{
  #keys: '[415136.0.649421703]'
  Body:
  [*
    sEvent    := dhEvent.Data();
    sLeadPart := dhLeadingParticipation.Data();
    
    // Get the values from the controls.
    
    // Event and LeadingParticipation
    subject        := edtName.Text();
    description    := edtDescription.Text();
    eventTypeList  := ddlEventType.Data();
    category       := sEvent.EventCategory(); 
    isDefault      := ckbApplyToNewResources.Checked();
    startDate      := dsStartDate.Date();
    startTimeOfDay := durStartTimeOfDay.Duration();
    endDate        := dsEndDate.Date();
    endTimeOfDay   := durEndTimeOfDay.Duration();
    isAllDay       := ckbIsAllDay.Checked();
    
    eventType := ddslType.Text();
    capacity  := Real::MinReal();  // Always fill the capacity.
    
    // RecurrencePattern
    isRecurring        := true;
    recurrenceInterval := 1;
    patternType        := LibCal_RecurrencePattern::TYPE_DAILY();
    
    // Daily
    daily_IsEveryWeekday := false;
    
    // Weekly
    weekly_Weekdays := "";
    
    // Monthly
    monthly_IsDay       := false;
    monthly_Day         := 0;
    monthly_WeekOfMonth := '';
    monthly_DayOfWeek   := '';
    
    // Yearly
    yearly_IsDate      := false;
    //month              := '';
    yearly_Month       := 0;
    yearly_Day         := 0;
    yearly_WeekOfMonth := '';
    yearly_DayOfWeek   := '';
    
    // RecurrencePeriod
    periodType      := LibCal_RecurrencePeriod::TYPE_NROFOCCURRENCES();
    periodStartDate := dsStartDate.Date();
    periodEndDate   := startDate + 1;
    nrOfOccurrences := 1;
    
    // All values are passed to the Server, only the relevant values are used there.
    event := LibCal_Event::CreateUpdateFromUI( sEvent.Calendar(), sLeadPart.WrappedInstance(),
                                               subject, description, eventType, eventTypeList, capacity, category, isDefault,
                                               startDate, startTimeOfDay, endDate, endTimeOfDay, isAllDay,
                                               // RecurrencePattern
                                               isRecurring, recurrenceInterval, patternType,
                                               daily_IsEveryWeekday,
                                               weekly_Weekdays,
                                               monthly_IsDay, monthly_Day,  monthly_WeekOfMonth, monthly_DayOfWeek,
                                               yearly_IsDate, yearly_Month, yearly_Day, yearly_WeekOfMonth, yearly_DayOfWeek,
                                               // RecurrencePeriod
                                               periodType, periodStartDate, nrOfOccurrences, periodEndDate,
                                               // Subscribers
                                               dhSubscribers.Data(), true );
    
    return event;
  *]
}