public void SaveMeetingCancel()
        {
            ExTraceGlobals.CalendarCallTracer.TraceDebug((long)this.GetHashCode(), "EditMeetingInviteEventHandler.SaveMeetingCancel");
            MeetingCancellation meetingCancellation = null;

            try
            {
                meetingCancellation = base.GetRequestItem <MeetingCancellation>(new PropertyDefinition[0]);
                meetingCancellation[ItemSchema.Subject] = (string)base.GetParameter("Subj");
                Utilities.SaveItem(meetingCancellation);
                meetingCancellation.Load();
                this.Writer.Write("<div id=ck>");
                this.Writer.Write(meetingCancellation.Id.ChangeKeyAsBase64String());
                this.Writer.Write("</div>");
            }
            finally
            {
                if (meetingCancellation != null)
                {
                    meetingCancellation.Dispose();
                    meetingCancellation = null;
                }
            }
        }
Exemplo n.º 2
0
        public void Delete()
        {
            ExTraceGlobals.CalendarCallTracer.TraceDebug((long)this.GetHashCode(), "CalendarViewEventHandler.Delete");
            OwaStoreObjectId owaStoreObjectId  = (OwaStoreObjectId)base.GetParameter("Id");
            OwaStoreObjectId owaStoreObjectId2 = (OwaStoreObjectId)base.GetParameter("fId");
            Item             item             = null;
            CalendarItemBase calendarItemBase = null;
            bool             flag             = true;

            try
            {
                item = Utilities.GetItem <Item>(base.UserContext, owaStoreObjectId, new PropertyDefinition[]
                {
                    StoreObjectSchema.EffectiveRights,
                    CalendarItemBaseSchema.MeetingRequestWasSent,
                    CalendarItemBaseSchema.IsOrganizer
                });
                calendarItemBase = (item as CalendarItemBase);
                if (calendarItemBase != null)
                {
                    if (!CalendarUtilities.UserCanDeleteCalendarItem(calendarItemBase) || Utilities.IsItemInExternalSharedInFolder(base.UserContext, calendarItemBase))
                    {
                        base.ResponseContentType = OwaEventContentType.Html;
                        this.Writer.Write("<div id=divOp _sOp=np></div>");
                        flag = false;
                    }
                    else if (!base.IsParameterSet("FD") && calendarItemBase.IsMeeting && calendarItemBase.MeetingRequestWasSent && calendarItemBase.IsOrganizer())
                    {
                        base.ResponseContentType = OwaEventContentType.Html;
                        this.Writer.Write("<div id=divOp _sOp=sc></div>");
                        flag = false;
                    }
                    else if (!base.IsParameterSet("FD") && !calendarItemBase.IsOrganizer() && !calendarItemBase.IsCancelled && !MeetingUtilities.IsCalendarItemEndTimeInPast(calendarItemBase))
                    {
                        base.ResponseContentType = OwaEventContentType.Html;
                        this.Writer.Write("<div id=divOp _sOp=sr></div>");
                        flag = false;
                    }
                    else if (!base.IsParameterSet("FD") && (owaStoreObjectId2.IsOtherMailbox || owaStoreObjectId2.IsGSCalendar))
                    {
                        base.ResponseContentType = OwaEventContentType.Html;
                        this.Writer.Write("<div id=divOp _sOp=sn></div>");
                        flag = false;
                    }
                }
                else if (!ItemUtility.UserCanDeleteItem(item))
                {
                    base.ResponseContentType = OwaEventContentType.Html;
                    this.Writer.Write("<div id=divOp _sOp=np></div>");
                    flag = false;
                }
                if (flag)
                {
                    bool flag2 = false;
                    if (base.IsParameterSet("Ntfy"))
                    {
                        flag2 = (bool)base.GetParameter("Ntfy");
                    }
                    if (flag2)
                    {
                        PrincipalNotificationMessage principalNotificationMessage = new PrincipalNotificationMessage(owaStoreObjectId.ToBase64String(), owaStoreObjectId2, base.UserContext, this.HttpContext, PrincipalNotificationMessage.ActionType.Delete, false, calendarItemBase.IsMeeting);
                        principalNotificationMessage.SendNotificationMessage();
                    }
                    bool flag3 = false;
                    if (base.IsParameterSet("Prm"))
                    {
                        flag3 = (bool)base.GetParameter("Prm");
                    }
                    DeleteItemFlags deleteItemFlags = DeleteItemFlags.None;
                    if (!owaStoreObjectId2.IsPublic)
                    {
                        if (calendarItemBase.IsOrganizer())
                        {
                            if (calendarItemBase.IsMeeting)
                            {
                                goto IL_269;
                            }
                            deleteItemFlags = DeleteItemFlags.CancelCalendarItem;
                            MeetingCancellation meetingCancellation = null;
                            try
                            {
                                try
                                {
                                    calendarItemBase.OpenAsReadWrite();
                                    meetingCancellation = calendarItemBase.CancelMeeting(null, null);
                                }
                                catch (ObjectNotFoundException)
                                {
                                }
                                catch (AccessDeniedException)
                                {
                                }
                                goto IL_269;
                            }
                            finally
                            {
                                if (meetingCancellation != null)
                                {
                                    meetingCancellation.Dispose();
                                }
                                meetingCancellation = null;
                            }
                        }
                        deleteItemFlags = DeleteItemFlags.DeclineCalendarItemWithoutResponse;
                    }
IL_269:
                    calendarItemBase.DeleteMeeting((flag3 ? DeleteItemFlags.SoftDelete : DeleteItemFlags.MoveToDeletedItems) | deleteItemFlags);
                    this.RenderPayload(new OwaStoreObjectId[]
                    {
                        owaStoreObjectId2
                    });
                }
            }
            catch (ObjectNotFoundException)
            {
                ExTraceGlobals.CalendarDataTracer.TraceDebug((long)this.GetHashCode(), "Calendar item could not be found.");
                throw;
            }
            finally
            {
                if (item != null)
                {
                    item.Dispose();
                    item = null;
                }
            }
        }