예제 #1
0
 public ShipAddress(BillAddress billAddr)
 {
     this.customerID = billAddr.customerID;
     this.coName     = billAddr.coName;
     this.addr1      = billAddr.addr1;
     this.addr2      = billAddr.addr2;
     this.city       = billAddr.city;
     this.state      = billAddr.state;
     this.zip        = billAddr.zip;
     this.country    = billAddr.country;
     this.phoneNo    = billAddr.phoneNo;
 }
예제 #2
0
        public override bool Equals(object obj)
        {
            if (GetType() != obj.GetType())
            {
                return(false);
            }

            BillAddress billAddr = obj as BillAddress;

            return(this.customerID == billAddr.customerID && this.coName == billAddr.coName && this.addr1 == billAddr.addr1 &&
                   this.addr2 == billAddr.addr2 && this.city == billAddr.city && this.state == billAddr.state && this.zip == billAddr.zip &&
                   this.country == billAddr.country && this.phoneNo == billAddr.phoneNo);
        }
        private string buildBillAddressString(BillAddress 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());
        }