public async Task ResetPassword(string password)
        {
            await Task.Run(async() =>
            {
                try
                {
                    var responseApi = await UserService.PostResetPassword(info.userId, password, info.token);

                    Device.BeginInvokeOnMainThread(async() =>
                    {
                        Loading(false);
                        if (responseApi != null)
                        {
                            if (responseApi["codigo"].ToString() == "1")
                            {
                                App.GoToLogin();
                            }
                            else
                            {
                                await DisplayAlert("Recuperar Contraseña", responseApi["mensaje"].ToString(), "Aceptar");
                            }
                        }
                        else
                        {
                            Loading(false);
                            await DisplayAlert("Usuario", "Ha ocurrido un error", "Aceptar");
                        }
                    });
                }
                catch (Exception e)
                {
                    Loading(false);
                    await DisplayAlert("Usuario", "Ha ocurrido un error " + e.Message, "Aceptar");
                }
            });
        }
예제 #2
0
 void LogOut_Clicked(object sender, System.EventArgs e)
 {
     //await DisplayAlert("Alerta!", "vas a cerrar sesion", "Aceptar");
     GeneralSetting.UserSettings = null;
     App.GoToLogin();
 }