public static void Log(string address, double latitude, double longitude, IGeocoder provider, string error) { var db = new TerritoryDBDataContext(); GeocodingLog newEntry = new GeocodingLog(); newEntry.AccountId = CurrentUser.CurrentAccount.AccountId; newEntry.Lat = latitude; newEntry.Address= address; newEntry.Long = longitude; newEntry.Provider = provider.GetType().Name; newEntry.RequestDateTime = DateTime.Now; db.GeocodingLogs.InsertOnSubmit(newEntry); db.SubmitChanges(); }
public int GetBurnForLast24Hour(DateTime when, IGeocoder provider) { var db = new TerritoryDBDataContext(); DateTime minDate = when.AddDays(-1); DateTime maxDate = when; string providerString = provider.GetType().Name; var count = (from h in db.GeocodingLogs where h.RequestDateTime >= minDate && h.RequestDateTime <= when && h.Provider == providerString select h).Count(); return count; }
public OverQueryLimitException(IGeocoder p) { Provider = p.GetType().ToString(); }
public ServiceOfflineException(IGeocoder p, Exception ex) : base("ServiceOffline", ex) { provider = p.GetType().Name; ; }
public UnknownAddressException(string message, IGeocoder geocoder) : base(message) { provider = geocoder.GetType().Name; }