//For a recurring event public EventModel(string id, string name, string description, TimeSpan eventStart, TimeSpan eventEnd, DateTime recurrenceStart, DateTime recurrenceEnd, DayOfWeek occurrenceDay, ProgramType type) { Occurrences = new List <EventOccurrence>(); RecurringOccurrences = new List <RecurringEventOccurrence>(); Blackouts = new List <EventBlackout>(); Id = id; Name = name; Description = description; ProgramCategory = type.Name; RecurringEventOccurrence returringOccurrence = new RecurringEventOccurrence(eventStart, eventEnd, occurrenceDay, recurrenceStart, recurrenceEnd); RecurringOccurrences.Add(returringOccurrence); }
//For a single-time event public EventModel(string id, string name, string description, DateTime eventStart, DateTime eventEnd, ProgramType type) { Occurrences = new List <EventOccurrence>(); RecurringOccurrences = new List <RecurringEventOccurrence>(); Blackouts = new List <EventBlackout>(); Id = id; Name = name; Description = description; ProgramCategory = type.Name; EventOccurrence singleTimeOccurrence = new EventOccurrence(id, eventStart, eventEnd); Occurrences.Add(singleTimeOccurrence); }