yanweiyuan3
2023-10-27 d1d15b61dfcf7fd0f800b32359f082cf580ed556
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
Quintiq file version 2.0
#parent: #root
Method DeleteEventsOrSubscriptions (
  structured[LibCal_Participation] participations_i
) id:Method_LibCal_GlobalState_DeleteEventsOrSubscriptions_870
{
  #keys: '[146730.0.131272267]'
  Body:
  [*
    if( participations_i.Size() = 1 )
    {
      // Give more accurate feedback when there is only one participation selected.
      this.DeleteEventOrSubscription( participations_i.Element( 0 ) );
    }
    else
    {
      subject   := "the selected " + ifexpr( participations_i.Element( 0 ).IsSubscription(), "subscriptions", "events" );
      title     := "Delete "       + ifexpr( participations_i.Element( 0 ).IsSubscription(), "Subscriptions", "Events" );
      defButton := 0;
      
      if( WebMessageBox::Question( Translations::MessageBox_ConfirmDeletion( subject ),
                                   Translations::MessageBox_YesNo(),
                                   defButton, title ) = 0 )
      {
        // When the selection consists of LeadingParticipations their accompanying Events will also be deleted.
        LibCal_Participation::Delete( participations_i );
      }
    }
  *]
}