示例#1
0
 //public bool Geocode()
 //{
 //    bool ret = false;
 //    string error = string.Empty;
 //    try
 //    {
 //        int count = 0;
 //        while (Lat == null & Long == null & count < 5)
 //        {
 //            Coordinate coords = MapquestGeocoder.GetCoordinates(FullAddress);
 //            this.Lat = coords.Latitude;
 //            this.Long = coords.Longitude;
 //            UpdateCoordinates(coords);
 //            count++;
 //        }
 //        ret = true;
 //    }
 //    catch (Exception ex)
 //    {
 //        error = ex.Message;
 //    }
 //    return ret;
 //}
 public void UpdateCoordinates(Coordinate coords)
 {
     this.Lat = coords.Latitude;
     this.Long = coords.Longitude;
     if (Lat == 0 & Long == 0)
     {
         Lat = null;
         Long = null;
     }
     var db = new TerritoryDBDataContext();
     if (this.Long != null & this.Lat != null)
     {
         db.sp_UploadedAddress_Update_Coordinates(this._UploadedAddressId, this.Long, this.Lat, string.Empty);
     }
 }