Exemplo n.º 1
0
        private void ExcluirProduto()
        {
            ProdutoBLL bll = new ProdutoBLL();

            bll.Delete(Convert.ToInt32(grvListaProdutos.CurrentRow.Cells[1].Value));
            CarregaListaProdutos();
        }
Exemplo n.º 2
0
        // Exclui um produto
        private void btnExcluir_Click(object sender, EventArgs e)
        {
            try
            {
                Produto produto = new Produto();
                produto.ID = int.Parse(txtID.Text);

                Response response = produtoBLL.Delete(produto);
                MessageBox.Show(response.Message);
                if (response.Success)
                {
                    UpdateGridView();
                    FerramentasTextBox.LimpaTextBoxes(this);
                }
            }
            catch (FormatException)
            {
                MessageBox.Show("Existem valores inválidos!");
            }
        }
Exemplo n.º 3
0
 protected void DeleteRow(object sender, GridViewDeleteEventArgs e)
 {
     produtoDTO.Id = Convert.ToInt32(e.Values[0]);
     produtoBLL.Delete(produtoDTO);
     Exibir();
 }
 public int Delete(int id)
 {
     return(ProdutoBLL.Delete(id));
 }