public PersonTO(Person mdo) { this.name = mdo.Name.getLastNameFirst(); if (mdo.SSN != null) { this.ssn = mdo.SSN.toHyphenatedString(); } this.gender = mdo.Gender; this.dob = mdo.DOB; this.ethnicity = mdo.Ethnicity; this.age = mdo.Age; this.maritalStatus = mdo.MaritalStatus; if (mdo.HomeAddress != null) { this.homeAddress = new AddressTO(mdo.HomeAddress); } if (mdo.HomePhone != null) { this.homePhone = new PhoneNumTO(mdo.HomePhone); } if (mdo.CellPhone != null) { this.cellPhone = new PhoneNumTO(mdo.CellPhone); } if (mdo.Demographics != null && mdo.Demographics.Count > 0) { this.demographics = new DemographicSetTO[mdo.Demographics.Count]; int i = 0; foreach (KeyValuePair<string, DemographicSet> kvp in mdo.Demographics) { this.demographics[i++] = new DemographicSetTO(kvp); } } }
public PersonTO(Person mdo) { this.name = mdo.Name.getLastNameFirst(); if (mdo.SSN != null) { this.ssn = mdo.SSN.toHyphenatedString(); } this.gender = mdo.Gender; this.dob = mdo.DOB; this.ethnicity = mdo.Ethnicity; this.age = mdo.Age; this.maritalStatus = mdo.MaritalStatus; if (mdo.HomeAddress != null) { this.homeAddress = new AddressTO(mdo.HomeAddress); } if (mdo.HomePhone != null) { this.homePhone = new PhoneNumTO(mdo.HomePhone); } if (mdo.CellPhone != null) { this.cellPhone = new PhoneNumTO(mdo.CellPhone); } if (mdo.Demographics != null && mdo.Demographics.Count > 0) { this.demographics = new DemographicSetTO[mdo.Demographics.Count]; int i = 0; foreach (KeyValuePair <string, DemographicSet> kvp in mdo.Demographics) { this.demographics[i++] = new DemographicSetTO(kvp); } } }
internal void setAddressProperties(DemographicSetTO demoSet) { if (demoSet.addresses != null) { AddressTO addr = demoSet.addresses[0]; string streetAddress = addr.streetAddress1; if (!String.IsNullOrEmpty(addr.streetAddress2)) { streetAddress += '\n' + addr.streetAddress2; } if (!String.IsNullOrEmpty(addr.streetAddress3)) { streetAddress += '\n' + addr.streetAddress3; } this.address = streetAddress; this.city = addr.city; this.state = addr.state; this.zipcode = addr.zipcode; } }