public void AddEventToSeries(EventSeries es) { if (es == null) { throw new ArgumentNullException("Cannot assign Event to null Event Series object.", nameof(es)); } else { EventSeriesId = es.Id; } }
public Event( EventType type, Address location, User owner, EventSeries series, string title, string description, DateTime startDate, DateTime endDate, DateTime registrationOpenDate, DateTime?registrationClosedDate = null, int maxRegistrations = 1, int minRegistrations = 0, bool allowStandbyRegistrations = false, int maxStandbyRegistrations = 0, string fundCenter = "" ) { UpdateEventType(type); UpdateEventLocation(location); UpdateOwner(owner); if (series == null) { RemoveEventFromSeries(); } else { AddEventToSeries(series); } UpdateTitle(title); UpdateDescription(description); UpdateEventDates(startDate, endDate); UpdateRegistrationPeriodDates(registrationOpenDate, registrationClosedDate); if (maxRegistrations > 0) { UpdateMaximumRegistrationsAllowedCount((uint)maxRegistrations); } else { UpdateMaximumRegistrationsAllowedCount(1); } UpdateMinimumRegistrationRequiredCount((uint)minRegistrations); if (allowStandbyRegistrations && maxStandbyRegistrations > 0) { AllowStandByRegistrations((uint)maxStandbyRegistrations); } else { PreventStandByRegistrations(); } UpdateFundCenter(fundCenter); _registrations = new List <Registration>(); }