Exemplo n.º 1
0
        protected override VoidResult OnExecute()
        {
            this.Validate();
            MeetingRequestMessageDataProvider meetingRequestMessageDataProvider = this.Scope.MeetingRequestMessageDataProvider;
            string        changeKey = (this.Context == null) ? null : this.Context.IfMatchETag;
            StoreObjectId id        = this.Scope.IdConverter.ToStoreObjectId(this.Parameters.MeetingRequestIdToBeDeleted);
            string        key;

            using (IMeetingRequest meetingRequest = meetingRequestMessageDataProvider.BindToWrite(id, changeKey))
            {
                StoreId storeId = meetingRequestMessageDataProvider.GetCorrelatedItemId(meetingRequest);
                if (storeId == null)
                {
                    storeId = this.CreateCorrelatedEvent(meetingRequest);
                }
                key = this.Scope.IdConverter.ToStringId(storeId, this.Scope.Session);
            }
            this.Scope.Events.Respond(key, this.Parameters, this.Context);
            return(VoidResult.Value);
        }
Exemplo n.º 2
0
        protected virtual StoreId CreateCorrelatedEvent(IMeetingRequest meetingRequest)
        {
            CalendarItemBase calendarItemBase = null;
            StoreId          result           = null;

            try
            {
                if (meetingRequest.TryUpdateCalendarItem(ref calendarItemBase, meetingRequest.IsDelegated()))
                {
                    calendarItemBase.Save(SaveMode.NoConflictResolution);
                    this.Scope.MeetingRequestMessageDataProvider.SaveMeetingRequest(meetingRequest, this.Context);
                    result = calendarItemBase.Id;
                }
            }
            finally
            {
                if (calendarItemBase != null)
                {
                    calendarItemBase.Dispose();
                }
            }
            return(result);
        }