Esempio n. 1
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (obj == this)
            {
                return(true);
            }

            return(obj is V1Employee other &&
                   ((Context == null && other.Context == null) || (Context?.Equals(other.Context) == true)) &&
                   ((Id == null && other.Id == null) || (Id?.Equals(other.Id) == true)) &&
                   ((FirstName == null && other.FirstName == null) || (FirstName?.Equals(other.FirstName) == true)) &&
                   ((LastName == null && other.LastName == null) || (LastName?.Equals(other.LastName) == true)) &&
                   ((RoleIds == null && other.RoleIds == null) || (RoleIds?.Equals(other.RoleIds) == true)) &&
                   ((AuthorizedLocationIds == null && other.AuthorizedLocationIds == null) || (AuthorizedLocationIds?.Equals(other.AuthorizedLocationIds) == true)) &&
                   ((Email == null && other.Email == null) || (Email?.Equals(other.Email) == true)) &&
                   ((Status == null && other.Status == null) || (Status?.Equals(other.Status) == true)) &&
                   ((ExternalId == null && other.ExternalId == null) || (ExternalId?.Equals(other.ExternalId) == true)) &&
                   ((CreatedAt == null && other.CreatedAt == null) || (CreatedAt?.Equals(other.CreatedAt) == true)) &&
                   ((UpdatedAt == null && other.UpdatedAt == null) || (UpdatedAt?.Equals(other.UpdatedAt) == true)));
        }
Esempio n. 2
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (obj == this)
            {
                return(true);
            }

            return(obj is Address other &&
                   ((AddressLine1 == null && other.AddressLine1 == null) || (AddressLine1?.Equals(other.AddressLine1) == true)) &&
                   ((AddressLine2 == null && other.AddressLine2 == null) || (AddressLine2?.Equals(other.AddressLine2) == true)) &&
                   ((AddressLine3 == null && other.AddressLine3 == null) || (AddressLine3?.Equals(other.AddressLine3) == true)) &&
                   ((Locality == null && other.Locality == null) || (Locality?.Equals(other.Locality) == true)) &&
                   ((Sublocality == null && other.Sublocality == null) || (Sublocality?.Equals(other.Sublocality) == true)) &&
                   ((Sublocality2 == null && other.Sublocality2 == null) || (Sublocality2?.Equals(other.Sublocality2) == true)) &&
                   ((Sublocality3 == null && other.Sublocality3 == null) || (Sublocality3?.Equals(other.Sublocality3) == true)) &&
                   ((AdministrativeDistrictLevel1 == null && other.AdministrativeDistrictLevel1 == null) || (AdministrativeDistrictLevel1?.Equals(other.AdministrativeDistrictLevel1) == true)) &&
                   ((AdministrativeDistrictLevel2 == null && other.AdministrativeDistrictLevel2 == null) || (AdministrativeDistrictLevel2?.Equals(other.AdministrativeDistrictLevel2) == true)) &&
                   ((AdministrativeDistrictLevel3 == null && other.AdministrativeDistrictLevel3 == null) || (AdministrativeDistrictLevel3?.Equals(other.AdministrativeDistrictLevel3) == true)) &&
                   ((PostalCode == null && other.PostalCode == null) || (PostalCode?.Equals(other.PostalCode) == true)) &&
                   ((Country == null && other.Country == null) || (Country?.Equals(other.Country) == true)) &&
                   ((FirstName == null && other.FirstName == null) || (FirstName?.Equals(other.FirstName) == true)) &&
                   ((LastName == null && other.LastName == null) || (LastName?.Equals(other.LastName) == true)) &&
                   ((Organization == null && other.Organization == null) || (Organization?.Equals(other.Organization) == true)));
        }
Esempio n. 3
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (obj == this)
            {
                return(true);
            }

            return(obj is Employee other &&
                   ((Id == null && other.Id == null) || (Id?.Equals(other.Id) == true)) &&
                   ((FirstName == null && other.FirstName == null) || (FirstName?.Equals(other.FirstName) == true)) &&
                   ((LastName == null && other.LastName == null) || (LastName?.Equals(other.LastName) == true)) &&
                   ((Email == null && other.Email == null) || (Email?.Equals(other.Email) == true)) &&
                   ((PhoneNumber == null && other.PhoneNumber == null) || (PhoneNumber?.Equals(other.PhoneNumber) == true)) &&
                   ((LocationIds == null && other.LocationIds == null) || (LocationIds?.Equals(other.LocationIds) == true)) &&
                   ((Status == null && other.Status == null) || (Status?.Equals(other.Status) == true)) &&
                   ((IsOwner == null && other.IsOwner == null) || (IsOwner?.Equals(other.IsOwner) == true)) &&
                   ((CreatedAt == null && other.CreatedAt == null) || (CreatedAt?.Equals(other.CreatedAt) == true)) &&
                   ((UpdatedAt == null && other.UpdatedAt == null) || (UpdatedAt?.Equals(other.UpdatedAt) == true)));
        }
