public void CancelMeeting(string roomAddress, string uniqueId, string securityKey)
        {
            var meeting = SecurityCheck(roomAddress, uniqueId, securityKey);

            if (meeting.IsNotManaged)
            {
                throw new Exception("Cannot manage this meeting");
            }
            _meetingRepository.CancelMeeting(uniqueId);

            using (_concurrencyLimiter.StartOperation())
            {
                var item = Appointment.Bind(_exchangeService, new ItemId(uniqueId));
                log.DebugFormat("Cancelling {0} for {1}, which should start at {2}", uniqueId, roomAddress, item.Start);
                var now = _dateTimeService.Now.TruncateToTheMinute();
                if (now >= item.Start)
                {
                    item.End = now;
                }
                else
                {
                    item.End = item.Start;
                }
                item.Update(ConflictResolutionMode.AlwaysOverwrite, SendInvitationsOrCancellationsMode.SendToNone);

                SendEmail(item, string.Format("Your meeting '{0}' in {1} has been cancelled.", item.Subject, item.Location), "If you want to keep the room, use the conference room management device to start a new meeting ASAP.");

                BroadcastUpdate(roomAddress);
            }
        }
        public void _CancelMeeting(IRoom room, string uniqueId)
        {
            _meetingRepository.CancelMeeting(room.OrganizationId, uniqueId);

            var item = ExchangeServiceExecuteWithImpersonationCheck(room.RoomAddress, svc =>
            {
                var appt = Appointment.Bind(svc, new ItemId(uniqueId));
                __log.DebugFormat("Cancelling {0} for {1}/{2}, which should start at {3}", uniqueId, room.RoomAddress, room.Id, appt.Start);
                var now = _dateTimeService.Now.TruncateToTheMinute();
                if (now >= appt.Start)
                {
                    appt.End = now;
                }
                else
                {
                    appt.End = appt.Start;
                }
                appt.Update(ConflictResolutionMode.AlwaysOverwrite, SendInvitationsOrCancellationsMode.SendToNone);
                return(appt);
            });

            SendEmail(room, item,
                      string.Format("Your meeting '{0}' in {1} has been cancelled.", item.Subject, item.Location),
                      "<p>If you want to keep the room, use the RoomNinja on the wall outside the room to start a new meeting ASAP.</p>");

            BroadcastUpdate(room);
        }
Пример #3
0
        private async Task _CancelMeeting(IRoom room, CalendarEntry meeting)
        {
            _meetingRepository.CancelMeeting(room.OrganizationId, meeting.Id);

            await _exchange.Truncate(room.RoomAddress, meeting, _dateTimeService.Now.TruncateToTheMinute());

            await SendEmail(room, meeting,
                            string.Format("Your meeting '{0}' in {1} has been cancelled.", meeting.Subject, room.RoomAddress),
                            "<p>If you want to keep the room, use the RoomNinja on the wall outside the room to start a new meeting ASAP.</p>");

            await BroadcastUpdate(room);
        }