コード例 #1
0
        public PackageTracker(IWebPoster webPoster, IGeocodeDb geocodeDb)
        {
            //Todo: This is a bad place to load these:
            var uspsUserName = WebConfigurationManager.AppSettings["UspsUserName"];
            var uspsPassword = WebConfigurationManager.AppSettings["UspsPassword"];

            var fedexKey = WebConfigurationManager.AppSettings["FedexKey"];
            var fedexPassword = WebConfigurationManager.AppSettings["FedexPassword"];
            var fedexAccountNumber = WebConfigurationManager.AppSettings["FedexAccountNumber"];
            var fedexMeterNumber = WebConfigurationManager.AppSettings["FedexMeterNumber"];

            var coreTrackers = new List<ITracker>();
            coreTrackers.Add(new Tracking.Simulation.SimulationTracker());
            coreTrackers.Add(new UpsTracker());
            coreTrackers.Add(new UspsTracker(new PostUtility(), uspsUserName, uspsPassword, true));
            coreTrackers.Add(new FedexTracker(new TrackService(), fedexKey, fedexPassword, fedexAccountNumber, fedexMeterNumber, false));
            //coreTrackers.Add(new DhlTracker(new PostUtility(), "", "");

            var multiTracker = new MultiTracker(coreTrackers);
            var cacheTracker = new CacheTracker(multiTracker);
            var emptyTracker = new EmptyTrackingNumberTracker(cacheTracker);
            var loggingTracker = new LoggingTracker(emptyTracker);
            var sanitizerTracker = new TrackingNumberStandardizerTracker(loggingTracker);
            var geocodingTracker = new GeocodingTracker(sanitizerTracker, geocodeDb);
            var errorHandlerTracker = new ErrorHandlerTracker(geocodingTracker);

            _defaultTracker = errorHandlerTracker;
        }
コード例 #2
0
        public PackageTracker(IWebPoster webPoster, IGeocodeDb geocodeDb)
        {
            //Todo: This is a bad place to load these:
            var uspsUserName = WebConfigurationManager.AppSettings["UspsUserName"];
            var uspsPassword = WebConfigurationManager.AppSettings["UspsPassword"];

            var fedexKey           = WebConfigurationManager.AppSettings["FedexKey"];
            var fedexPassword      = WebConfigurationManager.AppSettings["FedexPassword"];
            var fedexAccountNumber = WebConfigurationManager.AppSettings["FedexAccountNumber"];
            var fedexMeterNumber   = WebConfigurationManager.AppSettings["FedexMeterNumber"];


            var coreTrackers = new List <ITracker>();

            coreTrackers.Add(new Tracking.Simulation.SimulationTracker());
            coreTrackers.Add(new UpsTracker());
            coreTrackers.Add(new UspsTracker(new PostUtility(), uspsUserName, uspsPassword, true));
            coreTrackers.Add(new FedexTracker(new TrackService(), fedexKey, fedexPassword, fedexAccountNumber, fedexMeterNumber, false));
            //coreTrackers.Add(new DhlTracker(new PostUtility(), "", "");

            var multiTracker        = new MultiTracker(coreTrackers);
            var cacheTracker        = new CacheTracker(multiTracker);
            var emptyTracker        = new EmptyTrackingNumberTracker(cacheTracker);
            var loggingTracker      = new LoggingTracker(emptyTracker);
            var sanitizerTracker    = new TrackingNumberStandardizerTracker(loggingTracker);
            var geocodingTracker    = new GeocodingTracker(sanitizerTracker, geocodeDb);
            var errorHandlerTracker = new ErrorHandlerTracker(geocodingTracker);

            _defaultTracker = errorHandlerTracker;
        }
コード例 #3
0
 public GeocodingTracker(ITracker baseTracker, IGeocodeDb geocoder)
 {
     _baseTracker = baseTracker;
     _geocoder = geocoder;
 }
コード例 #4
0
 public GeocodingTracker(ITracker baseTracker, IGeocodeDb geocoder)
 {
     _baseTracker = baseTracker;
     _geocoder    = geocoder;
 }