| | |
| | | |
| | | //只有通过批量创建界面且已有同名事件进入下面操作 |
| | | if( ismultiple and not isnull( event ) ){ |
| | | event.IsMultiple( true ); |
| | | lp := event.LeadingParticipation(); |
| | | timezone := lp.Calendar().GetTimeZone(); |
| | | starttime := startDate_i.DateTime( timezone ).AddAsPeriod( timezone, startTimeOfDay_i ); |
| | | endtime := endDate_i.DateTime( timezone ).AddAsPeriod( timezone, endTimeOfDay_i ); |
| | | etis := selectset( lp, Subscription.ExplicitTimeInterval, eti, true ); |
| | | // startDate := starttime.Date( timezone ); |
| | | // endDate := endtime.Date( timezone ) - ifexpr( endtime = endtime.StartOfDay( timezone ), 1, 0 ); |
| | | lp.AddSubscribers( subscribers_i, true );; |
| | | leadingETI := selectobject( lp, ExplicitTimeInterval, eti, eti.Start() = starttime and eti.End() = endtime ); |
| | | |
| | | if( isnull( leadingETI ) ){ |
| | | leadingETI := lp.CreateTimeInterval( starttime, endtime, event.Capacity() ); |
| | | } |
| | | // info( '-----------------------2-----------------', lp.ExplicitTimeInterval( relsize ) ); |
| | | lp.AddSubscribers( subscribers_i, true ); |
| | | |
| | | if( not isnull( leadingETI ) ){ |
| | | traverse( lp, Subscription, subscription, subscribers_i.Find( subscription.Calendar() ) >= 0 ){ |
| | | traverse( subscription, ExplicitTimeInterval, eti, not ( eti.Start() = starttime and eti.End() = endtime ) ){ |
| | | |
| | | traverse( subscription, ExplicitTimeInterval, eti, etis.Find( eti ) < 0 ){ |
| | | eti.Delete(); |
| | | } |
| | | subscribingETI := subscription.CreateTimeInterval( starttime, endtime, event.Capacity() ); |
| | | if( not isnull( subscribingETI ) ){ |
| | | subscribingETI.LeadingETI( relset, leadingETI ); |
| | | } |
| | | } |
| | | } |
| | |
| | | patternType_i, patternDaily_IsEveryWeekday_i, patternWeekly_Weekdays_i, |
| | | patternMonthly_IsDay_i, patternMonthly_Day_i, patternMonthly_WeekOfMonth_i, patternMonthly_DayOfWeek_i, |
| | | patternYearly_IsDate_i, patternYearly_Month_i, patternYearly_Day_i, patternYearly_WeekOfMonth_i, patternYearly_DayOfWeek_i, |
| | | periodType_i, periodStartDate_i, nrOfOccurrences_i, periodEndDate_i, subscribers_i ); |
| | | periodType_i, periodStartDate_i, nrOfOccurrences_i, periodEndDate_i, subscribers_i, ismultiple ); |
| | | } |
| | | |
| | | if( not isnull( event ) ){ |
| | | event.EventType( relset, eventtype_i ); |
| | | } |
| | | if( ismultiple ){ |
| | | event.IsMultiple( ismultiple ); |
| | | } |
| | | |
| | | return event; |
| | | *] |
| | | } |