Esempio n. 4
0
        public string GenerateUpdateJsonFromObject(Person updateFrom)
        {
            // form the json (determine the fields that need to be updated)
            var sb     = new StringBuilder();
            var sw     = new StringWriter(sb);
            var writer = new JsonTextWriter(sw)
            {
                Formatting = Formatting.None
            };

            writer.WriteStartObject();
            writer.WritePropertyName(@"person");
            writer.WriteStartObject();

            if (!LastName.Equals(updateFrom.LastName))
            {
                writer.WritePropertyName("last_name");
                writer.WriteValue(updateFrom.LastName);
            }

            if (!FirstName.Equals(updateFrom.FirstName))
            {
                writer.WritePropertyName("first_name");
                writer.WriteValue(updateFrom.FirstName);
            }

            if (!MiddleName.Equals(updateFrom.MiddleName))
            {
                writer.WritePropertyName("middle_name");
                writer.WriteValue(updateFrom.MiddleName);
            }

            if (!Gender.Equals(updateFrom.Gender))
            {
                writer.WritePropertyName("sex");
                writer.WriteValue(updateFrom.Gender);
            }

            if (!DateOfBirth.Equals(updateFrom.DateOfBirth))
            {
                writer.WritePropertyName("dob");
                writer.WriteValue(updateFrom.DateOfBirth);
            }

            if (!DateOfBirthIsApproximate.Equals(updateFrom.DateOfBirthIsApproximate))
            {
                writer.WritePropertyName("is_birthdate_approximate");
                writer.WriteValue(updateFrom.DateOfBirthIsApproximate);
            }

            if (!RelationshipToHeadOfHousehold.Equals(updateFrom.RelationshipToHeadOfHousehold))
            {
                writer.WritePropertyName("relationship_id");
                writer.WriteValue(updateFrom.RelationshipToHeadOfHousehold.ExternalId);
            }

            if (!RelationshipIfOther.Equals(updateFrom.RelationshipIfOther))
            {
                writer.WritePropertyName("relationship_other");
                writer.WriteValue(updateFrom.RelationshipIfOther);
            }

            if (!IntakeDate.Equals(updateFrom.IntakeDate))
            {
                writer.WritePropertyName("intake_date");
                writer.WriteValue(updateFrom.IntakeDate);
            }

            if (!HaveJobReturningTo.Equals(updateFrom.HaveJobReturningTo))
            {
                writer.WritePropertyName("have_job_returning_to");
                writer.WriteValue(updateFrom.HaveJobReturningTo);
            }

            if (!HoursWorked.Equals(updateFrom.HoursWorked))
            {
                writer.WritePropertyName("hours_worked");
                writer.WriteValue(updateFrom.HoursWorked);
            }

            if (!HouseWorkedOnHousework.Equals(updateFrom.HouseWorkedOnHousework))
            {
                writer.WritePropertyName("hours_worked_on_housework");
                writer.WriteValue(updateFrom.HouseWorkedOnHousework);
            }

            if (!EnrolledInSchool.Equals(updateFrom.EnrolledInSchool))
            {
                writer.WritePropertyName("enrolled_in_school");
                writer.WriteValue(updateFrom.EnrolledInSchool);
            }

            if (!GpsLatitude.Equals(updateFrom.GpsLatitude))
            {
                writer.WritePropertyName("latitude");
                writer.WriteValue(updateFrom.GpsLatitude);
            }

            if (!GpsLongitude.Equals(updateFrom.GpsLongitude))
            {
                writer.WritePropertyName("longitude");
                writer.WriteValue(updateFrom.GpsLongitude);
            }

            if (!GpsPositionAccuracy.Equals(updateFrom.GpsPositionAccuracy))
            {
                writer.WritePropertyName("position_accuracy");
                writer.WriteValue(updateFrom.GpsPositionAccuracy);
            }

            if (!GpsAltitude.Equals(updateFrom.GpsAltitude))
            {
                writer.WritePropertyName("altitude");
                writer.WriteValue(updateFrom.GpsAltitude);
            }

            if (!GpsAltitudeAccuracy.Equals(updateFrom.GpsAltitudeAccuracy))
            {
                writer.WritePropertyName("altitude_accuracy");
                writer.WriteValue(updateFrom.GpsAltitudeAccuracy);
            }

            if (!GpsHeading.Equals(updateFrom.GpsHeading))
            {
                writer.WritePropertyName("heading");
                writer.WriteValue(updateFrom.GpsHeading);
            }

            if (!GpsSpeed.Equals(updateFrom.GpsSpeed))
            {
                writer.WritePropertyName("speed");
                writer.WriteValue(updateFrom.GpsSpeed);
            }

            if (!GpsPositionTime.Equals(updateFrom.GpsPositionTime))
            {
                writer.WritePropertyName("gps_recorded_at");
                writer.WriteValue(updateFrom.GpsPositionTime);
            }

            if (!PeopleHazardousConditions.Select(a => a.HazardousCondition).SequenceEqual(updateFrom.PeopleHazardousConditions.Select(a => a.HazardousCondition)))
            {
                writer.WritePropertyName("hazardous_condition_ids");
                writer.WriteRawValue(GetStatusArrayAsJsonString(PeopleHazardousConditions.Select(a => a.HazardousCondition)));
            }

            if (!PeopleWorkActivities.Select(a => a.WorkActivity).SequenceEqual(updateFrom.PeopleWorkActivities.Select(a => a.WorkActivity)))
            {
                writer.WritePropertyName("work_activity_ids");
                writer.WriteRawValue(GetStatusArrayAsJsonString(PeopleWorkActivities.Select(a => a.WorkActivity)));
            }

            if (!PeopleHouseholdTasks.Select(a => a.HouseholdTask).SequenceEqual(updateFrom.PeopleHouseholdTasks.Select(a => a.HouseholdTask)))
            {
                writer.WritePropertyName("household_task_ids");
                writer.WriteRawValue(GetStatusArrayAsJsonString(PeopleHouseholdTasks.Select(a => a.HouseholdTask)));
            }

            if (!ExternalParentId.Equals(updateFrom.ExternalParentId))
            {
                writer.WritePropertyName("household_id");
                writer.WriteValue(updateFrom.ExternalParentId);
            }

            writer.WriteEndObject();
            writer.WriteEndObject();
            return(sw.ToString());
        }
