private FIL.Contracts.DataModels.EventSchedule SaveEventSchedule(FIL.Contracts.Commands.CreateEventV1.EventRecurranceCommand eventRecurranceCommand) { var eventSchedule = new FIL.Contracts.DataModels.EventSchedule { EventId = eventRecurranceCommand.EventId, DayId = eventRecurranceCommand.DayIds, EventFrequencyTypeId = eventRecurranceCommand.EventFrequencyType, OccuranceTypeId = eventRecurranceCommand.OccuranceType, StartDateTime = _commonUtilityProvider.GetUtcDate(eventRecurranceCommand.StartDateTime, eventRecurranceCommand.LocalStartTime, eventRecurranceCommand.TimeZoneOffSet), EndDateTime = _commonUtilityProvider.GetUtcDate(eventRecurranceCommand.EndDateTime, eventRecurranceCommand.LocalEndTime, eventRecurranceCommand.TimeZoneOffSet), Name = eventRecurranceCommand.StartDateTime.ToString() + " - " + eventRecurranceCommand.EndDateTime.ToString(), IsEnabled = true, CreatedBy = eventRecurranceCommand.ModifiedBy, CreatedUtc = DateTime.UtcNow, ModifiedBy = eventRecurranceCommand.ModifiedBy, UpdatedBy = eventRecurranceCommand.ModifiedBy, UpdatedUtc = DateTime.UtcNow }; return(_eventScheduleRepository.Save(eventSchedule)); }
protected void SaveEventSchedule(FIL.Contracts.Commands.CreateEventV1.EventRecurranceCommand eventRecurranceCommand) { if (eventRecurranceCommand.ActionType == Contracts.Commands.CreateEventV1.ActionType.BulkReschedule) { var eventSchedule = _eventScheduleRepository.Get(eventRecurranceCommand.EventScheduleId); eventSchedule.StartDateTime = _commonUtilityProvider.GetUtcDate(eventRecurranceCommand.StartDateTime, eventRecurranceCommand.LocalStartTime, eventRecurranceCommand.TimeZoneOffSet); eventSchedule.EndDateTime = _commonUtilityProvider.GetUtcDate(eventRecurranceCommand.StartDateTime, eventRecurranceCommand.LocalStartTime, eventRecurranceCommand.TimeZoneOffSet); eventSchedule.Name = eventRecurranceCommand.StartDateTime.ToString() + " - " + eventRecurranceCommand.EndDateTime.ToString(); eventSchedule.ModifiedBy = eventRecurranceCommand.ModifiedBy; eventSchedule.UpdatedBy = eventRecurranceCommand.ModifiedBy; eventSchedule.UpdatedUtc = DateTime.UtcNow; _eventScheduleRepository.Save(eventSchedule); } }