public void InputShippingAndBillingInfo(String firstName, String lastName, String phoneNumber, String emailAddress, String address, String zip, String city, String state, String country, Boolean sameBillingInformation, String repType) { FirstName.SendKeys(firstName); LastName.SendKeys(lastName); PhoneNumber.SendKeys(phoneNumber); EmailAddress.SendKeys(emailAddress); AddressLine1.SendKeys(address); if (country.Equals("US")) { ZipLookup(zip, city); } else { SelectElement StateSelectDropdown = new SelectElement(StateSelect); City.SendKeys(city); StateSelectDropdown.SelectByText(state); Zip.SendKeys(zip); } if (sameBillingInformation) { BillingInformationYesRadio.Click(); } else { BillingInformationNoRadio.Click(); } if (repType.Equals("WebAd")) { Thread.Sleep(1000); RefferingWebAdYesRadio.Click(); } }
void ICreditCard.AddParametersToRequest(RestRequest request) { request.AddParameter("card[number]", Number); request.AddParameter("card[exp_month]", ExpMonth); request.AddParameter("card[exp_year]", ExpYear); if (Cvc.HasValue()) { request.AddParameter("card[cvc]", Cvc); } if (Name.HasValue()) { request.AddParameter("card[name]", Name); } if (AddressLine1.HasValue()) { request.AddParameter("card[address_line1]", AddressLine1); } if (AddressLine2.HasValue()) { request.AddParameter("card[address_line2]", AddressLine2); } if (AddressZip.HasValue()) { request.AddParameter("card[address_zip]", AddressZip); } if (AddressState.HasValue()) { request.AddParameter("card[address_state]", AddressState); } if (AddressCountry.HasValue()) { request.AddParameter("card[address_country]", AddressCountry); } }
public void AddLocation(string shortName, string locationName, string addressLine1, string addressLine2, string city, string state, string zip) { GotoPracticeSettings(); Location.Click(); SearchGrid("celebration", 1); Thread.Sleep(1000); WaitForElementVisible <Locations>(30); Add.Click(); ShortName.SendKeys(shortName); LocationName.SendKeys(locationName); AddressLine1.SendKeys(addressLine1); AddressLine2.SendKeys(addressLine2); City.SendKeys(city); State.Select(state); Zip.SendKeys(zip); Save.Click(); Assert.AreEqual("Location saved successfully", Toastr.Text); }
/// <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 (AddressLine1 != null) { hashCode = hashCode * 59 + AddressLine1.GetHashCode(); } if (AddressLine2 != null) { hashCode = hashCode * 59 + AddressLine2.GetHashCode(); } if (City != null) { hashCode = hashCode * 59 + City.GetHashCode(); } if (State != null) { hashCode = hashCode * 59 + State.GetHashCode(); } if (Zip != null) { hashCode = hashCode * 59 + Zip.GetHashCode(); } if (Country != null) { hashCode = hashCode * 59 + Country.GetHashCode(); } return(hashCode); } }
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))); }
/// <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) )); }
public override int GetHashCode() { int h0 = AddressLine1?.GetHashCode() ?? 0; int h1 = AddressLine2?.GetHashCode() ?? 0; int h2 = City?.GetHashCode() ?? 0; int h3 = State?.GetHashCode() ?? 0; return(h0 ^ h1 ^ h2 ^ h3 ^ Zipcode); }
/// <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 (Nickname != null) { hashCode = hashCode * 59 + Nickname.GetHashCode(); } if (CountryId != null) { hashCode = hashCode * 59 + CountryId.GetHashCode(); } if (Zip != null) { hashCode = hashCode * 59 + Zip.GetHashCode(); } if (City != null) { hashCode = hashCode * 59 + City.GetHashCode(); } if (AdministrativeArea != null) { hashCode = hashCode * 59 + AdministrativeArea.GetHashCode(); } if (DependentLocality != null) { hashCode = hashCode * 59 + DependentLocality.GetHashCode(); } if (SortingCode != null) { hashCode = hashCode * 59 + SortingCode.GetHashCode(); } if (Organization != null) { hashCode = hashCode * 59 + Organization.GetHashCode(); } if (AddressLine1 != null) { hashCode = hashCode * 59 + AddressLine1.GetHashCode(); } if (AddressLine2 != null) { hashCode = hashCode * 59 + AddressLine2.GetHashCode(); } if (IsPrimary != null) { hashCode = hashCode * 59 + IsPrimary.GetHashCode(); } if (SessionToken != null) { hashCode = hashCode * 59 + SessionToken.GetHashCode(); } return(hashCode); } }
private void LoadAddressIntoView(UserAddress userAddress) { currentAddress = userAddress; FirstName.InitializeValue(userAddress.FirstName); LastName.InitializeValue(userAddress.LastName); AddressLine1.InitializeValue(userAddress.AddressLine1); AddressLine2.InitializeValue(userAddress.AddressLine2); City.InitializeValue(userAddress.City); Country.InitializeValue(userAddress.Country); PostCode.InitializeValue(userAddress.PostCode); State.InitializeValue(userAddress.State); }
/// <summary> /// Returns true if CommonSimpleAddress instances are equal /// </summary> /// <param name="other">Instance of CommonSimpleAddress to be compared</param> /// <returns>Boolean</returns> public bool Equals(CommonSimpleAddress other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( MailingName == other.MailingName || MailingName != null && MailingName.Equals(other.MailingName) ) && ( AddressLine1 == other.AddressLine1 || AddressLine1 != null && AddressLine1.Equals(other.AddressLine1) ) && ( AddressLine2 == other.AddressLine2 || AddressLine2 != null && AddressLine2.Equals(other.AddressLine2) ) && ( AddressLine3 == other.AddressLine3 || AddressLine3 != null && AddressLine3.Equals(other.AddressLine3) ) && ( Postcode == other.Postcode || Postcode != null && Postcode.Equals(other.Postcode) ) && ( City == other.City || City != null && City.Equals(other.City) ) && ( State == other.State || State != null && State.Equals(other.State) ) && ( Country == other.Country || Country != null && Country.Equals(other.Country) )); }
public void CreateBuildsAndPopulatesNestedInstances() { var actual = Model.WriteLog <Person>(_output.WriteLine).Create(); actual.Address.Should().NotBeNull(); actual.Address !.AddressLine1.Should().NotBeNullOrEmpty(); actual.Address.AddressLine2.Should().NotBeNullOrEmpty(); actual.Address.AddressLine3.Should().BeNullOrEmpty(); actual.Address.City.Should().NotBeNullOrEmpty(); actual.Address.Country.Should().NotBeNullOrEmpty(); actual.Address.State.Should().NotBeNullOrEmpty(); actual.Address.Suburb.Should().NotBeNullOrEmpty(); }
public bool Equals(Address other) { if (other == null) { return(false); } return(AddressLine1.Equals(other.AddressLine1) && ((AddressLine2 == null && other.AddressLine2 == null) || (AddressLine2 != null && AddressLine2.Equals(other.AddressLine2))) && PostalCode.Equals(other.PostalCode) && City.Equals(other.City) && Country.Equals(other.Country)); }
public override int GetHashCode() { unchecked { var hashCode = (_postcode != null ? _postcode.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (AddressLine1 != null ? AddressLine1.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (AddressLine2 != null ? AddressLine2.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (AddressLine3 != null ? AddressLine3.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (AddressLine4 != null ? AddressLine4.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Uprn != null ? Uprn.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (GeoPoint != null ? GeoPoint.GetHashCode() : 0); return(hashCode); } }
public override int GetHashCode() { unchecked { var hashCode = Id; hashCode = (hashCode * 397) ^ CustomerId; hashCode = (hashCode * 397) ^ (AddressLine1 != null ? AddressLine1.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (AddressLine2 != null ? AddressLine2.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (City != null ? City.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (State != null ? State.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Country != null ? Country.GetHashCode() : 0); return(hashCode); } }
// This splits the addressline 1 into a housenum, street name and suffix public void Split() { string[] address = { null }; address = AddressLine1.Split(' '); try { int.TryParse(address[0], out houseNumber); } catch (Exception e) { // Log here } streetName = address[1]; addressSuffix = address[2]; }
public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + (AddressLine1 == null ? 0 : AddressLine1.GetHashCode()); hash = hash * 23 + (AddressLine2 == null ? 0 : AddressLine2.GetHashCode()); hash = hash * 23 + (City == null ? 0 : City.GetHashCode()); hash = hash * 23 + (ModifiedDate == default(DateTime) ? 0 : ModifiedDate.GetHashCode()); hash = hash * 23 + (PostalCode == null ? 0 : PostalCode.GetHashCode()); hash = hash * 23 + (Rowguid == default(Guid) ? 0 : Rowguid.GetHashCode()); hash = hash * 23 + (StateProvinceId == default(int) ? 0 : StateProvinceId.GetHashCode()); return(hash); } }
void IObjectValidation.AddParametersToRequest(RestRequest request) { if (Token.HasValue()) { request.AddParameter("source", Token); } else { request.AddParameter("source[object]", "card"); request.AddParameter("source[number]", Number); request.AddParameter("source[exp_month]", ExpMonth); request.AddParameter("source[exp_year]", ExpYear); if (Cvc.HasValue()) { request.AddParameter("source[cvc]", Cvc); } if (Name.HasValue()) { request.AddParameter("source[name]", Name); } if (AddressLine1.HasValue()) { request.AddParameter("source[address_line1]", AddressLine1); } if (AddressLine2.HasValue()) { request.AddParameter("source[address_line2]", AddressLine2); } if (AddressCity.HasValue()) { request.AddParameter("source[address_city]", AddressCity); } if (AddressState.HasValue()) { request.AddParameter("source[address_state]", AddressState); } if (AddressZip.HasValue()) { request.AddParameter("source[address_zip]", AddressZip); } if (AddressCountry.HasValue()) { request.AddParameter("source[address_country]", AddressCountry); } } }
public List <string> GetList() { var list = new List <string>(); if (!string.IsNullOrWhiteSpace(AddressLine1)) { list.Add(AddressLine1.TrimI()); } if (!string.IsNullOrWhiteSpace(AddressLine2)) { list.Add(AddressLine2.TrimI()); } if (!string.IsNullOrWhiteSpace(AddressLine3)) { list.Add(AddressLine3.TrimI()); } if (!string.IsNullOrWhiteSpace(City)) { list.Add(City.TrimI()); } if (!string.IsNullOrWhiteSpace(County)) { list.Add(County.TrimI()); } if (!string.IsNullOrWhiteSpace(Country)) { list.Add(Country.TrimI()); } if (!string.IsNullOrWhiteSpace(PostalCode)) { list.Add(PostalCode.TrimI()); } if (!string.IsNullOrWhiteSpace(PoBox)) { list.Add(PoBox.TrimI()); } return(list); }
/// <summary> /// Returns true if Address instances are equal /// </summary> /// <param name="other">Instance of Address to be compared</param> /// <returns>Boolean</returns> public bool Equals(Address other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( AddressLine1 == other.AddressLine1 || AddressLine1 != null && AddressLine1.Equals(other.AddressLine1) ) && ( AddressLine2 == other.AddressLine2 || AddressLine2 != null && AddressLine2.Equals(other.AddressLine2) ) && ( City == other.City || City != null && City.Equals(other.City) ) && ( State == other.State || State != null && State.Equals(other.State) ) && ( Zip == other.Zip || Zip != null && Zip.Equals(other.Zip) ) && ( Country == other.Country || Country != null && Country.Equals(other.Country) )); }
public override string ToString() { StringBuilder builder = new StringBuilder(); builder.Append(Title.ReplaceQuotes()); builder.Append(" "); builder.Append(FirstName.ReplaceQuotes()); if (!String.IsNullOrEmpty(MiddleName.Trim())) { builder.Append(" "); builder.Append(MiddleName.ReplaceQuotes()); } builder.Append(" "); builder.Append(LastName.ReplaceQuotes()); builder.Append("\r\n"); if (!String.IsNullOrEmpty(AddressLine1.Trim())) { builder.Append(AddressLine1.ReplaceQuotes()); builder.Append("\r\n"); } if (!String.IsNullOrEmpty(AddressLine2.Trim())) { builder.Append(AddressLine2.ReplaceQuotes()); builder.Append("\r\n"); } if (!String.IsNullOrEmpty(City.Trim())) { builder.Append(City.ReplaceQuotes()); if (!String.IsNullOrEmpty(PinCode)) { builder.Append(" - "); builder.Append(PinCode.ReplaceQuotes()); } builder.Append("\r\n"); } builder.Append("\r\n"); return(builder.ToString()); }
public override int GetHashCode() { unchecked { const int hashBase = (int)2166136261; const int multiplier = 16777619; int hash = hashBase; hash = (hash * multiplier) ^ (ContactName is null ? 0 : ContactName.GetHashCode()); hash = (hash * multiplier) ^ (Department is null ? 0 : Department.GetHashCode()); hash = (hash * multiplier) ^ (Organisation is null ? 0 : Organisation.GetHashCode()); hash = (hash * multiplier) ^ (AddressLine1 is null ? 0 : AddressLine1.GetHashCode()); hash = (hash * multiplier) ^ (AddressLine2 is null ? 0 : AddressLine2.GetHashCode()); hash = (hash * multiplier) ^ (AddressLine3 is null ? 0 : AddressLine3.GetHashCode()); hash = (hash * multiplier) ^ (City is null ? 0 : City.GetHashCode()); hash = (hash * multiplier) ^ (PostCode is null ? 0 : PostCode.GetHashCode()); return(hash); } }
public override bool Equals(object obj) { var respondent = obj as Respondent; if (respondent != null) { return(RespondentID.ToString().Equals(respondent.RespondentID.ToString(), StringComparison.Ordinal) && FirstName.Equals(respondent.FirstName) && LastName.Equals(respondent.LastName) && EmailAddress.Equals(respondent.EmailAddress) && AddressLine1.Equals(respondent.AddressLine1) && AddressLine2.Equals(respondent.AddressLine2) && City.Equals(respondent.City) && StateAbbr.Equals(respondent.StateAbbr) && ZipCode.Equals(respondent.ZipCode) && LastSurvey.Equals(respondent.LastSurvey)); } return(false); }
public override int GetHashCode() { int hash = 1; if (AddressLine1.Length != 0) { hash ^= AddressLine1.GetHashCode(); } if (AddressLine2.Length != 0) { hash ^= AddressLine2.GetHashCode(); } if (AddressLine3.Length != 0) { hash ^= AddressLine3.GetHashCode(); } if (City.Length != 0) { hash ^= City.GetHashCode(); } if (State.Length != 0) { hash ^= State.GetHashCode(); } if (ZipCode.Length != 0) { hash ^= ZipCode.GetHashCode(); } if (CountryCode.Length != 0) { hash ^= CountryCode.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
/// <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) )); }
public void Update() { string strsql = "update Branch set " + "CompanyId= " + CompanyId + ", " + "BranchName= '" + BranchName.Replace("'", "''") + "', " + "AddressLine1= '" + AddressLine1.Replace("'", "''") + "', " + "AddressLine2= '" + AddressLine2.Replace("'", "''") + "', " + "CityId= " + CityId + ", " + "Pincode= '" + Pincode.Replace("'", "''") + "', " + "StateId= " + StateId + ", " + "CountryId= " + CountryId + ", " + "PhoneNumber1= '" + PhoneNumber1.Replace("'", "''") + "', " + "PhoneNumber2= '" + PhoneNumber2.Replace("'", "''") + "', " + "EmailId1= '" + EmailId1.Replace("'", "''") + "', " + "EmailId2= '" + EmailId2.Replace("'", "''") + "' " + " where ID =" + Id; SqlConnection ObjConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["MyJobPortal"].ConnectionString); ObjConnection.Open(); SqlCommand ObjCommand = new SqlCommand(strsql, ObjConnection); ObjCommand.ExecuteNonQuery(); ObjConnection.Dispose(); ObjCommand.Dispose(); }
public override int GetHashCode() { int hashCode = -1623438759; if (AddressLine1 != null) { hashCode += AddressLine1.GetHashCode(); } if (AddressLine2 != null) { hashCode += AddressLine2.GetHashCode(); } if (AddressLine3 != null) { hashCode += AddressLine3.GetHashCode(); } if (Locality != null) { hashCode += Locality.GetHashCode(); } if (Sublocality != null) { hashCode += Sublocality.GetHashCode(); } if (Sublocality2 != null) { hashCode += Sublocality2.GetHashCode(); } if (Sublocality3 != null) { hashCode += Sublocality3.GetHashCode(); } if (AdministrativeDistrictLevel1 != null) { hashCode += AdministrativeDistrictLevel1.GetHashCode(); } if (AdministrativeDistrictLevel2 != null) { hashCode += AdministrativeDistrictLevel2.GetHashCode(); } if (AdministrativeDistrictLevel3 != null) { hashCode += AdministrativeDistrictLevel3.GetHashCode(); } if (PostalCode != null) { hashCode += PostalCode.GetHashCode(); } if (Country != null) { hashCode += Country.GetHashCode(); } if (FirstName != null) { hashCode += FirstName.GetHashCode(); } if (LastName != null) { hashCode += LastName.GetHashCode(); } if (Organization != null) { hashCode += Organization.GetHashCode(); } return(hashCode); }
public string GenerateUpdateJsonFromObject(Household 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(@"household"); writer.WriteStartObject(); if (!HouseholdName.Equals(updateFrom.HouseholdName)) { writer.WritePropertyName("name"); writer.WriteValue(updateFrom.HouseholdName); } if (!IntakeDate.Equals(updateFrom.IntakeDate)) { writer.WritePropertyName("intake_date"); writer.WriteValue(updateFrom.IntakeDate.ToString("yyyy-MM-dd")); } if (!AddressLine1.Equals(updateFrom.AddressLine1)) { writer.WritePropertyName("address_line_1"); writer.WriteValue(updateFrom.AddressLine1); } if (!AddressLine2.Equals(updateFrom.AddressLine2)) { writer.WritePropertyName("address_line_2"); writer.WriteValue(updateFrom.AddressLine2); } if (!PostalCode.Equals(updateFrom.PostalCode)) { writer.WritePropertyName("postal_code"); writer.WriteValue(updateFrom.PostalCode); } if (!DependentLocality.Equals(updateFrom.DependentLocality)) { writer.WritePropertyName("dependent_locality"); writer.WriteValue(updateFrom.DependentLocality); } if (!Locality.Equals(updateFrom.Locality)) { writer.WritePropertyName("locality"); writer.WriteValue(updateFrom.Locality); } if (!AdminvArea.Equals(updateFrom.AdminvArea)) { writer.WritePropertyName("adminv_area"); writer.WriteValue(updateFrom.AdminvArea); } if (!DependentAdminvArea.Equals(updateFrom.DependentAdminvArea)) { writer.WritePropertyName("dependent_adminv_area"); writer.WriteValue(updateFrom.DependentAdminvArea); } if (!Country.Equals(updateFrom.Country)) { writer.WritePropertyName("country"); writer.WriteValue(updateFrom.Country); } if (!AddressInfo.Equals(updateFrom.AddressInfo)) { writer.WritePropertyName("address_info"); writer.WriteValue(updateFrom.AddressInfo); } if (!GpsLatitude.Equals(updateFrom.GpsLatitude)) { writer.WritePropertyName("latitude"); writer.WriteValue(updateFrom.GpsLatitude ?? null); } if (!GpsLongitude.Equals(updateFrom.GpsLongitude)) { writer.WritePropertyName("longitude"); writer.WriteValue(updateFrom.GpsLongitude ?? null); } if (!GpsPositionAccuracy.Equals(updateFrom.GpsPositionAccuracy)) { writer.WritePropertyName("position_accuracy"); writer.WriteValue(updateFrom.GpsPositionAccuracy ?? null); } if (!GpsAltitude.Equals(updateFrom.GpsAltitude)) { writer.WritePropertyName("altitude"); writer.WriteValue(updateFrom.GpsAltitude ?? null); } if (!GpsAltitudeAccuracy.Equals(updateFrom.GpsAltitudeAccuracy)) { writer.WritePropertyName("altitude_accuracy"); writer.WriteValue(updateFrom.GpsAltitudeAccuracy ?? null); } if (!GpsHeading.Equals(updateFrom.GpsHeading)) { writer.WritePropertyName("heading"); writer.WriteValue(updateFrom.GpsHeading ?? null); } if (!GpsSpeed.Equals(updateFrom.GpsSpeed)) { writer.WritePropertyName("speed"); writer.WriteValue(updateFrom.GpsSpeed ?? null); } if (!GpsPositionTime.Equals(updateFrom.GpsPositionTime)) { writer.WritePropertyName("gps_recorded_at"); writer.WriteValue(updateFrom.GpsPositionTime ?? null); } writer.WriteEndObject(); writer.WriteEndObject(); return(sw.ToString()); }
public override string ToString() { return(AddressLine1?.ToString()); }
public bool GetObjectNeedsUpate(Household checkUpdateFrom) { if (!HouseholdName.Equals(checkUpdateFrom.HouseholdName)) { return(true); } if (!IntakeDate.Equals(checkUpdateFrom.IntakeDate)) { return(true); } if (!AddressLine1.Equals(checkUpdateFrom.AddressLine1)) { return(true); } if (!AddressLine2.Equals(checkUpdateFrom.AddressLine2)) { return(true); } if (!PostalCode.Equals(checkUpdateFrom.PostalCode)) { return(true); } if (!DependentLocality.Equals(checkUpdateFrom.DependentLocality)) { return(true); } if (!Locality.Equals(checkUpdateFrom.Locality)) { return(true); } if (!AdminvArea.Equals(checkUpdateFrom.AdminvArea)) { return(true); } if (!DependentAdminvArea.Equals(checkUpdateFrom.DependentAdminvArea)) { return(true); } if (!Country.Equals(checkUpdateFrom.Country)) { return(true); } if (!AddressInfo.Equals(checkUpdateFrom.AddressInfo)) { 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); } return(false); }
/// <summary> /// Get the GEDCOM 5.5 lines for the data in this object. /// Lines start at the given level /// </summary> /// <param name="sw"> /// A <see cref="TextWriter"/> /// </param> /// <param name="level"> /// A <see cref="int"/> /// </param> public void Output(TextWriter sw, int level) { sw.Write(Environment.NewLine); sw.Write(Util.IntToString(level)); sw.Write(" ADDR"); if (!string.IsNullOrEmpty(AddressLine)) { sw.Write(" "); Util.SplitLineText(sw, AddressLine, level, 60, 3, true); } string levelStr = null; string levelPlusOne = null; if (!string.IsNullOrEmpty(AddressLine1)) { if (levelPlusOne == null) { levelPlusOne = Util.IntToString(level + 1); } string line = AddressLine1.Replace("@", "@@"); sw.Write(Environment.NewLine); sw.Write(levelPlusOne); sw.Write(" ADR1 "); if (line.Length <= 60) { sw.Write(AddressLine1); } else { sw.Write(line.Substring(0, 60)); System.Diagnostics.Debug.WriteLine("Truncating AddressLine1"); } } if (!string.IsNullOrEmpty(AddressLine2)) { if (levelPlusOne == null) { levelPlusOne = Util.IntToString(level + 1); } string line = AddressLine2.Replace("@", "@@"); sw.Write(Environment.NewLine); sw.Write(levelPlusOne); sw.Write(" ADR2 "); if (line.Length <= 60) { sw.Write(line); } else { sw.Write(line.Substring(0, 60)); System.Diagnostics.Debug.WriteLine("Truncating AddressLine2"); } } if (!string.IsNullOrEmpty(AddressLine3)) { if (levelPlusOne == null) { levelPlusOne = Util.IntToString(level + 1); } string line = AddressLine3.Replace("@", "@@"); sw.Write(Environment.NewLine); sw.Write(levelPlusOne); sw.Write(" ADR3 "); if (line.Length <= 60) { sw.Write(line); } else { sw.Write(line.Substring(0, 60)); System.Diagnostics.Debug.WriteLine("Truncating AddressLine3"); } } if (!string.IsNullOrEmpty(City)) { if (levelPlusOne == null) { levelPlusOne = Util.IntToString(level + 1); } string line = City.Replace("@", "@@"); sw.Write(Environment.NewLine); sw.Write(levelPlusOne); sw.Write(" CITY "); if (line.Length <= 60) { sw.Write(line); } else { sw.Write(line.Substring(0, 60)); System.Diagnostics.Debug.WriteLine("Truncating City"); } } if (!string.IsNullOrEmpty(State)) { if (levelPlusOne == null) { levelPlusOne = Util.IntToString(level + 1); } string line = State.Replace("@", "@@"); sw.Write(Environment.NewLine); sw.Write(levelPlusOne); sw.Write(" STAE "); if (line.Length <= 60) { sw.Write(line); } else { sw.Write(line.Substring(0, 60)); System.Diagnostics.Debug.WriteLine("Truncating State"); } } if (!string.IsNullOrEmpty(PostCode)) { if (levelPlusOne == null) { levelPlusOne = Util.IntToString(level + 1); } string line = PostCode.Replace("@", "@@"); sw.Write(Environment.NewLine); sw.Write(levelPlusOne); sw.Write(" POST "); if (line.Length <= 10) { sw.Write(line); } else { sw.Write(line.Substring(0, 10)); System.Diagnostics.Debug.WriteLine("Truncating PostCode"); } } if (!string.IsNullOrEmpty(Country)) { if (levelPlusOne == null) { levelPlusOne = Util.IntToString(level + 1); } string line = Country.Replace("@", "@@"); sw.Write(Environment.NewLine); sw.Write(levelPlusOne); sw.Write(" CTRY "); if (line.Length <= 60) { sw.Write(line); } else { sw.Write(line.Substring(0, 60)); System.Diagnostics.Debug.WriteLine("Truncating Country"); } } if (!string.IsNullOrEmpty(Phone1)) { if (levelStr == null) { levelStr = Util.IntToString(level); } string line = Phone1.Replace("@", "@@"); sw.Write(Environment.NewLine); sw.Write(levelStr); sw.Write(" PHON "); if (line.Length <= 25) { sw.Write(line); } else { sw.Write(line.Substring(0, 25)); System.Diagnostics.Debug.WriteLine("Truncating Phone1"); } } if (!string.IsNullOrEmpty(Phone2)) { if (levelStr == null) { levelStr = Util.IntToString(level); } string line = Phone2.Replace("@", "@@"); sw.Write(Environment.NewLine); sw.Write(levelStr); sw.Write(" PHON "); if (line.Length <= 25) { sw.Write(line); } else { sw.Write(line.Substring(0, 25)); System.Diagnostics.Debug.WriteLine("Truncating Phone2"); } } if (!string.IsNullOrEmpty(Phone3)) { if (levelStr == null) { levelStr = Util.IntToString(level); } string line = Phone3.Replace("@", "@@"); sw.Write(Environment.NewLine); sw.Write(levelStr); sw.Write(" PHON "); if (line.Length <= 25) { sw.Write(line); } else { sw.Write(line.Substring(0, 25)); System.Diagnostics.Debug.WriteLine("Truncating Phone3"); } } if (!string.IsNullOrEmpty(Fax1)) { if (levelStr == null) { levelStr = Util.IntToString(level); } string line = Fax1.Replace("@", "@@"); sw.Write(Environment.NewLine); sw.Write(levelStr); sw.Write(" FAX "); if (line.Length <= 60) { sw.Write(line); } else { sw.Write(line.Substring(0, 60)); System.Diagnostics.Debug.WriteLine("Truncating Fax1"); } } if (!string.IsNullOrEmpty(Fax2)) { if (levelStr == null) { levelStr = Util.IntToString(level); } string line = Fax2.Replace("@", "@@"); sw.Write(Environment.NewLine); sw.Write(levelStr); sw.Write(" FAX "); if (line.Length <= 60) { sw.Write(line); } else { sw.Write(line.Substring(0, 60)); System.Diagnostics.Debug.WriteLine("Truncating Fax2"); } } if (!string.IsNullOrEmpty(Fax3)) { if (levelStr == null) { levelStr = Util.IntToString(level); } string line = Fax3.Replace("@", "@@"); sw.Write(Environment.NewLine); sw.Write(levelStr); sw.Write(" FAX "); if (line.Length <= 60) { sw.Write(line); } else { sw.Write(line.Substring(0, 60)); System.Diagnostics.Debug.WriteLine("Truncating Fax3"); } } if (!string.IsNullOrEmpty(Email1)) { if (levelStr == null) { levelStr = Util.IntToString(level); } string line = Email1.Replace("@", "@@"); sw.Write(Environment.NewLine); sw.Write(levelStr); sw.Write(" EMAIL "); if (line.Length <= 120) { sw.Write(line); } else { sw.Write(line.Substring(0, 120)); System.Diagnostics.Debug.WriteLine("Truncating Email1"); } } if (!string.IsNullOrEmpty(Email2)) { if (levelStr == null) { levelStr = Util.IntToString(level); } string line = Email2.Replace("@", "@@"); sw.Write(Environment.NewLine); sw.Write(levelStr); sw.Write(" EMAIL "); if (line.Length <= 120) { sw.Write(line); } else { sw.Write(line.Substring(0, 120)); System.Diagnostics.Debug.WriteLine("Truncating Email2"); } } if (!string.IsNullOrEmpty(Email3)) { if (levelStr == null) { levelStr = Util.IntToString(level); } string line = Email3.Replace("@", "@@"); sw.Write(Environment.NewLine); sw.Write(levelStr); sw.Write(" EMAIL "); if (line.Length <= 120) { sw.Write(line); } else { sw.Write(line.Substring(0, 120)); System.Diagnostics.Debug.WriteLine("Truncating Email3"); } } if (!string.IsNullOrEmpty(Www1)) { if (levelStr == null) { levelStr = Util.IntToString(level); } string line = Www1.Replace("@", "@@"); sw.Write(Environment.NewLine); sw.Write(levelStr); sw.Write(" WWW "); if (line.Length <= 120) { sw.Write(line); } else { sw.Write(line.Substring(0, 120)); System.Diagnostics.Debug.WriteLine("Truncating Www1"); } } if (!string.IsNullOrEmpty(Www2)) { if (levelStr == null) { levelStr = Util.IntToString(level); } string line = Www2.Replace("@", "@@"); sw.Write(Environment.NewLine); sw.Write(levelStr); sw.Write(" WWW "); if (line.Length <= 120) { sw.Write(line); } else { sw.Write(line.Substring(0, 120)); System.Diagnostics.Debug.WriteLine("Truncating Www2"); } } if (!string.IsNullOrEmpty(Www3)) { if (levelStr == null) { levelStr = Util.IntToString(level); } string line = Www3.Replace("@", "@@"); sw.Write(Environment.NewLine); sw.Write(levelStr); sw.Write(" WWW "); if (line.Length <= 120) { sw.Write(line); } else { sw.Write(line.Substring(0, 120)); System.Diagnostics.Debug.WriteLine("Truncating Www3"); } } }