示例#1
0
        public override bool Equals(object obj)
        {
            if (GetType() != obj.GetType())
            {
                return(false);
            }

            ShipAddress shipAddr = obj as ShipAddress;

            return(this.customerID == shipAddr.customerID && this.coName == shipAddr.coName && this.addr1 == shipAddr.addr1 &&
                   this.addr2 == shipAddr.addr2 && this.city == shipAddr.city && this.state == shipAddr.state && this.zip == shipAddr.zip &&
                   this.country == shipAddr.country && this.phoneNo == shipAddr.phoneNo);
        }
        private string buildShipAddressString(ShipAddress address)
        {
            StringBuilder output = new StringBuilder();

            output.Append(address.coName + '\n');
            output.Append(address.addr1 + '\n');
            if (address.addr2.Trim() != "")
            {
                output.Append(address.addr2 + '\n');
            }
            output.Append(address.city + ", ");
            output.Append(address.state + " ");
            output.Append(address.zip + '\n');
            output.Append(address.phoneNo);

            return(output.ToString());
        }