public Location Standardize( Location location )
        {
            var user = CurrentUser();
            if ( user != null )
            {
                if ( location != null )
                {
                    var locationService = new LocationService();
                    locationService.Standardize( location, user.PersonId );
                    return location;
                }

                throw new HttpResponseException( HttpStatusCode.BadRequest );
            }

            throw new HttpResponseException( HttpStatusCode.Unauthorized );
        }
Example #2
0
        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();
        }