示例#1
0
        private async void BtExcluir_Clicked(object sender, EventArgs e)
        {
            var resp = await DisplayAlert("Excluir Registro?",
                                          "Deseja excluir a nota atual ?", "Sim", "Não");

            if (resp == true)
            {
                ServicesDBNotas dbNotas = new ServicesDBNotas(App.dbPath);
                int             id      = Convert.ToInt32(txtCodigo.Text);
                dbNotas.Excluir(id);
                DisplayAlert("Resultado da operação: ", dbNotas.StatusMessage, "Ok");
                MasterDetailPage p = (MasterDetailPage)Application.Current.MainPage;
                p.Detail = new PageHome();
            }
        }
示例#2
0
        private async void Button_pagecadastrar_excluir_Clicked(object sender, EventArgs e)
        {
            var resp = await DisplayAlert("Excluir Registro", "Deseja realmente excluir a nota ?", "Sim", "Não");

            if (resp)
            {
                ServicesDBNotas dbNotas = new ServicesDBNotas(App.DbPath);
                int             id      = Convert.ToInt32(entry_pagecadastrar_codigo.Text);
                dbNotas.Excluir(id);
                DisplayAlert("Resultado da Operação", dbNotas.StatusMessage, "OK");

                MasterDetailPage p = (MasterDetailPage)Application.Current.MainPage;
                p.Detail = new NavigationPage(new PageHome());
            }
        }