Example #1
0
 public List <Cliente> listar()
 {
     try
     {
         ClienteDaoImp clienteDao = new ClienteDaoImp();
         return(clienteDao.listCliente());
     }
     catch (ConexaoException c)
     {
         throw new GeralException(c.Message);
     }
     catch (DaoException d)
     {
         throw new GeralException(d.Message);
     }
 }
Example #2
0
 public void deletar(Cliente cliente)
 {
     try
     {
         this.clienteDao = new ClienteDaoImp();
         if (cliente.Equals(null) || cliente.Equals(""))
         {
             throw new Exception("Objeto Usuario Nulo");
         }
         this.clienteDao.deletarCliente(cliente);
     }
     catch (ConexaoException c)
     {
         throw new GeralException(c.Message);
     }
     catch (DaoException d)
     {
         throw new GeralException(d.Message);
     }
 }
Example #3
0
 public void cadastrar(Cliente cliente)
 {
     try
     {
         this.clienteDao = new ClienteDaoImp();
         if (cliente.Equals(null) || cliente.Equals(""))
         {
             throw new Exception("Objeto Cliente Nulo");
         }
         this.clienteDao.insertCliente(cliente);
     }
     catch (ConexaoException c)
     {
         throw new GeralException(c.Message);
     }
     catch (DaoException d)
     {
         throw new GeralException(d.Message);
     }
 }