///<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="OrdersQryBase"/> and has the same value as this instance; otherwise, false.</returns> public virtual bool Equals(OrdersQryBase toObject) { if (toObject == null) return false; return Equals(this, toObject); }
///<summary> /// Determines whether the specified <see cref="OrdersQryBase"/> instances are considered equal. ///</summary> ///<param name="Object1">The first <see cref="OrdersQryBase"/> to compare.</param> ///<param name="Object2">The second <see cref="OrdersQryBase"/> 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(OrdersQryBase Object1, OrdersQryBase 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.OrderId != Object2.OrderId) equal = false; if (Object1.CustomerId != null && Object2.CustomerId != null ) { if (Object1.CustomerId != Object2.CustomerId) equal = false; } else if (Object1.CustomerId == null ^ Object1.CustomerId == null ) { equal = false; } if (Object1.EmployeeId != null && Object2.EmployeeId != null ) { if (Object1.EmployeeId != Object2.EmployeeId) equal = false; } else if (Object1.EmployeeId == null ^ Object1.EmployeeId == null ) { equal = false; } if (Object1.OrderDate != null && Object2.OrderDate != null ) { if (Object1.OrderDate != Object2.OrderDate) equal = false; } else if (Object1.OrderDate == null ^ Object1.OrderDate == null ) { equal = false; } if (Object1.RequiredDate != null && Object2.RequiredDate != null ) { if (Object1.RequiredDate != Object2.RequiredDate) equal = false; } else if (Object1.RequiredDate == null ^ Object1.RequiredDate == null ) { equal = false; } if (Object1.ShippedDate != null && Object2.ShippedDate != null ) { if (Object1.ShippedDate != Object2.ShippedDate) equal = false; } else if (Object1.ShippedDate == null ^ Object1.ShippedDate == null ) { equal = false; } if (Object1.ShipVia != null && Object2.ShipVia != null ) { if (Object1.ShipVia != Object2.ShipVia) equal = false; } else if (Object1.ShipVia == null ^ Object1.ShipVia == null ) { equal = false; } if (Object1.Freight != null && Object2.Freight != null ) { if (Object1.Freight != Object2.Freight) equal = false; } else if (Object1.Freight == null ^ Object1.Freight == null ) { equal = false; } if (Object1.ShipName != null && Object2.ShipName != null ) { if (Object1.ShipName != Object2.ShipName) equal = false; } else if (Object1.ShipName == null ^ Object1.ShipName == null ) { equal = false; } if (Object1.ShipAddress != null && Object2.ShipAddress != null ) { if (Object1.ShipAddress != Object2.ShipAddress) equal = false; } else if (Object1.ShipAddress == null ^ Object1.ShipAddress == null ) { equal = false; } if (Object1.ShipCity != null && Object2.ShipCity != null ) { if (Object1.ShipCity != Object2.ShipCity) equal = false; } else if (Object1.ShipCity == null ^ Object1.ShipCity == null ) { equal = false; } if (Object1.ShipRegion != null && Object2.ShipRegion != null ) { if (Object1.ShipRegion != Object2.ShipRegion) equal = false; } else if (Object1.ShipRegion == null ^ Object1.ShipRegion == null ) { equal = false; } if (Object1.ShipPostalCode != null && Object2.ShipPostalCode != null ) { if (Object1.ShipPostalCode != Object2.ShipPostalCode) equal = false; } else if (Object1.ShipPostalCode == null ^ Object1.ShipPostalCode == null ) { equal = false; } if (Object1.ShipCountry != null && Object2.ShipCountry != null ) { if (Object1.ShipCountry != Object2.ShipCountry) equal = false; } else if (Object1.ShipCountry == null ^ Object1.ShipCountry == null ) { equal = false; } if (Object1.CompanyName != Object2.CompanyName) equal = false; if (Object1.Address != null && Object2.Address != null ) { if (Object1.Address != Object2.Address) equal = false; } else if (Object1.Address == null ^ Object1.Address == null ) { equal = false; } if (Object1.City != null && Object2.City != null ) { if (Object1.City != Object2.City) equal = false; } else if (Object1.City == null ^ Object1.City == null ) { equal = false; } if (Object1.Region != null && Object2.Region != null ) { if (Object1.Region != Object2.Region) equal = false; } else if (Object1.Region == null ^ Object1.Region == null ) { equal = false; } if (Object1.PostalCode != null && Object2.PostalCode != null ) { if (Object1.PostalCode != Object2.PostalCode) equal = false; } else if (Object1.PostalCode == null ^ Object1.PostalCode == null ) { equal = false; } if (Object1.Country != null && Object2.Country != null ) { if (Object1.Country != Object2.Country) equal = false; } else if (Object1.Country == null ^ Object1.Country == null ) { equal = false; } return equal; }