示例#1
0
 protected override void excluirRegistro(int Id)
 {
     base.excluirRegistro(Id);
     ProdutoBLL = new ProdutoBLL();
     try
     {
         if (Convert.ToInt32(dgvDados[0, dgvDados.CurrentRow.Index].Value) > 0)
         {
             Produto Produto = ProdutoBLL.Localizar(Convert.ToInt32(dgvDados[0, dgvDados.CurrentRow.Index].Value));
             if (MessageBox.Show("Deseja realmente excluir o registro : " + Produto.id.ToString() + " - " + Produto.descricao, Text, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
             {
                 ProdutoBLL.ExcluirProduto(Produto);
                 bool         intOmie           = Convert.ToBoolean(Parametro.GetParametro("intOmie"));
                 bool         updateProdutoOmie = Convert.ToBoolean(Parametro.GetParametro("updateProdutoOmie"));
                 ProdutoProxy proxy             = new ProdutoProxy();
                 if (intOmie & updateProdutoOmie)
                 {
                     if (Produto.codigo_produto > 0)
                     {
                         proxy.ExcluirProduto(Produto);
                     }
                 }
             }
         }
     }
     finally
     {
         ProdutoBLL.Dispose();
     }
 }
示例#2
0
 public void Dispose()
 {
     ProdutoBLL.Dispose();
 }