private void btnDeletar_Click(object sender, EventArgs e) { ProdutosBLL produtosBLL = new ProdutosBLL(); ProdutosDTO produtosDTO = new ProdutosDTO(); produtosDTO.PROD_ID = int.Parse(txtNomeProduto.Text); produtosBLL.Excluir(produtosDTO); MessageBox.Show("Peça exclúida com sucesso!", "Atenção", MessageBoxButtons.OK, MessageBoxIcon.Information); txtNomeProduto.Text = ""; txtCategoria.Text = ""; txtdescricaoproduto.Text = ""; txtprecoCusto.Text = ""; txtprecoVenda.Text = ""; }
public override bool Salvar() { ProdutosDTO prod = new ProdutosDTO(); prod.PROD_NOME = txtNomeProduto.Text; prod.PROD_CATEGORIA = txtCategoria.Text; prod.PROD_DESCRICAO = txtdescricaoproduto.Text; prod.PROD_VLUNIT = txtprecoCusto.Text; prod.PROD_VFINAL = txtprecoVenda.Text; prod.PROD_ESTOQUE = "SIM"; int idProduto = new ProdutosBLL().Salvar(prod); foreach (ListViewItem item in listView2.Items) { new ProdutosBLL().SalvarPeca(idProduto, int.Parse(item.Text.Split('-')[0].ToString())); } return false; }