Ejemplo n.º 1
0
 public async Task <int> Excluir(Guid clienteId)
 {
     try
     {
         var cliente = _context.Clientes.Find(clienteId);
         _context.Remove(cliente);
         return(await SalvarCommit());
     }
     catch (MySqlException e)
     {
         _context.Dispose();
         throw e;
     }
 }
 public async Task <int> Excluir(Guid EntityID)
 {
     try
     {
         Fornecedor fornecedor = null;
         fornecedor = _context.Fornecedores.Find(EntityID);
         if (fornecedor != null)
         {
             _context.Remove(fornecedor);
         }
         return(await Save());
     }
     catch (MySqlException e)
     {
         throw new Exception(e.Message);
     }
 }
Ejemplo n.º 3
0
 public async Task <int> Excluir(Guid id)
 {
     try
     {
         Produto produto = null;
         produto = _context.Produtos.Find(id);
         if (produto != null)
         {
             _context.Remove(produto);
         }
         return(await SalvarCommit());
     }
     catch (MySqlException e)
     {
         throw new Exception(e.Message);
     }
 }
Ejemplo n.º 4
0
        public async Task <int> Excluir(Guid id)
        {
            try
            {
                PedidoVenda pedidoVenda = null;
                pedidoVenda = await BuscarPorId(id);

                if (pedidoVenda != null)
                {
                    _context.Remove(pedidoVenda);
                }
                return(await SalvarCommit());
            }
            catch (MySqlException e)
            {
                throw new Exception(e.Message);
            }
        }
Ejemplo n.º 5
0
        public async Task <int> Excluir(Guid id)
        {
            try
            {
                OrdemCompra ordemCompra = null;
                ordemCompra = await BuscarPorId(id);

                if (ordemCompra != null)
                {
                    _context.Remove(ordemCompra);
                }
                return(await SalvarCommit());
            }
            catch (MySqlException e)
            {
                throw new Exception(e.Message);
            }
        }