コード例 #1
0
        private async void Task_LocationComplete(object sender, LocationComplete e)
        {
            if (e.Success)
            {
                if (App.Oauth != null)
                {
                    if (CrossConnectivity.Current.IsConnected)
                    {
                        // position as string
                        var position = e.Position.ToString();
                        // Update direction
                        var result = await App.RestClient.Post <UpdateResult>($"{App.BaseUrl}/User/UpdateGPS/{App.Oauth.IdUsuario}", new Dictionary <string, object>
                        {
                            { "GPS", position },
                            { "Local", "1" },
                            { "SearchText", e.SearchText }
                        });

                        if (result != null)
                        {
                            if (result.UpdateStatus)
                            {
                                await DisplayAlert(App.AppName, "¡¡Ahora tus clientes, saben donde te ubicas!!", "Aceptar");
                            }
                            else
                            {
                                await DisplayAlert(App.AppName, "Intenta más tarde... Código de error: HX00-0F00", "Aceptar");
                            }
                        }
                        else
                        {
                            await DisplayAlert(App.AppName, "Intenta más tarde... Código de error: HX00-0F01", "Aceptar");
                        }
                    }
                    else
                    {
                        await DisplayAlert(App.AppName, "Necesitas una conexión a internet", "Aceptar");
                    }
                }
                else
                {
                    await DisplayAlert(App.AppName, "Intenta más tarde... Código de error: HX00-0F02", "Aceptar");
                }
            }
            else
            {
                await DisplayAlert(App.AppName, "No se ingreso la dirección del local", "Aceptar");
            }
        }
コード例 #2
0
 private void OnLocationComplete(LocationComplete args)
 {
     LocationComplete?.Invoke(this, args);
 }