Exemplo n.º 1
0
 private static void Copy(IAddressBase dest, AvaAddress.ValidAddress src)
 {
     dest.City         = src.City;
     dest.CountryID    = src.Country;
     dest.AddressLine1 = src.Line1;
     dest.AddressLine2 = src.Line2;
     dest.AddressLine3 = src.Line3;
     dest.PostalCode   = src.PostalCode;
     dest.State        = src.Region;
 }
        /// <summary>
        /// Load an empty local ValidateResult object from the data provided by the web service.
        /// </summary>
        /// <param name="SvcResult">The ValidateResult object provided by the web service.</param>
        internal void CopyFrom(ProxyValidateResult SvcResult)
        {
            base.CopyFrom(SvcResult);

            //iterate through addresses returned by the web service and move them into
            //    a local address object and local arraylist
            if (SvcResult.ValidAddresses != null)
            {
                for (int Index = 0; Index < SvcResult.ValidAddresses.Length; Index++)
                {
                    ProxyValidAddress SvcAddress   = SvcResult.ValidAddresses[Index];
                    ValidAddress      localAddress = new ValidAddress();

                    localAddress.CopyFrom(SvcAddress);
                    //((ValidAddresses)Addresses).Add( localAddress );
                    _addresses.Add(localAddress);
                    _taxable = SvcResult.Taxable;
                }
            }
        }