public Location Geocode( Location location ) { var user = CurrentUser(); if ( user != null ) { if ( location != null ) { var locationService = new LocationService(); locationService.Geocode( location, user.PersonId ); return location; } throw new HttpResponseException( HttpStatusCode.BadRequest ); } throw new HttpResponseException( HttpStatusCode.Unauthorized ); }
void rptrAddresses_ItemCommand( object source, RepeaterCommandEventArgs e ) { int locationId = int.MinValue; if ( int.TryParse( e.CommandArgument.ToString(), out locationId ) ) { var service = new LocationService(); var location = service.Get( locationId ); switch ( e.CommandName ) { case "geocode": service.Geocode( location, CurrentPersonId ); break; case "standardize": service.Standardize( location, CurrentPersonId ); break; } service.Save( location, CurrentPersonId ); } BindFamilies(); }