Esempio n. 5
0
 public bool GetObjectNeedsUpate(Person checkUpdateFrom)
 {
     if (!LastName.Equals(checkUpdateFrom.LastName))
     {
         return(true);
     }
     if (!FirstName.Equals(checkUpdateFrom.FirstName))
     {
         return(true);
     }
     if (!MiddleName.Equals(checkUpdateFrom.MiddleName))
     {
         return(true);
     }
     if (!Gender.Equals(checkUpdateFrom.Gender))
     {
         return(true);
     }
     if (!DateOfBirth.Equals(checkUpdateFrom.DateOfBirth))
     {
         return(true);
     }
     if (!DateOfBirthIsApproximate.Equals(checkUpdateFrom.DateOfBirthIsApproximate))
     {
         return(true);
     }
     if (!RelationshipToHeadOfHousehold.Equals(checkUpdateFrom.RelationshipToHeadOfHousehold))
     {
         return(true);
     }
     if (!RelationshipIfOther.Equals(checkUpdateFrom.RelationshipIfOther))
     {
         return(true);
     }
     if (!IntakeDate.Equals(checkUpdateFrom.IntakeDate))
     {
         return(true);
     }
     if (!HaveJobReturningTo.Equals(checkUpdateFrom.HaveJobReturningTo))
     {
         return(true);
     }
     if (!HoursWorked.Equals(checkUpdateFrom.HoursWorked))
     {
         return(true);
     }
     if (!HouseWorkedOnHousework.Equals(checkUpdateFrom.HouseWorkedOnHousework))
     {
         return(true);
     }
     if (!EnrolledInSchool.Equals(checkUpdateFrom.EnrolledInSchool))
     {
         return(true);
     }
     if (!GpsLatitude.Equals(checkUpdateFrom.GpsLatitude))
     {
         return(true);
     }
     if (!GpsLongitude.Equals(checkUpdateFrom.GpsLongitude))
     {
         return(true);
     }
     if (!GpsPositionAccuracy.Equals(checkUpdateFrom.GpsPositionAccuracy))
     {
         return(true);
     }
     if (!GpsAltitude.Equals(checkUpdateFrom.GpsAltitude))
     {
         return(true);
     }
     if (!GpsAltitudeAccuracy.Equals(checkUpdateFrom.GpsAltitudeAccuracy))
     {
         return(true);
     }
     if (!GpsHeading.Equals(checkUpdateFrom.GpsHeading))
     {
         return(true);
     }
     if (!GpsSpeed.Equals(checkUpdateFrom.GpsSpeed))
     {
         return(true);
     }
     if (!GpsPositionTime.Equals(checkUpdateFrom.GpsPositionTime))
     {
         return(true);
     }
     if (!PeopleHazardousConditions.Select(a => a.HazardousCondition).SequenceEqual(checkUpdateFrom.PeopleHazardousConditions.Select(a => a.HazardousCondition)))
     {
         return(true);
     }
     if (!PeopleWorkActivities.Select(a => a.WorkActivity).SequenceEqual(checkUpdateFrom.PeopleWorkActivities.Select(a => a.WorkActivity)))
     {
         return(true);
     }
     if (!PeopleHouseholdTasks.Select(a => a.HouseholdTask).SequenceEqual(checkUpdateFrom.PeopleHouseholdTasks.Select(a => a.HouseholdTask)))
     {
         return(true);
     }
     if (!ExternalParentId.Equals(checkUpdateFrom.ExternalParentId))
     {
         return(true);
     }
     return(false);
 }
