예제 #1
0
        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);
        }
예제 #2
0
 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"));
 }
예제 #3
0
 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));
 }
예제 #4
0
 public PostalCodeArea(Address addr, int id)
 {
     Id = id;
     PostalCode = addr.PostalNumber;
 }