Exemplo n.º 1
0
 private VendorTestResult(TestItem testItem, Vendor vendor)
     : base()
 {
     this.Vendor = vendor;
     this.TestItem = testItem;
     this.Latitude = GeoMapUtil.LatLngNullValue;
     this.Longitude = GeoMapUtil.LatLngNullValue;
 }
Exemplo n.º 2
0
 public VendorTestResult(GeoCoding.PlaceBase place, TestItem testItem, Vendor vendor)
 {
     Longitude = place.Coordinates.Longitude;
     Latitude = place.Coordinates.Latitude;
     TestItem = testItem;
     //TestItemId = testItem.Id;
     // avoiding a dup here..
        // Vendor = Models.Vendor.GetByName(vendor.Name);
     VendorId = vendor.Id;
 }
Exemplo n.º 3
0
        public VendorTestResult GetResultFromCache(string address, Vendor vendor)
        {
            VendorTestResult cachedResult = null;

            using (var dbContext = new ResultModelContainer())
            {
                cachedResult = dbContext.VendorTestResults.Include("TestItem").Include("Vendor")
                        .Where(e => e.Vendor.Id == vendor.Id && e.TestItem.Address.Equals(address))
                        .FirstOrDefault();
            }

            if (cachedResult != null)
            {
                log.InfoFormat("Found cached value for {0} from vendor {1} in recordId:{2}", address, vendor.Name, cachedResult.Id);
            }
            return cachedResult;
        }
Exemplo n.º 4
0
 public static GeoCoding.GeoCoderBase GetGeoCoder(Vendor vendor)
 {
     switch (vendor.Name)
     {
         case "Google":
             return new GeoCoding.GeoCoderGoogle();
         //SearchGoogle(TestItem.Address);
         //break;
         case "OpenStreetMaps":
             return new GeoCoding.GeoCoderOSM();
         //SearchOSM(TestItem.Address);
         //break;
         case "OSMNoZip":
             return new GeoCoding.GeoCoderOSMNoZip();
         //SearchOSM(GeoMapUtil.StripTrailingPostalCode(TestItem.Address));
         //break;
         case "MapQuest":
             return new GeoCoding.GeoCoderMapQuest();
         //SearchMapQuest(TestItem.Address);
         //break;
         default:
             throw new ArgumentOutOfRangeException("Invalid search vendor.");
     }
 }