コード例 #1
0
        public void ChangeCalendarEntryDescription(string tenantId, string calendarEntryId, string description)
        {
            var calendarEntry = _calendarEntryRepository.Get(new Tenant(tenantId), new CalendarEntryId(calendarEntryId));

            calendarEntry.ChangeDescription(description);

            _calendarEntryRepository.Save(calendarEntry);
        }
コード例 #2
0
        public void ScheduleCalendarEntry(string tenantId, string calendarId, string description, string location, string ownerId, DateTime timeSpanBegins, DateTime timeSpanEnds,
                                          string repeatType, DateTime repeatEndsOn, string alarmType, int alarmUnits, ISet <string> participantsToInvite, ICalendarCommandResult calendarCommandResult)
        {
            var tenant = new Tenant(tenantId);

            var calendar = _calendarRepository.Get(tenant, new CalendarId(calendarId));

            var calendarEntry = calendar.ScheduleCalendarEntry(
                _calendarIdentityService,
                description,
                location,
                _collaboratorService.GetOwnerFrom(tenant, ownerId),
                new DateRange(timeSpanBegins, timeSpanEnds),
                new Repetition((RepeatType)Enum.Parse(typeof(RepeatType), repeatType), repeatEndsOn),
                new Alarm((AlarmUnitsType)Enum.Parse(typeof(AlarmUnitsType), alarmType), alarmUnits),
                GetInviteesFrom(tenant, participantsToInvite));

            _calendarEntryRepository.Save(calendarEntry);

            calendarCommandResult.SetResultingCalendarId(calendar.CalendarId.Id);
            calendarCommandResult.SetResultingCalendarEntryId(calendarEntry.CalendarEntryId.Id);
        }