///<summary> /// Returns a value indicating whether this instance is equal to a specified object. ///</summary> ///<param name="toObject">An object to compare to this instance.</param> ///<returns>true if toObject is a <see cref="VIndividualDemographicsBase"/> and has the same value as this instance; otherwise, false.</returns> public virtual bool Equals(VIndividualDemographicsBase toObject) { if (toObject == null) { return(false); } return(Equals(this, toObject)); }
///<summary> /// Determines whether the specified <see cref="VIndividualDemographicsBase"/> instances are considered equal. ///</summary> ///<param name="Object1">The first <see cref="VIndividualDemographicsBase"/> to compare.</param> ///<param name="Object2">The second <see cref="VIndividualDemographicsBase"/> to compare. </param> ///<returns>true if Object1 is the same instance as Object2 or if both are null references or if objA.Equals(objB) returns true; otherwise, false.</returns> public static bool Equals(VIndividualDemographicsBase Object1, VIndividualDemographicsBase Object2) { // both are null if (Object1 == null && Object2 == null) return true; // one or the other is null, but not both if (Object1 == null ^ Object2 == null) return false; bool equal = true; if (Object1.CustomerId != Object2.CustomerId) equal = false; if (Object1.TotalPurchaseYtd != null && Object2.TotalPurchaseYtd != null ) { if (Object1.TotalPurchaseYtd != Object2.TotalPurchaseYtd) equal = false; } else if (Object1.TotalPurchaseYtd == null ^ Object1.TotalPurchaseYtd == null ) { equal = false; } if (Object1.DateFirstPurchase != null && Object2.DateFirstPurchase != null ) { if (Object1.DateFirstPurchase != Object2.DateFirstPurchase) equal = false; } else if (Object1.DateFirstPurchase == null ^ Object1.DateFirstPurchase == null ) { equal = false; } if (Object1.BirthDate != null && Object2.BirthDate != null ) { if (Object1.BirthDate != Object2.BirthDate) equal = false; } else if (Object1.BirthDate == null ^ Object1.BirthDate == null ) { equal = false; } if (Object1.MaritalStatus != null && Object2.MaritalStatus != null ) { if (Object1.MaritalStatus != Object2.MaritalStatus) equal = false; } else if (Object1.MaritalStatus == null ^ Object1.MaritalStatus == null ) { equal = false; } if (Object1.YearlyIncome != null && Object2.YearlyIncome != null ) { if (Object1.YearlyIncome != Object2.YearlyIncome) equal = false; } else if (Object1.YearlyIncome == null ^ Object1.YearlyIncome == null ) { equal = false; } if (Object1.Gender != null && Object2.Gender != null ) { if (Object1.Gender != Object2.Gender) equal = false; } else if (Object1.Gender == null ^ Object1.Gender == null ) { equal = false; } if (Object1.TotalChildren != null && Object2.TotalChildren != null ) { if (Object1.TotalChildren != Object2.TotalChildren) equal = false; } else if (Object1.TotalChildren == null ^ Object1.TotalChildren == null ) { equal = false; } if (Object1.NumberChildrenAtHome != null && Object2.NumberChildrenAtHome != null ) { if (Object1.NumberChildrenAtHome != Object2.NumberChildrenAtHome) equal = false; } else if (Object1.NumberChildrenAtHome == null ^ Object1.NumberChildrenAtHome == null ) { equal = false; } if (Object1.Education != null && Object2.Education != null ) { if (Object1.Education != Object2.Education) equal = false; } else if (Object1.Education == null ^ Object1.Education == null ) { equal = false; } if (Object1.Occupation != null && Object2.Occupation != null ) { if (Object1.Occupation != Object2.Occupation) equal = false; } else if (Object1.Occupation == null ^ Object1.Occupation == null ) { equal = false; } if (Object1.HomeOwnerFlag != null && Object2.HomeOwnerFlag != null ) { if (Object1.HomeOwnerFlag != Object2.HomeOwnerFlag) equal = false; } else if (Object1.HomeOwnerFlag == null ^ Object1.HomeOwnerFlag == null ) { equal = false; } if (Object1.NumberCarsOwned != null && Object2.NumberCarsOwned != null ) { if (Object1.NumberCarsOwned != Object2.NumberCarsOwned) equal = false; } else if (Object1.NumberCarsOwned == null ^ Object1.NumberCarsOwned == null ) { equal = false; } return equal; }
///<summary> /// Returns a value indicating whether this instance is equal to a specified object. ///</summary> ///<param name="toObject">An object to compare to this instance.</param> ///<returns>true if toObject is a <see cref="VIndividualDemographicsBase"/> and has the same value as this instance; otherwise, false.</returns> public virtual bool Equals(VIndividualDemographicsBase toObject) { if (toObject == null) return false; return Equals(this, toObject); }
///<summary> /// Determines whether the specified <see cref="VIndividualDemographicsBase"/> instances are considered equal. ///</summary> ///<param name="Object1">The first <see cref="VIndividualDemographicsBase"/> to compare.</param> ///<param name="Object2">The second <see cref="VIndividualDemographicsBase"/> to compare. </param> ///<returns>true if Object1 is the same instance as Object2 or if both are null references or if objA.Equals(objB) returns true; otherwise, false.</returns> public static bool Equals(VIndividualDemographicsBase Object1, VIndividualDemographicsBase Object2) { // both are null if (Object1 == null && Object2 == null) { return(true); } // one or the other is null, but not both if (Object1 == null ^ Object2 == null) { return(false); } bool equal = true; if (Object1.CustomerId != Object2.CustomerId) { equal = false; } if (Object1.TotalPurchaseYtd != null && Object2.TotalPurchaseYtd != null) { if (Object1.TotalPurchaseYtd != Object2.TotalPurchaseYtd) { equal = false; } } else if (Object1.TotalPurchaseYtd == null ^ Object1.TotalPurchaseYtd == null) { equal = false; } if (Object1.DateFirstPurchase != null && Object2.DateFirstPurchase != null) { if (Object1.DateFirstPurchase != Object2.DateFirstPurchase) { equal = false; } } else if (Object1.DateFirstPurchase == null ^ Object1.DateFirstPurchase == null) { equal = false; } if (Object1.BirthDate != null && Object2.BirthDate != null) { if (Object1.BirthDate != Object2.BirthDate) { equal = false; } } else if (Object1.BirthDate == null ^ Object1.BirthDate == null) { equal = false; } if (Object1.MaritalStatus != null && Object2.MaritalStatus != null) { if (Object1.MaritalStatus != Object2.MaritalStatus) { equal = false; } } else if (Object1.MaritalStatus == null ^ Object1.MaritalStatus == null) { equal = false; } if (Object1.YearlyIncome != null && Object2.YearlyIncome != null) { if (Object1.YearlyIncome != Object2.YearlyIncome) { equal = false; } } else if (Object1.YearlyIncome == null ^ Object1.YearlyIncome == null) { equal = false; } if (Object1.Gender != null && Object2.Gender != null) { if (Object1.Gender != Object2.Gender) { equal = false; } } else if (Object1.Gender == null ^ Object1.Gender == null) { equal = false; } if (Object1.TotalChildren != null && Object2.TotalChildren != null) { if (Object1.TotalChildren != Object2.TotalChildren) { equal = false; } } else if (Object1.TotalChildren == null ^ Object1.TotalChildren == null) { equal = false; } if (Object1.NumberChildrenAtHome != null && Object2.NumberChildrenAtHome != null) { if (Object1.NumberChildrenAtHome != Object2.NumberChildrenAtHome) { equal = false; } } else if (Object1.NumberChildrenAtHome == null ^ Object1.NumberChildrenAtHome == null) { equal = false; } if (Object1.Education != null && Object2.Education != null) { if (Object1.Education != Object2.Education) { equal = false; } } else if (Object1.Education == null ^ Object1.Education == null) { equal = false; } if (Object1.Occupation != null && Object2.Occupation != null) { if (Object1.Occupation != Object2.Occupation) { equal = false; } } else if (Object1.Occupation == null ^ Object1.Occupation == null) { equal = false; } if (Object1.HomeOwnerFlag != null && Object2.HomeOwnerFlag != null) { if (Object1.HomeOwnerFlag != Object2.HomeOwnerFlag) { equal = false; } } else if (Object1.HomeOwnerFlag == null ^ Object1.HomeOwnerFlag == null) { equal = false; } if (Object1.NumberCarsOwned != null && Object2.NumberCarsOwned != null) { if (Object1.NumberCarsOwned != Object2.NumberCarsOwned) { equal = false; } } else if (Object1.NumberCarsOwned == null ^ Object1.NumberCarsOwned == null) { equal = false; } return(equal); }