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)); }
public IEnumerable <FIL.Contracts.DataModels.EventSchedule> GetAll(int count) { var schedules = new List <FIL.Contracts.DataModels.EventSchedule>(); for (var i = 0; i < count; i++) { var schedule = new FIL.Contracts.DataModels.EventSchedule(); schedule.EventFrequencyTypeId = Contracts.Enums.EventFrequencyType.Recurring; schedule.OccuranceTypeId = Contracts.Enums.OccuranceType.Weekly; schedule.Name = "Jan"; schedule.StartDateTime = DateTime.Now; schedule.EndDateTime = DateTime.Now; schedule.DayId = "1,2,3"; schedule.EventId = 25; schedule.IsEnabled = true; schedule.CreatedBy = System.Guid.NewGuid(); schedule.UpdatedBy = System.Guid.NewGuid(); schedule.CreatedUtc = DateTime.UtcNow; schedules.Add(schedule); } var eventSchedules = _eventScheduleRepository.SaveAll(schedules); return(eventSchedules); }