public override int GetHashCode() { int hash = 1; if (UserId.Length != 0) { hash ^= UserId.GetHashCode(); } if (legalName_ != null) { hash ^= LegalName.GetHashCode(); } if (Token.Length != 0) { hash ^= Token.GetHashCode(); } if (expireAt_ != null) { hash ^= ExpireAt.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
/// <summary> /// Serves as a hash function for a particular type. /// </summary> /// <returns> /// A hash code for the current <see cref = "T:System.Object" />. /// </returns> /// <filterpriority>2</filterpriority> public override int GetHashCode() { unchecked { int result = LegalName != null?LegalName.GetHashCode() : 0; result = (result * 397) ^ (DoingBusinessAsName != null ? DoingBusinessAsName.GetHashCode() : 0); result = (result * 397) ^ (DisplayName != null ? DisplayName.GetHashCode() : 0); return(result); } }
private Account CreateUL( Account tempAccount , AccountKonturFocusModel accountFromKonturFocus , ITracingService tracingService ) { LegalName legalName = accountFromKonturFocus.UL?.legalName; tempAccount.Name = legalName?.@short ?? legalName?.full; tempAccount.AccountType = AccountTypeEnum.UL; tempAccount.RegisteredOn = accountFromKonturFocus.UL?.registrationDate; tempAccount.Inn = accountFromKonturFocus.inn; tempAccount.Ogrn = accountFromKonturFocus.ogrn; tempAccount.Kpp = accountFromKonturFocus.UL.kpp; tempAccount.OKPO = accountFromKonturFocus.UL.okpo; FillAddress(tempAccount, tracingService, accountFromKonturFocus); return(tempAccount); }
private void Custom_Name_TextChanged(object sender, TextChangedEventArgs e) //if there is a change to the custom name field { LegalName lgname = new LegalName(); //make a new instance of the legalname bool isLegal = lgname.Check(Custom_Name.Text); //check if the name is legal if (!isLegal) { Ess.Visibility = Visibility.Visible; //display warning } else { NewName = Custom_Name.Text; //save the new name for storage try { Ess.Visibility = Visibility.Hidden; //hide warning } catch { } } Name_c = lgname.CheckLn(Custom_Name.Text); NeedsRecount = lgname.Recount("Al", lgname.IsFastMode(Custom_Name.Text)); //determine if a recount is needed }
/// <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 :) if (LastUpdateTime != null) { hashCode = hashCode * 59 + LastUpdateTime.GetHashCode(); } if (AgentFirstName != null) { hashCode = hashCode * 59 + AgentFirstName.GetHashCode(); } if (AgentLastName != null) { hashCode = hashCode * 59 + AgentLastName.GetHashCode(); } if (AgentRole != null) { hashCode = hashCode * 59 + AgentRole.GetHashCode(); } if (BusinessName != null) { hashCode = hashCode * 59 + BusinessName.GetHashCode(); } if (LegalName != null) { hashCode = hashCode * 59 + LegalName.GetHashCode(); } if (ShortName != null) { hashCode = hashCode * 59 + ShortName.GetHashCode(); } if (Abn != null) { hashCode = hashCode * 59 + Abn.GetHashCode(); } if (Acn != null) { hashCode = hashCode * 59 + Acn.GetHashCode(); } if (IsACNCRegistered != null) { hashCode = hashCode * 59 + IsACNCRegistered.GetHashCode(); } if (IndustryCode != null) { hashCode = hashCode * 59 + IndustryCode.GetHashCode(); } if (OrganisationType != null) { hashCode = hashCode * 59 + OrganisationType.GetHashCode(); } if (RegisteredCountry != null) { hashCode = hashCode * 59 + RegisteredCountry.GetHashCode(); } if (EstablishmentDate != null) { hashCode = hashCode * 59 + EstablishmentDate.GetHashCode(); } return(hashCode); } }
/// <summary> /// Returns true if CommonOrganisation instances are equal /// </summary> /// <param name="other">Instance of CommonOrganisation to be compared</param> /// <returns>Boolean</returns> public bool Equals(CommonOrganisation other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( LastUpdateTime == other.LastUpdateTime || LastUpdateTime != null && LastUpdateTime.Equals(other.LastUpdateTime) ) && ( AgentFirstName == other.AgentFirstName || AgentFirstName != null && AgentFirstName.Equals(other.AgentFirstName) ) && ( AgentLastName == other.AgentLastName || AgentLastName != null && AgentLastName.Equals(other.AgentLastName) ) && ( AgentRole == other.AgentRole || AgentRole != null && AgentRole.Equals(other.AgentRole) ) && ( BusinessName == other.BusinessName || BusinessName != null && BusinessName.Equals(other.BusinessName) ) && ( LegalName == other.LegalName || LegalName != null && LegalName.Equals(other.LegalName) ) && ( ShortName == other.ShortName || ShortName != null && ShortName.Equals(other.ShortName) ) && ( Abn == other.Abn || Abn != null && Abn.Equals(other.Abn) ) && ( Acn == other.Acn || Acn != null && Acn.Equals(other.Acn) ) && ( IsACNCRegistered == other.IsACNCRegistered || IsACNCRegistered != null && IsACNCRegistered.Equals(other.IsACNCRegistered) ) && ( IndustryCode == other.IndustryCode || IndustryCode != null && IndustryCode.Equals(other.IndustryCode) ) && ( OrganisationType == other.OrganisationType || OrganisationType != null && OrganisationType.Equals(other.OrganisationType) ) && ( RegisteredCountry == other.RegisteredCountry || RegisteredCountry != null && RegisteredCountry.Equals(other.RegisteredCountry) ) && ( EstablishmentDate == other.EstablishmentDate || EstablishmentDate != null && EstablishmentDate.Equals(other.EstablishmentDate) )); }