Esempio n. 1
0
        public List <PAFAddress> GetAddress(string buildingName, string buildingNumber, string postcode)
        {
            List <PAFAddress> addressList = null;
            var locality = _localityService.GetLocality(postcode, false);

            if (locality != null)
            {
                var thoroughFare = _thoroughFareService.GeThoroughFare(locality);
                int houseNumber;
                if (!int.TryParse(buildingNumber, out houseNumber))
                {
                    houseNumber = 0;
                }

                var deliveryPoints = _deliveryPointService.GetDeliveryPointsByBuildingNameAndNumber(locality, buildingName,
                                                                                                    houseNumber);

                if (deliveryPoints.Count <= 0)
                {
                    return(null);
                }
                addressList = EvaluateAddress.GetAddressList(locality, thoroughFare, deliveryPoints);
            }

            return(addressList);
        }
Esempio n. 2
0
        public IEnumerable <PAFAddress> GetAddressesByPostcode(string postcode)
        {
            IEnumerable <PAFAddress> addressList = null;
            var locality = _localityService.GetLocality(postcode, false);

            if (locality != null)
            {
                var thoroughFare   = _thoroughFareService.GeThoroughFare(locality);
                var deliveryPoints = _deliveryPointService.GetDeliveryPoints(locality);

                if (deliveryPoints.Count > 0)
                {
                    addressList = EvaluateAddress.GetAddressList(locality, thoroughFare, deliveryPoints);
                }
            }

            return(addressList);
        }