예제 #1
0
        private async void BtnUpDate_Clicked(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtId.Text))
            {
                await DisplayAlert("Error", "Id wrong", "Ok");
            }
            else
            {
                try
                {
                    await contatoService
                    .UpdateContatos(Convert.ToInt32(txtId.Text), txtName.Text, txtEmail.Text);

                    txtId.Text    = string.Empty;
                    txtName.Text  = string.Empty;
                    txtEmail.Text = string.Empty;

                    await DisplayAlert("Sucesso", "UpDate", "Ok");

                    await ShowContact();
                }
                catch (Exception ex)
                {
                    await DisplayAlert("Error", "User did not find" + ex.Message, "Ok");
                }
            }
        }