/// <summary> /// Returns a EVPersonTypeDependent instance representing a new sevis depenedent with a new sevis exchange visitor. /// </summary> /// <returns>A EVPersonTypeDependent instance representing a new sevis depenedent with a new sevis exchange visitor.</returns> public EVPersonTypeDependent GetEVPersonTypeDependent() { Contract.Requires(this.BirthDate.HasValue, "The birth date must have a value."); Contract.Requires(this.FullName != null, "The full name should be specified."); Contract.Requires(this.BirthCountryCode != null, "The BirthCountryCode should be specified."); Contract.Requires(this.CitizenshipCountryCode != null, "The CitizenshipCountryCode should be specified."); Contract.Requires(this.PermanentResidenceCountryCode != null, "The PermanentResidenceCountryCode should be specified."); Contract.Requires(this.Gender != null, "The Gender should be specified."); Func <string, bool> isCodeSpecified = (value) => { return(!string.IsNullOrWhiteSpace(value)); }; var dependent = new EVPersonTypeDependent { BirthCity = this.BirthCity, BirthCountryCode = this.BirthCountryCode.GetBirthCntryCodeType(), BirthCountryReasonSpecified = isCodeSpecified(this.BirthCountryReasonCode), BirthDate = this.BirthDate.Value, CitizenshipCountryCode = this.CitizenshipCountryCode.GetCountryCodeWithType(), EmailAddress = this.EmailAddress, FullName = this.FullName.GetNameType(), Gender = this.Gender.GetEVGenderCodeType(), PermanentResidenceCountryCode = this.PermanentResidenceCountryCode.GetCountryCodeWithType(), Relationship = this.Relationship.GetDependentCodeType(), }; if (dependent.BirthCountryReasonSpecified) { dependent.BirthCountryReason = this.BirthCountryReasonCode.GetUSBornReasonType(); } var sevisKey = new ParticipantSevisKey(this); sevisKey.SetUserDefinedFields(dependent); return(dependent); }
/// <summary> /// Returns a sevis registered exchnage visitor's dependent modification, such as a new dependent that must be added. /// </summary> /// <returns>A sevis registered exchnage visitor's dependent modification, such as a new dependent that must be added.</returns> public SEVISEVBatchTypeExchangeVisitorDependent GetSEVISEVBatchTypeExchangeVisitorDependent() { //should return SEVISEVBatchTypeExchangeVisitorDependent with the correct Item property set to either //SEVISEVBatchTypeExchangeVisitorDependentAdd, SEVISEVBatchTypeExchangeVisitorDependentDelete, etc.... var instance = new SEVISEVBatchTypeExchangeVisitorDependent { Item = Dependent.GetSevisExhangeVisitorDependentInstance(), }; var key = new ParticipantSevisKey(this.Dependent); key.SetUserDefinedFields(instance); return(instance); }