admin
2025-01-22 7e31442f0e9b07764e9c6a9680d3d4aeba5fe1de
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
Quintiq file version 2.0
#parent: #root
Method EditEvent (
  LibCal_LeadingParticipation leadPart_i
) id:Method_LibCal_dlgEvent_EditEvent #extension
{
  Body:
  [*
    // Set the Event and the related controls.
    // The values are explicitly assigned here 'at the beginning' to the controls,
    // so that the values can be used by the rest of the logic. Databinding is executed too late for that.
    // Further initialization is done in the OnCreated of the Dialog.
    sEvent := shadow( leadPart_i.Event() );
    dhEvent.Data( &sEvent );
    this.SetEventData();
    
    // Set the Participation and the related controls
    // (only the DataHolders, the Date-controls are set later on, after the recurrence has been initialized)
    sLeadPart := shadow( leadPart_i );
    dhStartDate.Data( sLeadPart.StartDate() );
    dhEndDate.Data(   sLeadPart.EndDate()   );
    dhLeadingParticipation.Data( &sLeadPart );
    
    // Initialize the capacity here, when done in the OnCreated() edtCapacity is not enabled correctly when the type is Capacity.
    this.InitializeCapacity();
    
    // Must be done here, when done in the OnCreated() there is no selection in the DropDownList.
    this.InitializeCategories();
    this.InitializeEventTypes();
    // Must be done here, when done in the OnCreated() the checkmarks are not always set.
    this.InitializeSubscribers();
    if( guard( sEvent.EventCategory().Name() = LibCal_Event::TYPE_UNAVAILABLE(), false ) )
    {
      pnlEventType.Visible( true );
    }else
    {
      pnlEventType.Visible( false );
    }
    ddlEventType.Data( sEvent.EventType() );
    // Open the dialog.
    this.Show( "modal" );
  *]
}