Package br.com.yaw.sjc.dao

Examples of br.com.yaw.sjc.dao.MercadoriaDAO


 
  private class SalvarMercadoriaListener implements ActionListener {
    public void actionPerformed(ActionEvent e) {
      try {
        Mercadoria m = loadMercadoriaFromPanel();
        MercadoriaDAO dao = new MercadoriaDAOJDBC();
        dao.save(m);
       
        setVisible(false);
        resetForm();
        SwingUtilities.invokeLater(framePrincipal.newAtualizaMercadoriasAction());
       
View Full Code Here


  private class ExcluirMercadoriaListener implements ActionListener {
    public void actionPerformed(ActionEvent e) {
      Integer id = getIdMercadoria();
      if (id != null) {
        try {
          MercadoriaDAO dao = new MercadoriaDAOJDBC();
          Mercadoria m = dao.findById(id);
          if (m != null) {
            dao.remove(m);
          }
         
          setVisible(false);
          resetForm();
          SwingUtilities.invokeLater(framePrincipal.newAtualizaMercadoriasAction());
View Full Code Here

        resetForm();
        setVisible(false);
        return;
      }
      try {
        MercadoriaDAO dao = new MercadoriaDAOJDBC();
        final List<Mercadoria> mercadorias = dao.getMercadoriasByNome(tfNome.getText());
        resetForm();
        setVisible(false);
       
        framePrincipal.refreshTable(mercadorias);
      } catch (Exception ex) {
View Full Code Here

 
  public Runnable newAtualizaMercadoriasAction() {
    return new Runnable() {
      public void run() {
        try {
          MercadoriaDAO dao = new MercadoriaDAOJDBC();
          tabela.reload(dao.getAll());
        } catch (PersistenceException ex) {
          JOptionPane.showMessageDialog(ListaMercadoriasFrame.this,
              ex.getMessage(), "Erro ao consultar Mercadoria(s)", JOptionPane.ERROR_MESSAGE);
        }
      }
View Full Code Here

TOP

Related Classes of br.com.yaw.sjc.dao.MercadoriaDAO

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.