Esempio n. 6
0
        public override bool Equals(object obj)
        {
            var player = obj as Player;

            return(LastName.Equals(player.LastName, StringComparison.InvariantCultureIgnoreCase) && Initial.Equals(player.Initial, StringComparison.InvariantCultureIgnoreCase));
        }
        /// <summary>
        /// Returns true if DepartmentDocumentSearchRequest instances are equal
        /// </summary>
        /// <param name="other">Instance of DepartmentDocumentSearchRequest to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(DepartmentDocumentSearchRequest other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     FirstName == other.FirstName ||
                     FirstName != null &&
                     FirstName.Equals(other.FirstName)
                     ) &&
                 (
                     LastName == other.LastName ||
                     LastName != null &&
                     LastName.Equals(other.LastName)
                 ) &&
                 (
                     CompanyName == other.CompanyName ||
                     CompanyName != null &&
                     CompanyName.Equals(other.CompanyName)
                 ) &&
                 (
                     DepartmentDocumentNumber == other.DepartmentDocumentNumber ||
                     DepartmentDocumentNumber != null &&
                     DepartmentDocumentNumber.Equals(other.DepartmentDocumentNumber)
                 ) &&
                 (
                     DdnSearchType == other.DdnSearchType ||
                     DdnSearchType != null &&
                     DdnSearchType.Equals(other.DdnSearchType)
                 ) &&
                 (
                     CheckNumber == other.CheckNumber ||
                     CheckNumber != null &&
                     CheckNumber.Equals(other.CheckNumber)
                 ) &&
                 (
                     DepositNumber == other.DepositNumber ||
                     DepositNumber != null &&
                     DepositNumber.Equals(other.DepositNumber)
                 ) &&
                 (
                     TransmittalNumber == other.TransmittalNumber ||
                     TransmittalNumber != null &&
                     TransmittalNumber.Equals(other.TransmittalNumber)
                 ) &&
                 (
                     TransmittalStatus == other.TransmittalStatus ||
                     TransmittalStatus != null &&
                     TransmittalStatus.Equals(other.TransmittalStatus)
                 ) &&
                 (
                     CheckAmount == other.CheckAmount ||
                     CheckAmount != null &&
                     CheckAmount.Equals(other.CheckAmount)
                 ) &&
                 (
                     CashListing == other.CashListing ||
                     CashListing != null &&
                     CashListing.Equals(other.CashListing)
                 ) &&
                 (
                     EoCode == other.EoCode ||
                     EoCode != null &&
                     EoCode.Equals(other.EoCode)
                 ) &&
                 (
                     ObjectCode == other.ObjectCode ||
                     ObjectCode != null &&
                     ObjectCode.Equals(other.ObjectCode)
                 ) &&
                 (
                     DepositDateFrom == other.DepositDateFrom ||
                     DepositDateFrom != null &&
                     DepositDateFrom.Equals(other.DepositDateFrom)
                 ) &&
                 (
                     DepositDateTo == other.DepositDateTo ||
                     DepositDateTo != null &&
                     DepositDateTo.Equals(other.DepositDateTo)
                 ));
        }
