public override int GetHashCode() { int hashCode = IdVer.GetHashCode() + IdSubVer.GetHashCode() + Timestamp.GetHashCode() + (IdCustomer == null ? 0 : IdCustomer.GetHashCode()) + (CustomerName == null ? 0 : CustomerName.GetHashCode()) + Active.GetHashCode() + (VATNum == null ? 0 : VATNum.GetHashCode()) + (ShippingAddress == null ? 0 : ShippingAddress.GetHashCode()) + (ShippingAddressZh == null ? 0 : ShippingAddressZh.GetHashCode()) + (BillingAddress == null ? 0 : BillingAddress.GetHashCode()) + (BillingAddressZh == null ? 0 : BillingAddressZh.GetHashCode()) + (ContactName == null ? 0 : ContactName.GetHashCode()) + (ContactNameZh == null ? 0 : ContactNameZh.GetHashCode()) + (ContactPhone == null ? 0 : ContactPhone.GetHashCode()) + (Comments == null ? 0 : Comments.GetHashCode()) + (IdIncoterm == null ? 0 : IdIncoterm.GetHashCode()) + (IdPaymentTerms == null ? 0 : IdPaymentTerms.GetHashCode()) + (IdDefaultCurrency == null ? 0 : IdDefaultCurrency.GetHashCode()) + (User == null ? 0 : User.GetHashCode()); return(hashCode); }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) hashCode = hashCode * 59 + IdCustomer.GetHashCode(); if (Firstname != null) { hashCode = hashCode * 59 + Firstname.GetHashCode(); } if (Lastname != null) { hashCode = hashCode * 59 + Lastname.GetHashCode(); } if (Address != null) { hashCode = hashCode * 59 + Address.GetHashCode(); } if (AddressNr != null) { hashCode = hashCode * 59 + AddressNr.GetHashCode(); } if (Place != null) { hashCode = hashCode * 59 + Place.GetHashCode(); } return(hashCode); } }
public bool IsValid() { AddNotifications(new ValidationContract() .HasLen(IdCustomer.ToString(), 36, "IdCustomer", "Identificador do cliente inválido") .IsGreaterOrEqualsThan(OrderItems.Count, 0, "Items", "Nehum item no pedido foi encontrado") ); return(Valid); }
public override int GetHashCode() { var hashCode = -1956427436; hashCode = hashCode * -1521134295 + IdCustomer.GetHashCode(); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(FioC); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Phone); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Email); return(hashCode); }
/// <summary> /// Returns true if Customer instances are equal /// </summary> /// <param name="other">Instance of Customer to be compared</param> /// <returns>Boolean</returns> public bool Equals(Customer other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( IdCustomer == other.IdCustomer || IdCustomer.Equals(other.IdCustomer) ) && ( Firstname == other.Firstname || Firstname != null && Firstname.Equals(other.Firstname) ) && ( Lastname == other.Lastname || Lastname != null && Lastname.Equals(other.Lastname) ) && ( Address == other.Address || Address != null && Address.Equals(other.Address) ) && ( AddressNr == other.AddressNr || AddressNr != null && AddressNr.Equals(other.AddressNr) ) && ( Place == other.Place || Place != null && Place.Equals(other.Place) )); }
public override int GetHashCode() { int hashCode; hashCode = ( IdVer.GetHashCode() + IdSubVer.GetHashCode() + Timestamp.GetHashCode() + (IdItemBcn == null ? 0 : IdItemBcn.GetHashCode()) + (IdCustomer == null ? 0 : IdCustomer.GetHashCode()) + Price.GetHashCode() + (Comments == null ? 0 : Comments.GetHashCode()) + (IdCurrency == null ? 0 : IdCurrency.GetHashCode()) + PriceBaseCurrency.GetHashCode() + ExchangeRateUsed.GetHashCode() + MinLot.GetHashCode() + IncrLot.GetHashCode() + LeadTime.GetHashCode() ); return(hashCode); }