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; } } }
public void MoveAppointment() { OwaStoreObjectId owaStoreObjectId = (OwaStoreObjectId)base.GetParameter("Id"); string changeKey = (string)base.GetParameter("CK"); OwaStoreObjectId owaStoreObjectId2 = (OwaStoreObjectId)base.GetParameter("fId"); CalendarItemBase calendarItemBase = null; bool flag = false; if (base.IsParameterSet("chkms")) { flag = (bool)base.GetParameter("chkms"); } try { calendarItemBase = Utilities.GetItem <CalendarItemBase>(base.UserContext, owaStoreObjectId, changeKey, new PropertyDefinition[] { CalendarItemBaseSchema.IsMeeting, CalendarItemBaseSchema.MeetingRequestWasSent, StoreObjectSchema.EffectiveRights }); if (!ItemUtility.UserCanEditItem(calendarItemBase) || Utilities.IsItemInExternalSharedInFolder(base.UserContext, calendarItemBase)) { base.ResponseContentType = OwaEventContentType.Html; this.Writer.Write("<div id=divOp _sOp=np></div>"); } else if (flag && calendarItemBase.IsMeeting && calendarItemBase.MeetingRequestWasSent) { base.ResponseContentType = OwaEventContentType.Html; if (owaStoreObjectId2.IsOtherMailbox) { this.Writer.Write("<div id=divOp _sOp=sfsu></div>"); } else { this.Writer.Write("<div id=divOp _sOp=su></div>"); } } else if (flag && (owaStoreObjectId2.IsOtherMailbox || owaStoreObjectId2.IsGSCalendar)) { this.Writer.Write("<div id=divOp _sOp=sfma></div>"); } else { ExDateTime exDateTime = (ExDateTime)base.GetParameter("ST"); ExDateTime exDateTime2 = (ExDateTime)base.GetParameter("ET"); if (exDateTime > exDateTime2) { exDateTime2 = exDateTime; } calendarItemBase.LocationIdentifierHelperInstance.SetLocationIdentifier(43167U, LastChangeAction.MoveAppointmentTime); calendarItemBase.StartTime = exDateTime; calendarItemBase.EndTime = exDateTime2; calendarItemBase.SetClientIntentBasedOnModifiedProperties(new ClientIntentFlags?(ClientIntentFlags.ModifiedTime)); if (!Utilities.IsPublic(calendarItemBase) && calendarItemBase.IsMeeting && calendarItemBase.MeetingRequestWasSent) { ExTraceGlobals.CalendarTracer.TraceDebug(0L, "Sending meeting update"); if (!calendarItemBase.IsOrganizer()) { throw new OwaEventHandlerException(LocalizedStrings.GetNonEncoded(1360823576)); } calendarItemBase.SendMeetingMessages(true, null, false, true, null, null); } else { ConflictResolutionResult conflictResolutionResult = calendarItemBase.Save(SaveMode.ResolveConflicts); if (conflictResolutionResult.SaveStatus == SaveResult.IrresolvableConflict) { throw new OwaEventHandlerException("Could not save calendar item due to conflict resolution failure", LocalizedStrings.GetNonEncoded(-482397486), OwaEventHandlerErrorCode.ConflictResolution); } } bool flag2 = false; if (base.IsParameterSet("Ntfy")) { flag2 = (bool)base.GetParameter("Ntfy"); } if (flag2) { calendarItemBase.Load(); PrincipalNotificationMessage principalNotificationMessage = new PrincipalNotificationMessage(owaStoreObjectId.ToBase64String(), owaStoreObjectId2, base.UserContext, this.HttpContext, PrincipalNotificationMessage.ActionType.Move, false, calendarItemBase.IsMeeting); principalNotificationMessage.SendNotificationMessage(); } this.RenderPayload(new OwaStoreObjectId[] { owaStoreObjectId2 }); } } catch (ObjectNotFoundException) { ExTraceGlobals.CalendarDataTracer.TraceDebug((long)this.GetHashCode(), "Calendar item could not be found"); throw; } finally { if (calendarItemBase != null) { calendarItemBase.Dispose(); calendarItemBase = null; } } }