/// <summary>
        /// Returns the person model for an exchange visitor.
        /// </summary>
        /// <param name="biography">The biography of the participant.</param>
        /// <param name="participantExchangeVisitor">The participant exchange visitor record.  This record should have the program category and position pre-loaded.</param>
        /// <param name="subjectFieldDTO">The field of study of the participant.</param>
        /// <param name="siteOfActivityAddress">the site of activity of the exchange visitor, i.e. C Street state dept.</param>
        /// <returns>The person model for the exchange visitor.</returns>
        public ECA.Business.Validation.Sevis.Bio.Person GetPerson(
            BiographicalDTO biography,
            ParticipantExchangeVisitor participantExchangeVisitor,
            SubjectFieldDTO subjectFieldDTO,
            AddressDTO siteOfActivityAddress)
        {
            Contract.Requires(biography != null, "The biography should not be null.");
            Contract.Requires(participantExchangeVisitor != null, "The participant exchange visitor must not be null.");
            Contract.Requires(siteOfActivityAddress != null, "The site of activity address must not be null.");
            SubjectField subjectField = null;
            FullName     fullName     = null;

            if (subjectFieldDTO != null)
            {
                subjectField = subjectFieldDTO.GetSubjectField();
            }
            if (biography.FullName != null)
            {
                fullName = biography.FullName.GetFullName();
            }
            var instance = new ECA.Business.Validation.Sevis.Bio.Person(
                fullName: fullName,
                birthCity: biography.BirthCity,
                birthCountryCode: biography.BirthCountryCode,
                birthDate: biography.BirthDate,
                citizenshipCountryCode: biography.CitizenshipCountryCode,
                emailAddress: biography.EmailAddress,
                gender: biography.Gender,
                permanentResidenceCountryCode: biography.PermanentResidenceCountryCode,
                phoneNumber: biography.PhoneNumber,
                remarks: null,
                positionCode: participantExchangeVisitor.Position != null ? participantExchangeVisitor.Position.PositionCode : null,
                programCategoryCode: participantExchangeVisitor.ProgramCategory != null ? participantExchangeVisitor.ProgramCategory.ProgramCategoryCode : null,
                mailAddress: biography.MailAddress,
                participantId: participantExchangeVisitor.ParticipantId,
                usAddress: siteOfActivityAddress,
                personId: biography.PersonId,
                printForm: true,
                subjectField: subjectField
                );

            return(instance);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Creates a new instance.
 /// </summary>
 /// <param name="user">The user requesting the exchange visitor.</param>
 /// <param name="sevisId">The sevis id of the exchange visitor, or null, if none has been provided yet.</param>
 /// <param name="sevisOrgId">The sevis org id of the exchange visitor, or null, if none has been provided yet.</param>
 /// <param name="person">The person object representing the biographical information of the exchange visitor.</param>
 /// <param name="financialInfo">The financial info, detailing financial information about the exchange visitor.</param>
 /// <param name="occupationCategoryCode">The occupation category code.</param>
 /// <param name="programEndDate">The end date of the participant.</param>
 /// <param name="programStartDate">The start date of the participant.</param>
 /// <param name="siteOfActivity">The exchange visitor site of activity.</param>
 /// <param name="dependents">The dependents of the exchange visitor.</param>
 public ExchangeVisitor(
     string sevisId,
     string sevisOrgId,
     bool isValidated,
     Bio.Person person,
     FinancialInfo financialInfo,
     string occupationCategoryCode,
     DateTime programEndDate,
     DateTime programStartDate,
     AddressDTO siteOfActivity,
     IEnumerable <Dependent> dependents
     )
 {
     this.Person                 = person;
     this.FinancialInfo          = financialInfo;
     this.OccupationCategoryCode = occupationCategoryCode;
     this.ProgramEndDate         = programEndDate;
     this.ProgramStartDate       = programStartDate;
     this.Dependents             = dependents ?? new List <Dependent>();
     this.SiteOfActivity         = siteOfActivity;
     this.SevisId                = sevisId;
     this.SevisOrgId             = sevisOrgId;
     this.IsValidated            = isValidated;
 }