public static bool hasCorrectPostalNumberType(DataRow dataRow, Address parsedAddress) { const string EVEN = "NJ"; const string ODD = "NU"; var type = Convert.ToString(dataRow[POSTAL_CODE_PLACEMENT_TYPE]); if (!(type == EVEN || type == ODD)) return true; return (parsedAddress.isEvenStreetNumber() ^ type == ODD); }
private int InsertNewPostalCodeModelRow(Address addr) { _logger.PostInfo(string.Format("Creating new postal code {0} {1} {2}",addr.StreetName,addr.City,addr.PostalNumber)); return InsertWithKeyReturn(SqlStrings.InsertIntoPostalCodeModels(addr.PostalNumber, "AT", addr.StreetName, 1, addr.StreetNumber, addr.City, addr.isEvenStreetNumber() ? "NJ" : "NU")); }
private DataTable fetchAddressEntriesForPostalCodeAndStreetNumber(int postalCodeModelId, Address parsedAddress) { return _dataAccess.SelectIntoTable(string.Format( "SELECT Id FROM " + _dbCurrentDb + ".dbo.PostalAddressModels WHERE PostalCodeModelId = '{0}' AND StreetNo = '{1}'", postalCodeModelId, parsedAddress.StreetNumberFull)); }
public PostalCodeArea(Address addr, int id) { Id = id; PostalCode = addr.PostalNumber; }