Пример #1
0
        public bool Equals(ConventionInfoDto other)
        {
            if (other == null)
            {
                return(false);
            }

            return(Id.Equals(other.Id) &&
                   RequestId.Equals(other.RequestId) &&
                   CountryId.Equals(other.CountryId) &&
                   EarlyRegTypeId.Equals(other.EarlyRegTypeId) &&
                   string.Equals((string)RegNumberInternationalApp, (string)other.RegNumberInternationalApp) &&
                   string.Equals((string)PublishRegNumberInternationalApp,
                                 (string)other.PublishRegNumberInternationalApp) &&
                   string.Equals((string)RegNumberEurasianApp, (string)other.RegNumberEurasianApp) &&
                   string.Equals((string)PublishRegNumberEurasianApp, (string)other.PublishRegNumberEurasianApp) &&
                   string.Equals((string)HeadIps, (string)other.HeadIps) &&
                   Object.Equals(DateInternationalApp, other.DateInternationalApp) &&
                   Object.Equals(PublishDateInternationalApp, other.PublishDateInternationalApp) &&
                   Object.Equals(DateEurasianApp, other.DateEurasianApp) &&
                   Object.Equals(PublishDateEurasianApp, other.PublishDateEurasianApp) &&
                   Object.Equals(InternationalAppToNationalPhaseTransferDate,
                                 other.InternationalAppToNationalPhaseTransferDate) &&
                   Object.Equals(TermNationalPhaseFirsChapter, other.TermNationalPhaseFirsChapter) &&
                   Object.Equals(TermNationalPhaseSecondChapter, other.TermNationalPhaseSecondChapter));
        }
Пример #2
0
        /// <summary>
        /// Returns true if CitizenshipModel2 instances are equal
        /// </summary>
        /// <param name="other">Instance of CitizenshipModel2 to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(CitizenshipModel2 other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     CountryId == other.CountryId ||
                     CountryId != null &&
                     CountryId.Equals(other.CountryId)
                     ) &&
                 (
                     NewCountryId == other.NewCountryId ||
                     NewCountryId != null &&
                     NewCountryId.Equals(other.NewCountryId)
                 ) &&
                 (
                     IsPrimary == other.IsPrimary ||
                     IsPrimary != null &&
                     IsPrimary.Equals(other.IsPrimary)
                 ) &&
                 (
                     SessionToken == other.SessionToken ||
                     SessionToken != null &&
                     SessionToken.Equals(other.SessionToken)
                 ));
        }
Пример #3
0
        /// <summary>
        /// Returns true if PhysicalAddress instances are equal
        /// </summary>
        /// <param name="other">Instance of PhysicalAddress to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(PhysicalAddress other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     CountryId == other.CountryId ||
                     CountryId != null &&
                     CountryId.Equals(other.CountryId)
                     ) &&
                 (
                     Zip == other.Zip ||
                     Zip != null &&
                     Zip.Equals(other.Zip)
                 ) &&
                 (
                     City == other.City ||
                     City != null &&
                     City.Equals(other.City)
                 ) &&
                 (
                     AdministrativeArea == other.AdministrativeArea ||
                     AdministrativeArea != null &&
                     AdministrativeArea.Equals(other.AdministrativeArea)
                 ) &&
                 (
                     DependentLocality == other.DependentLocality ||
                     DependentLocality != null &&
                     DependentLocality.Equals(other.DependentLocality)
                 ) &&
                 (
                     SortingCode == other.SortingCode ||
                     SortingCode != null &&
                     SortingCode.Equals(other.SortingCode)
                 ) &&
                 (
                     Organization == other.Organization ||
                     Organization != null &&
                     Organization.Equals(other.Organization)
                 ) &&
                 (
                     AddressLine1 == other.AddressLine1 ||
                     AddressLine1 != null &&
                     AddressLine1.Equals(other.AddressLine1)
                 ) &&
                 (
                     AddressLine2 == other.AddressLine2 ||
                     AddressLine2 != null &&
                     AddressLine2.Equals(other.AddressLine2)
                 ));
        }
Пример #4
0
        public override bool Equals(object obj)
        {
            var other = obj as CountryInfo;

            if (other == null)
            {
                return(false);
            }

            return(CountryId.Equals(other.CountryId));
        }
Пример #5
0
        //private IEnumerable<Product> GetProducts(Func<Product, bool> condition)
        //{
        //    if (Products == null)
        //    {
        //        return null;
        //    }
        //    return Products.Where(condition);
        //}

        public int?GetDistance(string destCountryCode, string destCity, string destSuburb)
        {
            if (string.IsNullOrEmpty(destCountryCode) || string.IsNullOrEmpty(destCity) ||
                string.IsNullOrEmpty(destSuburb))
            {
                return(null);
            }

            if (!CountryId.Equals(destCountryCode) || !City.Equals(destCity))
            {
                return(null);
            }

            if (Suburb.Equals(destSuburb))
            {
                return(0);
            }

            return(SuburbDistance.GetDistance(CountryId, City, Suburb, destCountryCode, destCity, destSuburb));
        }
Пример #6
0
        /// <summary>
        /// Returns true if AddressesModel2 instances are equal
        /// </summary>
        /// <param name="other">Instance of AddressesModel2 to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(AddressesModel2 other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     AddressId == other.AddressId ||
                     AddressId != null &&
                     AddressId.Equals(other.AddressId)
                     ) &&
                 (
                     Nickname == other.Nickname ||
                     Nickname != null &&
                     Nickname.Equals(other.Nickname)
                 ) &&
                 (
                     CountryId == other.CountryId ||
                     CountryId != null &&
                     CountryId.Equals(other.CountryId)
                 ) &&
                 (
                     Zip == other.Zip ||
                     Zip != null &&
                     Zip.Equals(other.Zip)
                 ) &&
                 (
                     City == other.City ||
                     City != null &&
                     City.Equals(other.City)
                 ) &&
                 (
                     AdministrativeArea == other.AdministrativeArea ||
                     AdministrativeArea != null &&
                     AdministrativeArea.Equals(other.AdministrativeArea)
                 ) &&
                 (
                     DependentLocality == other.DependentLocality ||
                     DependentLocality != null &&
                     DependentLocality.Equals(other.DependentLocality)
                 ) &&
                 (
                     SortingCode == other.SortingCode ||
                     SortingCode != null &&
                     SortingCode.Equals(other.SortingCode)
                 ) &&
                 (
                     Organization == other.Organization ||
                     Organization != null &&
                     Organization.Equals(other.Organization)
                 ) &&
                 (
                     AddressLine1 == other.AddressLine1 ||
                     AddressLine1 != null &&
                     AddressLine1.Equals(other.AddressLine1)
                 ) &&
                 (
                     AddressLine2 == other.AddressLine2 ||
                     AddressLine2 != null &&
                     AddressLine2.Equals(other.AddressLine2)
                 ) &&
                 (
                     IsPrimary == other.IsPrimary ||
                     IsPrimary != null &&
                     IsPrimary.Equals(other.IsPrimary)
                 ) &&
                 (
                     SessionToken == other.SessionToken ||
                     SessionToken != null &&
                     SessionToken.Equals(other.SessionToken)
                 ));
        }