/// <summary> /// Creates the attendee. /// </summary> /// <param name="attendeeDto">The attendee dto.</param> /// <returns></returns> public static EventAttendee CreateAttendee(AttendeeDto attendeeDto) { var name = new PersonName(attendeeDto.FirstName, attendeeDto.LastName); var address = new Address(attendeeDto.Address1, attendeeDto.Address2, attendeeDto.City, attendeeDto.StateId, attendeeDto.PostalCode); var phone = new PhoneNumber(attendeeDto.PrimaryPhone); var email = new EmailAddress(attendeeDto.EmailAddress); var attendee = new EventAttendee(name, address, email, phone, attendeeDto.FirstName, attendeeDto.LastName, attendeeDto.DynamicColumnsData, attendeeDto.ProfileId, attendeeDto.UserId, attendeeDto.DidAttend); return attendee; }
/// <summary> /// Converts an AttendeeDto to a UserProfileDto /// </summary> /// <param name="attendee">The attendee dto.</param> /// <returns>The user profile dto.</returns> public static UserProfileDto ConvertToUserProfileDto(AttendeeDto attendee) { var userProfileDto = new UserProfileDto(); userProfileDto.ProfileAddress1 = attendee.Address1; userProfileDto.ProfileAddress2 = attendee.Address2; userProfileDto.ProfileCity = attendee.City; userProfileDto.ProfileEmail = attendee.EmailAddress; userProfileDto.ProfileFirstName = attendee.FirstName; userProfileDto.ProfileLastName = attendee.LastName; userProfileDto.ProfilePostalCode = attendee.PostalCode; userProfileDto.ProfilePrimaryPhone = attendee.PrimaryPhone; userProfileDto.ProfileStateId = attendee.StateId; userProfileDto.ProfileStateName = attendee.StateName; userProfileDto.ProfileFullName = attendee.FullName; userProfileDto.DynamicColumnData = attendee.DynamicColumnsData; return userProfileDto; }
/// <summary> /// Adds the attendee. /// </summary> /// <param name="attendeeDto">The attendee dto.</param> /// <param name="includeInAllEvents">if set to <c>true</c> [include in all events].</param> /// <param name="cost">The cost.</param> /// <exception cref="MEDSEEK.eHealth.Utils.Common.BusinessException">An identical attendee has already been added to + EventTitle</exception> public void AddAttendee(AttendeeDto attendeeDto, bool includeInAllEvents, decimal cost) { if (ContainsAttendee(attendeeDto)) { throw new BusinessException("An identical attendee has already been added to " + EventTitle); } var cartAttendee = new CartAttendeeDto() { Id = Guid.NewGuid(), Attendee = attendeeDto, EventOccurrenceId = this.EventOccurrenceId, IncludedInAllEvents = includeInAllEvents, AmountPaid = cost, DiscountCode = attendeeDto.DiscountCode }; cartAttendee.Attendee.SponsorGuidId = attendeeDto.SponsorGuidId; cartAttendee.Attendee.Id = attendeeDto.Id; Attendees.Add(cartAttendee); }
/// <summary> /// Determines whether the specified attendee dto contains attendee. /// </summary> /// <param name="attendeeDto">The attendee dto.</param> /// <returns> /// <c>true</c> if the specified attendee dto contains attendee; otherwise, <c>false</c>. /// </returns> public bool ContainsAttendee(AttendeeDto attendeeDto) { return Attendees.SingleOrDefault(a => a.Attendee.Equals(attendeeDto)) != null; }
/// <summary> /// Adds the attendee. /// </summary> /// <param name="attendeeDto">The attendee dto.</param> /// <param name="includeInAllEvents">if set to <c>true</c> [include in all events].</param> public void AddAttendee(AttendeeDto attendeeDto, bool includeInAllEvents) { AddAttendee(attendeeDto, includeInAllEvents, 0); }