Esempio n. 8
0
        /// <inheritdoc />
        /// <summary>
        /// Returns true if SpeakerDraft instances are equal
        /// </summary>
        /// <param name="other">Instance of SpeakerDraft to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(SpeakerDraft other)
        {
#pragma warning disable IDE0041 // Use 'is null' check
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

#pragma warning disable CA1309                  // Use ordinal stringcomparison
#pragma warning disable CA1307                  // Specify StringComparison
#pragma warning disable SA1515                  // Single-line comment must be preceded by blank line
#pragma warning disable SA1009                  // Closing parenthesis must be spaced correctly
            return
                (#pragma warning disable SA1119 // Statement must not use unnecessary parenthesis
                 (
                     // ReSharper disable once RedundantNameQualifier
                     string.Equals(Id, other.Id) ||
                     (Id != null && Id.Equals(other.Id))
                 ) &&
                 (
                     // ReSharper disable once RedundantNameQualifier
                     string.Equals(FirstName, other.FirstName) ||
                     (FirstName != null && FirstName.Equals(other.FirstName))
                 ) &&
                 (
                     // ReSharper disable once RedundantNameQualifier
                     string.Equals(LastName, other.LastName) ||
                     (LastName != null && LastName.Equals(other.LastName))
                 ) &&
                 (
                     // ReSharper disable once RedundantNameQualifier
                     string.Equals(Description, other.Description) ||
                     (Description != null && Description.Equals(other.Description))
                 ) &&
                 (
                     // ReSharper disable once RedundantNameQualifier
                     string.Equals(CompanyName, other.CompanyName) ||
                     (CompanyName != null && CompanyName.Equals(other.CompanyName))
                 ) &&
                 (
                     // ReSharper disable once RedundantNameQualifier
                     string.Equals(CompanyUrl, other.CompanyUrl) ||
                     (CompanyUrl != null && CompanyUrl.Equals(other.CompanyUrl))
                 ) &&
                 (
                     // ReSharper disable once RedundantNameQualifier
                     string.Equals(BlogsUrl, other.BlogsUrl) ||
                     (BlogsUrl != null && BlogsUrl.Equals(other.BlogsUrl))
                 ) &&
                 (
                     // ReSharper disable once RedundantNameQualifier
                     string.Equals(ContactsUrl, other.ContactsUrl) ||
                     (ContactsUrl != null && ContactsUrl.Equals(other.ContactsUrl))
                 ) &&
                 (
                     // ReSharper disable once RedundantNameQualifier
                     string.Equals(TwitterUrl, other.TwitterUrl) ||
                     (TwitterUrl != null && TwitterUrl.Equals(other.TwitterUrl))
                 ) &&
                 (
                     // ReSharper disable once RedundantNameQualifier
                     string.Equals(HabrUrl, other.HabrUrl) ||
                     (HabrUrl != null && HabrUrl.Equals(other.HabrUrl))
                 ) &&
                 (
                     // ReSharper disable once RedundantNameQualifier
                     string.Equals(GitHubUrl, other.GitHubUrl) ||
                     (GitHubUrl != null && GitHubUrl.Equals(other.GitHubUrl))
                 ) &&
                 (
                     TalkDrafts == other.TalkDrafts ||
                     (TalkDrafts != null && TalkDrafts.SequenceEqual(other.TalkDrafts))
                 ));

#pragma warning restore SA1119 // Statement must not use unnecessary parenthesis
#pragma warning restore SA1009 // Closing parenthesis must be spaced correctly
#pragma warning restore SA1515 // Single-line comment must be preceded by blank line
#pragma warning restore CA1307 // Specify StringComparison
#pragma warning restore CA1309 // Use ordinal stringcomparison
        }
Esempio n. 9
0
 public override bool Equals(object obj)
 {
     return(FirstName.Equals(((User)obj).FirstName) && LastName.Equals(((User)obj).LastName) && Email.Equals(((User)obj).Email) &&
            Phone.Equals(((User)obj).Phone));
 }