/// <summary> /// Compares two addresses for equality. /// </summary> /// <param name="Address">An address to compare with.</param> /// <returns>True if both match; False otherwise.</returns> public Boolean Equals(Address Address) { if (Address is null) { return(false); } return(Country.Equals(Address.Country) && City.Equals(Address.City) && Street.Equals(Address.Street) && ((PostalCode == null && Address.PostalCode == null) || (PostalCode != null && Address.PostalCode != null && PostalCode.Equals(Address.PostalCode))) && ((HouseNumber == null && Address.HouseNumber == null) || (HouseNumber != null && Address.HouseNumber != null && HouseNumber.Equals(Address.HouseNumber))) && ((FloorLevel == null && Address.FloorLevel == null) || (FloorLevel != null && Address.FloorLevel != null && FloorLevel.Equals(Address.FloorLevel))) && ((Region == null && Address.Region == null) || (Region != null && Address.Region != null && Region.Equals(Address.Region))) && ((Timezone == null && Address.Timezone == null) || (Timezone != null && Address.Timezone != null && Timezone.Equals(Address.Timezone)))); }
public override bool Equals(object obj) { if (obj == null) { return(false); } if (obj == this) { return(true); } return(obj is Address other && ((AddressLine1 == null && other.AddressLine1 == null) || (AddressLine1?.Equals(other.AddressLine1) == true)) && ((AddressLine2 == null && other.AddressLine2 == null) || (AddressLine2?.Equals(other.AddressLine2) == true)) && ((AddressLine3 == null && other.AddressLine3 == null) || (AddressLine3?.Equals(other.AddressLine3) == true)) && ((Locality == null && other.Locality == null) || (Locality?.Equals(other.Locality) == true)) && ((Sublocality == null && other.Sublocality == null) || (Sublocality?.Equals(other.Sublocality) == true)) && ((Sublocality2 == null && other.Sublocality2 == null) || (Sublocality2?.Equals(other.Sublocality2) == true)) && ((Sublocality3 == null && other.Sublocality3 == null) || (Sublocality3?.Equals(other.Sublocality3) == true)) && ((AdministrativeDistrictLevel1 == null && other.AdministrativeDistrictLevel1 == null) || (AdministrativeDistrictLevel1?.Equals(other.AdministrativeDistrictLevel1) == true)) && ((AdministrativeDistrictLevel2 == null && other.AdministrativeDistrictLevel2 == null) || (AdministrativeDistrictLevel2?.Equals(other.AdministrativeDistrictLevel2) == true)) && ((AdministrativeDistrictLevel3 == null && other.AdministrativeDistrictLevel3 == null) || (AdministrativeDistrictLevel3?.Equals(other.AdministrativeDistrictLevel3) == true)) && ((PostalCode == null && other.PostalCode == null) || (PostalCode?.Equals(other.PostalCode) == true)) && ((Country == null && other.Country == null) || (Country?.Equals(other.Country) == true)) && ((FirstName == null && other.FirstName == null) || (FirstName?.Equals(other.FirstName) == true)) && ((LastName == null && other.LastName == null) || (LastName?.Equals(other.LastName) == true)) && ((Organization == null && other.Organization == null) || (Organization?.Equals(other.Organization) == true))); }
public bool Equals(Address other) { return(other != null && Street.Equals(other.Street) && StreetExtended.Equals(other.StreetExtended) && PostalCode.Equals(other.PostalCode) && City.Equals(other.City) && Country.Equals(other.Country)); }
public override bool Equals(object obj) { Address addr = obj as Address; return(addr != null && Street1.Equals(addr.Street1, StringComparison.OrdinalIgnoreCase) && Street2.Equals(addr.Street2, StringComparison.OrdinalIgnoreCase) && PostalCode.Equals(addr.PostalCode, StringComparison.OrdinalIgnoreCase) && RegionCode.Equals(addr.RegionCode, StringComparison.OrdinalIgnoreCase) && CountryCode.Equals(addr.CountryCode, StringComparison.OrdinalIgnoreCase)); }
public bool Equals(Address other) { if (other == null) { return(false); } return(AddressLine1.Equals(other.AddressLine1) && ((AddressLine2 == null && other.AddressLine2 == null) || (AddressLine2 != null && AddressLine2.Equals(other.AddressLine2))) && PostalCode.Equals(other.PostalCode) && City.Equals(other.City) && Country.Equals(other.Country)); }
public override bool Equals(object obj) { Address other = obj as Address; if (other == null) { return(false); } return(Name.Equals(other.Name, StringComparison.Ordinal) && City.Equals(other.City, StringComparison.Ordinal) && PostalCode.Equals(other.PostalCode, StringComparison.Ordinal) && PostalAbbreviation.Equals(other.PostalAbbreviation, StringComparison.Ordinal)); }
public override bool Equals(object obj) { if (obj == this) { return(true); } if (!(obj is AddressData addressData)) { return(false); } return((PostalCountry == null ? addressData.PostalCountry == null : PostalCountry.Equals(addressData.PostalCountry)) && (!AddressLines.Any() ? !addressData.AddressLines.Any() : AddressLines.Equals(addressData.AddressLines)) && (AdministrativeArea == null ? addressData.AdministrativeArea == null : AdministrativeArea.Equals(addressData.AdministrativeArea)) && (Locality == null ? addressData.Locality == null : Locality.Equals(addressData.Locality)) && (DependentLocality == null ? addressData.DependentLocality == null : DependentLocality.Equals(addressData.DependentLocality)) && (PostalCode == null ? addressData.PostalCode == null : PostalCode.Equals(addressData.PostalCode)) && (SortingCode == null ? addressData.SortingCode == null : SortingCode.Equals(addressData.SortingCode)) && (Organization == null ? addressData.Organization == null : Organization.Equals(addressData.Organization)) && (Recipient == null ? addressData.Recipient == null : Recipient.Equals(addressData.Recipient)) && (LanguageCode == null ? addressData.LanguageCode == null : LanguageCode.Equals(addressData.LanguageCode))); }
/// <summary> /// Compares two addresses for equality. /// </summary> /// <param name="Address">An address to compare with.</param> /// <returns>True if both match; False otherwise.</returns> public Boolean Equals(Address Address) { if ((Object)Address == null) { return(false); } try { return(Street.Equals(Address.Street) && HouseNumber.Equals(Address.HouseNumber) && FloorLevel.Equals(Address.FloorLevel) && PostalCode.Equals(Address.PostalCode) && PostalCodeSub.Equals(Address.PostalCodeSub) && City.Equals(Address.City) && Country.Equals(Address.Country)); } catch (Exception e) { return(false); } }
/// <summary> /// Returns true if Address instances are equal /// </summary> /// <param name="other">Instance of Address to be compared</param> /// <returns>Boolean</returns> public bool Equals(Address other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Uuid == other.Uuid || Uuid != null && Uuid.Equals(other.Uuid) ) && ( Use == other.Use || Use != null && Use.Equals(other.Use) ) && ( Type == other.Type || Type != null && Type.Equals(other.Type) ) && ( Line == other.Line || Line != null && Line.SequenceEqual(other.Line) ) && ( City == other.City || City != null && City.Equals(other.City) ) && ( District == other.District || District != null && District.Equals(other.District) ) && ( State == other.State || State != null && State.Equals(other.State) ) && ( Country == other.Country || Country != null && Country.Equals(other.Country) ) && ( PostalCode == other.PostalCode || PostalCode != null && PostalCode.Equals(other.PostalCode) ) && ( Period == other.Period || Period != null && Period.Equals(other.Period) ) && ( Creation == other.Creation || Creation != null && Creation.Equals(other.Creation) ) && ( LastUpdated == other.LastUpdated || LastUpdated != null && LastUpdated.Equals(other.LastUpdated) )); }
public bool Equals(IAccount other) { if (!AccountID.Equals(other.AccountID)) { Error.AddMessage("Account " + UID + " AccountID: " + AccountID + " is not equal to other: " + other.AccountID); return(false); } if (!BirthCountry.Equals(other.BirthCountry)) { Error.AddMessage("Account " + UID + " BirthCountry: " + BirthCountry + " is not equal to other: " + other.BirthCountry); return(false); } if (!Birthday.Equals(other.Birthday)) { Error.AddMessage("Account " + UID + " Birthday: " + Birthday + " is not equal to other: " + other.Birthday); return(false); } if (!BirthPlace.Equals(other.BirthPlace)) { Error.AddMessage("Account " + UID + " BirthPlace: " + BirthPlace + " is not equal to other: " + other.BirthPlace); return(false); } if (!City.Equals(other.City)) { Error.AddMessage("Account " + UID + " City: " + City + " is not equal to other: " + other.City); return(false); } if (!Country.Equals(other.Country)) { Error.AddMessage("Account " + UID + " Country: " + Country + " is not equal to other: " + other.Country); return(false); } if (!ExtraNames.Equals(other.ExtraNames)) { Error.AddMessage("Account " + UID + " ExtraNames: " + ExtraNames + " is not equal to other: " + other.ExtraNames); return(false); } if (!Fax.Equals(other.Fax)) { Error.AddMessage("Account " + UID + " Fax: " + Fax + " is not equal to other: " + other.Fax); return(false); } if (!Gender.Equals(other.Gender)) { Error.AddMessage("Account " + UID + " Gender: " + Gender + " is not equal to other: " + other.Gender); return(false); } if (!GivenName.Equals(other.GivenName)) { Error.AddMessage("Account " + UID + " GivenName: " + GivenName + " is not equal to other: " + other.GivenName); return(false); } if (!Group.Equals(other.Group)) { Error.AddMessage("Account " + UID + " Group: " + Group + " is not equal to other: " + other.Group); return(false); } if (!HomePhone.Equals(other.HomePhone)) { Error.AddMessage("Account " + UID + " HomePhone: " + HomePhone + " is not equal to other: " + other.HomePhone); return(false); } if (!HouseNumber.Equals(other.HouseNumber)) { Error.AddMessage("Account " + UID + " HouseNumber: " + HouseNumber + " is not equal to other: " + other.HouseNumber); return(false); } if (!HouseNumberAdd.Equals(other.HouseNumberAdd)) { Error.AddMessage("Account " + UID + " HouseNumberAdd: " + HouseNumberAdd + " is not equal to other: " + other.HouseNumberAdd); return(false); } if (!Initials.Equals(other.Initials)) { Error.AddMessage("Account " + UID + " Initials: " + Initials + " is not equal to other: " + other.Initials); return(false); } if (!Mail.Equals(other.Mail)) { Error.AddMessage("Account " + UID + " Mail: " + Mail + " is not equal to other: " + other.Mail); return(false); } if (!MailAlias.Equals(other.MailAlias)) { Error.AddMessage("Account " + UID + " MailAlias: " + MailAlias + " is not equal to other: " + other.MailAlias); return(false); } if (!MobilePhone.Equals(other.MobilePhone)) { Error.AddMessage("Account " + UID + " MobilePhone: " + MobilePhone + " is not equal to other: " + other.MobilePhone); return(false); } if (!PostalCode.Equals(other.PostalCode)) { Error.AddMessage("Account " + UID + " PostalCode: " + PostalCode + " is not equal to other: " + other.PostalCode); return(false); } if (!RegisterID.Equals(other.RegisterID)) { Error.AddMessage("Account " + UID + " RegisterID: " + RegisterID + " is not equal to other: " + other.RegisterID); return(false); } if (!Role.Equals(other.Role)) { Error.AddMessage("Account " + UID + " Role: " + Role + " is not equal to other: " + other.Role); return(false); } if (!StemID.Equals(other.StemID)) { Error.AddMessage("Account " + UID + " StemID: " + StemID + " is not equal to other: " + other.StemID); return(false); } if (!Street.Equals(other.Street)) { Error.AddMessage("Account " + UID + " Street: " + Street + " is not equal to other: " + other.Street); return(false); } if (!SurName.Equals(other.SurName)) { Error.AddMessage("Account " + UID + " SurName: " + SurName + " is not equal to other: " + other.SurName); return(false); } if (!UID.Equals(other.UID)) { Error.AddMessage("Account " + UID + " UID: " + UID + " is not equal to other: " + other.UID); return(false); } if (!UntisID.Equals(other.UntisID)) { Error.AddMessage("Account " + UID + " UntisID: " + UntisID + " is not equal to other: " + other.UntisID); return(false); } return(true); }
public bool IsSameLocation(Location rhs) { return(Address.Equals(rhs.Address, System.StringComparison.OrdinalIgnoreCase) && Region.Equals(rhs.Region, System.StringComparison.OrdinalIgnoreCase) && PostalCode.Equals(rhs.PostalCode, System.StringComparison.OrdinalIgnoreCase)); }
/// <summary> /// Returns true if Address instances are equal /// </summary> /// <param name="other">Instance of Address to be compared</param> /// <returns>Boolean</returns> public bool Equals(Address other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( ReferenceNumber == other.ReferenceNumber || ReferenceNumber != null && ReferenceNumber.Equals(other.ReferenceNumber) ) && ( FirstName == other.FirstName || FirstName != null && FirstName.Equals(other.FirstName) ) && ( LastName == other.LastName || LastName != null && LastName.Equals(other.LastName) ) && ( Address1 == other.Address1 || Address1 != null && Address1.Equals(other.Address1) ) && ( Address2 == other.Address2 || Address2 != null && Address2.Equals(other.Address2) ) && ( City == other.City || City != null && City.Equals(other.City) ) && ( State == other.State || State != null && State.Equals(other.State) ) && ( CountryCode == other.CountryCode || CountryCode != null && CountryCode.Equals(other.CountryCode) ) && ( PostalCode == other.PostalCode || PostalCode != null && PostalCode.Equals(other.PostalCode) ) && ( PhoneNumber == other.PhoneNumber || PhoneNumber != null && PhoneNumber.Equals(other.PhoneNumber) )); }
/// <summary> /// Returns true if Owner instances are equal /// </summary> /// <param name="other">Instance of Owner to be compared</param> /// <returns>Boolean</returns> public bool Equals(Owner other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Id == other.Id || Id.Equals(other.Id) ) && ( OwnerCode == other.OwnerCode || OwnerCode != null && OwnerCode.Equals(other.OwnerCode) ) && ( OrganizationName == other.OrganizationName || OrganizationName != null && OrganizationName.Equals(other.OrganizationName) ) && ( MeetsResidency == other.MeetsResidency || MeetsResidency.Equals(other.MeetsResidency) ) && ( LocalArea == other.LocalArea || LocalArea != null && LocalArea.Equals(other.LocalArea) ) && ( Status == other.Status || Status != null && Status.Equals(other.Status) ) && ( StatusComment == other.StatusComment || StatusComment != null && StatusComment.Equals(other.StatusComment) ) && ( DoingBusinessAs == other.DoingBusinessAs || DoingBusinessAs != null && DoingBusinessAs.Equals(other.DoingBusinessAs) ) && ( RegisteredCompanyNumber == other.RegisteredCompanyNumber || RegisteredCompanyNumber != null && RegisteredCompanyNumber.Equals(other.RegisteredCompanyNumber) ) && ( PrimaryContact == other.PrimaryContact || PrimaryContact != null && PrimaryContact.Equals(other.PrimaryContact) ) && ( IsMaintenanceContractor == other.IsMaintenanceContractor || IsMaintenanceContractor != null && IsMaintenanceContractor.Equals(other.IsMaintenanceContractor) ) && ( WorkSafeBCPolicyNumber == other.WorkSafeBCPolicyNumber || WorkSafeBCPolicyNumber != null && WorkSafeBCPolicyNumber.Equals(other.WorkSafeBCPolicyNumber) ) && ( WorkSafeBCExpiryDate == other.WorkSafeBCExpiryDate || WorkSafeBCExpiryDate != null && WorkSafeBCExpiryDate.Equals(other.WorkSafeBCExpiryDate) ) && ( GivenName == other.GivenName || GivenName != null && GivenName.Equals(other.GivenName) ) && ( Surname == other.Surname || Surname != null && Surname.Equals(other.Surname) ) && ( Address1 == other.Address1 || Address1 != null && Address1.Equals(other.Address1) ) && ( Address2 == other.Address2 || Address2 != null && Address2.Equals(other.Address2) ) && ( City == other.City || City != null && City.Equals(other.City) ) && ( Province == other.Province || Province != null && Province.Equals(other.Province) ) && ( PostalCode == other.PostalCode || PostalCode != null && PostalCode.Equals(other.PostalCode) ) && ( CGLEndDate == other.CGLEndDate || CGLEndDate != null && CGLEndDate.Equals(other.CGLEndDate) ) && ( CglPolicyNumber == other.CglPolicyNumber || CglPolicyNumber != null && CglPolicyNumber.Equals(other.CglPolicyNumber) ) && ( ArchiveCode == other.ArchiveCode || ArchiveCode != null && ArchiveCode.Equals(other.ArchiveCode) ) && ( ArchiveReason == other.ArchiveReason || ArchiveReason != null && ArchiveReason.Equals(other.ArchiveReason) ) && ( ArchiveDate == other.ArchiveDate || ArchiveDate != null && ArchiveDate.Equals(other.ArchiveDate) ) && ( Contacts == other.Contacts || Contacts != null && Contacts.SequenceEqual(other.Contacts) ) && ( Notes == other.Notes || Notes != null && Notes.SequenceEqual(other.Notes) ) && ( Attachments == other.Attachments || Attachments != null && Attachments.SequenceEqual(other.Attachments) ) && ( History == other.History || History != null && History.SequenceEqual(other.History) ) && ( EquipmentList == other.EquipmentList || EquipmentList != null && EquipmentList.SequenceEqual(other.EquipmentList) )); }
public string GenerateUpdateJsonFromObject(Household updateFrom) { // form the json (determine the fields that need to be updated) var sb = new StringBuilder(); var sw = new StringWriter(sb); var writer = new JsonTextWriter(sw) { Formatting = Formatting.None }; writer.WriteStartObject(); writer.WritePropertyName(@"household"); writer.WriteStartObject(); if (!HouseholdName.Equals(updateFrom.HouseholdName)) { writer.WritePropertyName("name"); writer.WriteValue(updateFrom.HouseholdName); } if (!IntakeDate.Equals(updateFrom.IntakeDate)) { writer.WritePropertyName("intake_date"); writer.WriteValue(updateFrom.IntakeDate.ToString("yyyy-MM-dd")); } if (!AddressLine1.Equals(updateFrom.AddressLine1)) { writer.WritePropertyName("address_line_1"); writer.WriteValue(updateFrom.AddressLine1); } if (!AddressLine2.Equals(updateFrom.AddressLine2)) { writer.WritePropertyName("address_line_2"); writer.WriteValue(updateFrom.AddressLine2); } if (!PostalCode.Equals(updateFrom.PostalCode)) { writer.WritePropertyName("postal_code"); writer.WriteValue(updateFrom.PostalCode); } if (!DependentLocality.Equals(updateFrom.DependentLocality)) { writer.WritePropertyName("dependent_locality"); writer.WriteValue(updateFrom.DependentLocality); } if (!Locality.Equals(updateFrom.Locality)) { writer.WritePropertyName("locality"); writer.WriteValue(updateFrom.Locality); } if (!AdminvArea.Equals(updateFrom.AdminvArea)) { writer.WritePropertyName("adminv_area"); writer.WriteValue(updateFrom.AdminvArea); } if (!DependentAdminvArea.Equals(updateFrom.DependentAdminvArea)) { writer.WritePropertyName("dependent_adminv_area"); writer.WriteValue(updateFrom.DependentAdminvArea); } if (!Country.Equals(updateFrom.Country)) { writer.WritePropertyName("country"); writer.WriteValue(updateFrom.Country); } if (!AddressInfo.Equals(updateFrom.AddressInfo)) { writer.WritePropertyName("address_info"); writer.WriteValue(updateFrom.AddressInfo); } if (!GpsLatitude.Equals(updateFrom.GpsLatitude)) { writer.WritePropertyName("latitude"); writer.WriteValue(updateFrom.GpsLatitude ?? null); } if (!GpsLongitude.Equals(updateFrom.GpsLongitude)) { writer.WritePropertyName("longitude"); writer.WriteValue(updateFrom.GpsLongitude ?? null); } if (!GpsPositionAccuracy.Equals(updateFrom.GpsPositionAccuracy)) { writer.WritePropertyName("position_accuracy"); writer.WriteValue(updateFrom.GpsPositionAccuracy ?? null); } if (!GpsAltitude.Equals(updateFrom.GpsAltitude)) { writer.WritePropertyName("altitude"); writer.WriteValue(updateFrom.GpsAltitude ?? null); } if (!GpsAltitudeAccuracy.Equals(updateFrom.GpsAltitudeAccuracy)) { writer.WritePropertyName("altitude_accuracy"); writer.WriteValue(updateFrom.GpsAltitudeAccuracy ?? null); } if (!GpsHeading.Equals(updateFrom.GpsHeading)) { writer.WritePropertyName("heading"); writer.WriteValue(updateFrom.GpsHeading ?? null); } if (!GpsSpeed.Equals(updateFrom.GpsSpeed)) { writer.WritePropertyName("speed"); writer.WriteValue(updateFrom.GpsSpeed ?? null); } if (!GpsPositionTime.Equals(updateFrom.GpsPositionTime)) { writer.WritePropertyName("gps_recorded_at"); writer.WriteValue(updateFrom.GpsPositionTime ?? null); } writer.WriteEndObject(); writer.WriteEndObject(); return(sw.ToString()); }
public bool GetObjectNeedsUpate(Household checkUpdateFrom) { if (!HouseholdName.Equals(checkUpdateFrom.HouseholdName)) { return(true); } if (!IntakeDate.Equals(checkUpdateFrom.IntakeDate)) { return(true); } if (!AddressLine1.Equals(checkUpdateFrom.AddressLine1)) { return(true); } if (!AddressLine2.Equals(checkUpdateFrom.AddressLine2)) { return(true); } if (!PostalCode.Equals(checkUpdateFrom.PostalCode)) { return(true); } if (!DependentLocality.Equals(checkUpdateFrom.DependentLocality)) { return(true); } if (!Locality.Equals(checkUpdateFrom.Locality)) { return(true); } if (!AdminvArea.Equals(checkUpdateFrom.AdminvArea)) { return(true); } if (!DependentAdminvArea.Equals(checkUpdateFrom.DependentAdminvArea)) { return(true); } if (!Country.Equals(checkUpdateFrom.Country)) { return(true); } if (!AddressInfo.Equals(checkUpdateFrom.AddressInfo)) { return(true); } if (!GpsLatitude.Equals(checkUpdateFrom.GpsLatitude)) { return(true); } if (!GpsLongitude.Equals(checkUpdateFrom.GpsLongitude)) { return(true); } if (!GpsPositionAccuracy.Equals(checkUpdateFrom.GpsPositionAccuracy)) { return(true); } if (!GpsAltitude.Equals(checkUpdateFrom.GpsAltitude)) { return(true); } if (!GpsAltitudeAccuracy.Equals(checkUpdateFrom.GpsAltitudeAccuracy)) { return(true); } if (!GpsHeading.Equals(checkUpdateFrom.GpsHeading)) { return(true); } if (!GpsSpeed.Equals(checkUpdateFrom.GpsSpeed)) { return(true); } if (!GpsPositionTime.Equals(checkUpdateFrom.GpsPositionTime)) { return(true); } return(false); }