/// <summary> /// Initializes a new instance of the <see cref="RegistrationInfo" /> class. /// </summary> /// <param name="registration">The registration.</param> /// <param name="rockContext">The rock context.</param> public RegistrationInfo(Registration registration, RockContext rockContext) : this() { if (registration != null) { RegistrationId = registration.Id; if (registration.PersonAlias != null && registration.PersonAlias.Person != null) { FirstName = registration.PersonAlias.Person.NickName; LastName = registration.PersonAlias.Person.LastName; ConfirmationEmail = registration.ConfirmationEmail; } DiscountCode = registration.DiscountCode != null?registration.DiscountCode.Trim() : string.Empty; DiscountPercentage = registration.DiscountPercentage; DiscountAmount = registration.DiscountAmount; TotalCost = registration.TotalCost; DiscountedCost = registration.DiscountedCost; if (registration.PersonAlias != null && registration.PersonAlias.Person != null) { var family = registration.PersonAlias.Person.GetFamilies(rockContext).FirstOrDefault(); if (family != null) { FamilyGuid = family.Guid; } } foreach (var registrant in registration.Registrants) { Registrants.Add(new RegistrantInfo(registrant, rockContext)); } } }
public void RegisterForMessage(Registrant subscriber) { if (subscriber != null) { Registrants.Add(subscriber); } }
public void addRegistrant(Registrant reg) { if (!Registrants.Contains(reg)) { Registrants.Add(reg); } }
public void AddSwimmer(Registrant aSwimmer) { if (Registrants.Contains(aSwimmer)) { throw new Exception(string.Format("Swimmer {0},{1} is already entered", aSwimmer.Name, aSwimmer.Number)); } Registrants.Add(aSwimmer); }
public void RegisterForMessage(Registrant subscriber) { if (subscriber != null) { try { Registrants.Add(subscriber); } catch (PulsarMessageException addRegistrantException) { addRegistrantException.Source = "[MessageQueue:RegisterForMessage]"; addRegistrantException.Message = "Unable to add subscriber to Registrant list."; throw addRegistrantException; } } }
public void AddSwimmer(Registrant aRegistrant) { if (NumRegistrants == 0 || Registrants[NumRegistrants - 1] != aRegistrant) { if (aRegistrant.Club == null || aRegistrant.Club == this) { Registrants.Add(aRegistrant); NumRegistrants++; if (aRegistrant.Club == null) { aRegistrant.Club = this; } } else { throw new Exception(string.Format("Swimmer already assigned to {0} club", aRegistrant.Club.Name)); } } }