public void Operator_Unequal_DoesExpected() { var outward = "DN33"; var inward = "3DE"; var full = "DN33 3DF"; var lhs = new PostCode(outward, inward); var rhs = new PostCode(full); Assert.That(lhs, Is.Not.EqualTo(rhs)); Assert.That(lhs.Equals(rhs), Is.False); Assert.That(lhs != rhs); }
private bool Valid() { ValidateLocations(); if (Naam == null || Naam.Equals("")) { MessageBox.Show("Vul een naam in"); return(false); } else if (SelectedGebruiker == null) { MessageBox.Show("Vul een inspecteur in"); return(false); } else if (SelectedKlant == null) { MessageBox.Show("Vul een evenement in"); return(false); } else if (SelectedOfferte == null) { MessageBox.Show("Vul een offerte in"); return(false); } else if (PostCode == null || PostCode.Equals("")) { MessageBox.Show("Vul een postcode in"); return(false); } else if (Datum == null) { MessageBox.Show("Vul een datum in"); return(false); } else if (huisnummer == 0 || huisnummer.Equals("")) { MessageBox.Show("Vul een huisnummer in"); return(false); } else if (SelectedStatus == null) { MessageBox.Show("Vul een status in"); return(false); } return(true); }
public override bool Equals(object obj) { if (obj is UserPrivacyInfo) { var upi = (UserPrivacyInfo)obj; return (LastName.Equals(upi.LastName) && DateOfBirth.Equals(upi.DateOfBirth) && HouseAddress.Equals(upi.HouseAddress) && HouseNumber.Equals(upi.HouseNumber) && PostCode.Equals(upi.PostCode) && City.Equals(upi.City) && Country.Equals(upi.Country) && PhoneNumber.Equals(upi.PhoneNumber)); } return(false); }
/// <summary> /// Returns true if SharedAutomatedTellerMachinesPostalAddress instances are equal /// </summary> /// <param name="other">Instance of SharedAutomatedTellerMachinesPostalAddress to be compared</param> /// <returns>Boolean</returns> public bool Equals(SharedAutomatedTellerMachinesPostalAddress other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Address == other.Address || Address != null && Address.Equals(other.Address) ) && ( AdditionalInfo == other.AdditionalInfo || AdditionalInfo != null && AdditionalInfo.Equals(other.AdditionalInfo) ) && ( DistrictName == other.DistrictName || DistrictName != null && DistrictName.Equals(other.DistrictName) ) && ( TownName == other.TownName || TownName != null && TownName.Equals(other.TownName) ) && ( IbgeCode == other.IbgeCode || IbgeCode != null && IbgeCode.Equals(other.IbgeCode) ) && ( CountrySubDivision == other.CountrySubDivision || CountrySubDivision != null && CountrySubDivision.Equals(other.CountrySubDivision) ) && ( PostCode == other.PostCode || PostCode != null && PostCode.Equals(other.PostCode) ) && ( Country == other.Country || Country != null && Country.Equals(other.Country) ) && ( CountryCode == other.CountryCode || CountryCode != null && CountryCode.Equals(other.CountryCode) ) && ( GeographicCoordinates == other.GeographicCoordinates || GeographicCoordinates != null && GeographicCoordinates.Equals(other.GeographicCoordinates) )); }
private bool Valid() { LocationEntryVM locTo; LocationEntryVM locFrom; try { locTo = apiConnector.getAdresLocation(this.PostCode + ", " + this.huisnummer); locFrom = apiConnector.getAdresLocation(SelectedGebruiker.Postcode + ", " + SelectedGebruiker.Huisnummer); return(true); } catch (Exception e) { MessageBox.Show("Postcode en huisnummer combinatie is incorrect!"); return(false); } if (Naam == null || Naam.Equals("")) { MessageBox.Show("Vul een naam in"); return(false); } else if (SelectedGebruiker == null) { MessageBox.Show("Vul een inspecteur in"); return(false); } else if (SelectedKlant == null) { MessageBox.Show("Vul een evenement in"); return(false); } else if (SelectedOfferte == null) { MessageBox.Show("Vul een offerte in"); return(false); } else if (PostCode == null || PostCode.Equals("")) { MessageBox.Show("Vul een postcode in"); return(false); } else if (Datum == null) { MessageBox.Show("Vul een datum in"); return(false); } else if (huisnummer == 0 || huisnummer.Equals("")) { MessageBox.Show("Vul een huisnummer in"); return(false); } else if (SelectedStatus == null) { MessageBox.Show("Vul een status in"); return(false); } return(true); }
// sort the list based on the refines from the page choices public List <ListObjectSorted> SortList(List <ListObject> listIn) { List <ListObjectSorted> listOut = new List <ListObjectSorted>(); List <ListObjectSorted> temp = new List <ListObjectSorted>(); // change listin to listout foreach (var r in listIn) { ListObjectSorted newObj = new ListObjectSorted(); newObj.Address = r.Address; newObj.Description = r.Description.ToString(); // char to string if (newObj.Description.Equals("N")) // expand out string { newObj.Description = "New"; } else { newObj.Description = "Second Hand"; } newObj.NotFullMP = r.NotFullMP.ToString(); // char to string if (newObj.NotFullMP.Equals("N")) // expand out string { newObj.NotFullMP = "No"; } else { newObj.NotFullMP = "Yes"; } newObj.PostCode = r.PostCode; newObj.Price = r.Price; newObj.SoldOn = r.SoldOn; listOut.Add(newObj); } // if new property dwelling if (Dwelling.Equals("New Property")) { foreach (var r in listOut) { if (r.Description.Equals("New")) { temp.Add(r); } } listOut.Clear(); listOut.AddRange(temp); temp.Clear(); } // if second hand property dwelling if (Dwelling.Equals("Second Hand Property")) { foreach (var r in listOut) { if (r.Description.Equals("Second Hand")) { temp.Add(r); } } listOut.Clear(); listOut.AddRange(temp); temp.Clear(); } // if market price yes if (MarketPrice.Equals("Yes")) { foreach (var r in listOut) { if (r.NotFullMP.Equals("Yes")) { temp.Add(r); } } listOut.Clear(); listOut.AddRange(temp); temp.Clear(); } // if market price no if (MarketPrice.Equals("No")) { foreach (var r in listOut) { if (r.NotFullMP.Equals("No")) { temp.Add(r); } } listOut.Clear(); listOut.AddRange(temp); temp.Clear(); } // if county is dublin sort by postal code if (County.Equals("Dublin")) { if (!PostCode.Equals("All")) { string pc = ""; if (PostCode.Equals("county dublin")) { pc = PostCode; foreach (var r in listOut) { if (r.PostCode.Equals(pc)) { temp.Add(r); } } } else { pc = "dublin " + PostCode; foreach (var r in listOut) { if (r.PostCode.Equals(pc)) { temp.Add(r); } } } listOut.Clear(); listOut.AddRange(temp); temp.Clear(); } } // take out any with price greater than max price foreach (var r in listOut) { if (r.Price <= PriceValue) { temp.Add(r); } } listOut.Clear(); listOut.AddRange(temp); temp.Clear(); // return list return(listOut); }
/// <summary> /// Returns true if MediumCharacteristic instances are equal /// </summary> /// <param name="other">Instance of MediumCharacteristic to be compared</param> /// <returns>Boolean</returns> public bool Equals(MediumCharacteristic other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( City == other.City || City != null && City.Equals(other.City) ) && ( Country == other.Country || Country != null && Country.Equals(other.Country) ) && ( EmailAddress == other.EmailAddress || EmailAddress != null && EmailAddress.Equals(other.EmailAddress) ) && ( FaxNumber == other.FaxNumber || FaxNumber != null && FaxNumber.Equals(other.FaxNumber) ) && ( PhoneNumber == other.PhoneNumber || PhoneNumber != null && PhoneNumber.Equals(other.PhoneNumber) ) && ( PostCode == other.PostCode || PostCode != null && PostCode.Equals(other.PostCode) ) && ( StateOrProvince == other.StateOrProvince || StateOrProvince != null && StateOrProvince.Equals(other.StateOrProvince) ) && ( Street1 == other.Street1 || Street1 != null && Street1.Equals(other.Street1) ) && ( Street2 == other.Street2 || Street2 != null && Street2.Equals(other.Street2) ) && ( MediumCharacteristicType == other.MediumCharacteristicType || MediumCharacteristicType != null && MediumCharacteristicType.Equals(other.MediumCharacteristicType) )); }