예제 #1
0
 public void Copy(Address sourceAddress, bool needUniqueId, bool needPersonInfo)
 {
     AddressLine1 = sourceAddress.AddressLine1;
     AddressLine2 = sourceAddress.AddressLine2;
     CityLocality = sourceAddress.CityLocality;
     Country = sourceAddress.Country;
     Organization = sourceAddress.Organization;
     PostalCode = sourceAddress.PostalCode;
     StateProvince = sourceAddress.StateProvince;
     PONumber = sourceAddress.PONumber;
     Verified = sourceAddress.Verified;
     Longitude = sourceAddress.Longitude;
     Latitude = sourceAddress.Latitude;
     Attention = sourceAddress.Attention;
     SiteNumber = sourceAddress.SiteNumber;
     if (needUniqueId)
     {
         UniqueId = sourceAddress.UniqueId;
     }
     if (needPersonInfo)
     {
         CreatedDate = sourceAddress.CreatedDate;
         CreatedPersonId = sourceAddress.CreatedPersonId;
         LastChangeDate = sourceAddress.LastChangeDate;
         LastChangePersonId = sourceAddress.LastChangePersonId;
     }
 }
예제 #2
0
 public bool IsAboutEqual(Address address, bool ignoreCase)
 {
     if (String.Compare(this.AddressLine1, address.AddressLine1, ignoreCase) != 0)
         return false;
     if (String.Compare(this.AddressLine2 == null ? "" : this.AddressLine2, address.AddressLine2 == null ? "" : address.AddressLine2, ignoreCase) != 0)
         return false;
     if (String.Compare(this.CityLocality, address.CityLocality, ignoreCase) != 0)
         return false;
     if (String.Compare(this.StateProvince, address.StateProvince, ignoreCase) != 0)
         return false;
     if (String.Compare(this.Country, address.Country, ignoreCase) != 0)
         return false;
     return true;
 }
예제 #3
0
 public void Copy(Address verifiedAddress, int personId)
 {
     this.AddressLine1 = string.IsNullOrEmpty(verifiedAddress.AddressLine1) ? this.AddressLine1 : verifiedAddress.AddressLine1; // this is because AddressLine 1 is required
     this.AddressLine2 = verifiedAddress.AddressLine2;
     this.CityLocality = string.IsNullOrEmpty(verifiedAddress.CityLocality) ? this.CityLocality : verifiedAddress.CityLocality; // this is because CityLocality is required
     this.StateProvince = verifiedAddress.StateProvince;
     this.Country = verifiedAddress.Country;
     this.PostalCode = verifiedAddress.PostalCode;
     this.SiteNumber = verifiedAddress.SiteNumber;
     this.Verified = verifiedAddress.Verified;
     if (personId > 0)
     {
         this.LastChangeDate = DateTime.UtcNow;
         this.LastChangePersonId = personId;
     }
 }