public AddressDetail(Constants.AddressType addrtype, string street, string pobox, string city, string postalcode, string countryregion, string state) { Street = string.IsNullOrEmpty(street) ? "" : street; POBox = string.IsNullOrEmpty(pobox) ? "" : pobox; City = string.IsNullOrEmpty(city) ? "" : city; PostalCode = string.IsNullOrEmpty(postalcode) ? "" : postalcode; CountryRegion = string.IsNullOrEmpty(countryregion) ? "" : countryregion; State = string.IsNullOrEmpty(state) ? "" : state; Type = addrtype; }
/// <summary> /// Return requested address /// </summary> /// <param name="typ"></param> /// <returns></returns> internal AddressDetail GetRightAddress(Constants.AddressType typ) { foreach (AddressDetail a in Address) { if (a.Type == typ) { return(a); } } return(null); }