Пример #1
0
        private PSCalendarContract.Dto.Event ConvertEvent(Google.Apis.Calendar.v3.Data.Event googleEvent)
        {
            var mapper = AutomapperConfiguration.dtoConfig.CreateMapper();

            PSCalendarContract.Dto.Event @event = mapper.Map <Google.Apis.Calendar.v3.Data.Event, PSCalendarContract.Dto.Event>(googleEvent);
            return(@event);
        }
Пример #2
0
        private void AddGoogleEventToPSTable(string calendarId, Google.Apis.Calendar.v3.Data.Event googleEvent)
        {
            PSCalendarContract.Dto.Event @event = ConvertEvent(googleEvent);
            @event.Type = this.CalendarList.Single(x => x.Value == calendarId).Key;
            Guid eventGuid = CalendarCoreBL.AddEvent(@event);

            CalendarSyncBL.AddSyncAccountEvent(Account, eventGuid, googleEvent.Id, calendarId);
            CalendarSyncBL.UpdateLogItem(eventGuid, googleEvent.Updated.Value);
        }