/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/*
* FrmPrincipalSCC.java
*
* Created on 13/10/2010, 15:40:30
*/
package boundary;
import control.ControladoraRelatorio;
import java.sql.SQLException;
import java.text.ParseException;
import java.util.Vector;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import util.ConexaoException;
import util.MinhaException;
/**
*
* @author Rodrigo Martins
*/
public class FrmPrincipalSCC extends javax.swing.JFrame {
private ControladoraRelatorio controlRelatorio = new ControladoraRelatorio();
private static Vector usuario = new Vector();
private static Vector usuarioTipo = new Vector();
Vector usua = new Vector();
public static Vector getUsuarioTipo() {
return usuarioTipo;
}
public static void setUsuarioTipo(Vector usuarioTipo) {
FrmPrincipalSCC.usuarioTipo = usuarioTipo;
}
public static Vector getUsuario() {
return usuario;
}
public static void setUsuario(Vector usuario) {
FrmPrincipalSCC.usuario = usuario;
}
/** Creates new form FrmPrincipalSCC
* @param userTipo
* @param user
*/
public FrmPrincipalSCC(Vector userTipo, Vector user) {
initComponents();
this.setExtendedState(FrmPrincipalSCC.MAXIMIZED_BOTH);
Vector admin = (Vector) user.get(0);
usuario = (Vector) user.get(0);
usuarioTipo = userTipo;
this.jLTipo.setText(userTipo.get(0).toString());
if (userTipo.get(0).equals("Cliente"))
{
this.jLNomeUsuario.setText(usuario.get(6).toString());
this.jMLocacao.setVisible(false);
this.jMRF.setVisible(false);
this.jMRelatorio.setVisible(false);
this.jMRevisao.setVisible(false);
this.jMEntrega.setVisible(false);
this.jMIListagemReserva.setVisible(false);
} else if (admin.get(1).equals("admin"))
{
this.jLTipo.setText("Administrator");
}else if (userTipo.get(0).equals("Funcionario"))
{
this.jLNomeUsuario.setText(usuario.get(3).toString());
}
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jBSair = new javax.swing.JButton();
jLTipo = new javax.swing.JLabel();
jLNomeUsuario = new javax.swing.JLabel();
jLabel1 = new javax.swing.JLabel();
jMenuSCC = new javax.swing.JMenuBar();
jMLocacao = new javax.swing.JMenu();
jMIInserirLocacao = new javax.swing.JMenuItem();
MIListagemLocacao = new javax.swing.JMenuItem();
jMRevisao = new javax.swing.JMenu();
jMIInserirRevisao = new javax.swing.JMenuItem();
jMIListagemRevisao = new javax.swing.JMenuItem();
jMReserva = new javax.swing.JMenu();
jMIReserva = new javax.swing.JMenuItem();
jMIListagemReserva = new javax.swing.JMenuItem();
jMEntrega = new javax.swing.JMenu();
jMIInserirEntrega = new javax.swing.JMenuItem();
jMIListagemEntrega = new javax.swing.JMenuItem();
jMRF = new javax.swing.JMenu();
jMCadastroAcessorio = new javax.swing.JMenu();
jMIInserirAcessorio = new javax.swing.JMenuItem();
jMIListagemAcessorio = new javax.swing.JMenuItem();
jMCadastroOficina = new javax.swing.JMenu();
jMIInserirOficina = new javax.swing.JMenuItem();
jMIListagemOficina = new javax.swing.JMenuItem();
jMCadastroCidade = new javax.swing.JMenu();
jMIInserirCidade = new javax.swing.JMenuItem();
jMIListagemCidade = new javax.swing.JMenuItem();
jMCadastroTipoCarro = new javax.swing.JMenu();
jMIInserirTipoCarro = new javax.swing.JMenuItem();
jMIListagemTipoCarro = new javax.swing.JMenuItem();
jMCadastroUF = new javax.swing.JMenu();
jMIInserirUF = new javax.swing.JMenuItem();
jMIListagemUF = new javax.swing.JMenuItem();
jMCadastroFuncionario = new javax.swing.JMenu();
jMIInserirFuncionario = new javax.swing.JMenuItem();
jMIListagemFuncionario = new javax.swing.JMenuItem();
jMCadastroCliente = new javax.swing.JMenu();
jMIInserirCliente = new javax.swing.JMenuItem();
jMIListagemCliente = new javax.swing.JMenuItem();
jMCadastroGrupoCarro = new javax.swing.JMenu();
jMIInserirGC = new javax.swing.JMenuItem();
jMIListagemGrupoCarro = new javax.swing.JMenuItem();
jMCadastroCarro = new javax.swing.JMenu();
jMIInserirCarro = new javax.swing.JMenuItem();
jMIListagemCarro = new javax.swing.JMenuItem();
jMRelatorio = new javax.swing.JMenu();
jMICarroMaisLocado = new javax.swing.JMenuItem();
jMIRelatorioCarroMaisLocadoPorUmCliente = new javax.swing.JMenuItem();
jMIGCMaisLocado = new javax.swing.JMenuItem();
jMILocacaoPorCliente = new javax.swing.JMenuItem();
jMIReservaPorData = new javax.swing.JMenuItem();
jMIRelatorioPagamento = new javax.swing.JMenuItem();
jMIRelatorioCarroAposData = new javax.swing.JMenuItem();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("SCC - Sistema de Controle de Carro");
jBSair.setText("Sair");
jBSair.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jBSairActionPerformed(evt);
}
});
jLTipo.setText("Tipo:");
jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/LogoFactory.gif"))); // NOI18N
jMLocacao.setText("Locação");
jMIInserirLocacao.setText("Inserir Locação");
jMIInserirLocacao.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMIInserirLocacaoActionPerformed(evt);
}
});
jMLocacao.add(jMIInserirLocacao);
MIListagemLocacao.setText("Listagem Locação");
MIListagemLocacao.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
MIListagemLocacaoActionPerformed(evt);
}
});
jMLocacao.add(MIListagemLocacao);
jMenuSCC.add(jMLocacao);
jMRevisao.setText("Revisão");
jMIInserirRevisao.setText("Inserir Revisão");
jMIInserirRevisao.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMIInserirRevisaoActionPerformed(evt);
}
});
jMRevisao.add(jMIInserirRevisao);
jMIListagemRevisao.setText("Listagem Revisão");
jMIListagemRevisao.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMIListagemRevisaoActionPerformed(evt);
}
});
jMRevisao.add(jMIListagemRevisao);
jMenuSCC.add(jMRevisao);
jMReserva.setText("Reserva");
jMIReserva.setText("Inserir Reserva");
jMIReserva.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMIReservaActionPerformed(evt);
}
});
jMReserva.add(jMIReserva);
jMIListagemReserva.setText("Listagem Reserva");
jMIListagemReserva.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMIListagemReservaActionPerformed(evt);
}
});
jMReserva.add(jMIListagemReserva);
jMenuSCC.add(jMReserva);
jMEntrega.setText("Entrega");
jMIInserirEntrega.setText("Inserir Entrega");
jMIInserirEntrega.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMIInserirEntregaActionPerformed(evt);
}
});
jMEntrega.add(jMIInserirEntrega);
jMIListagemEntrega.setText("Listagem de Entrega");
jMIListagemEntrega.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMIListagemEntregaActionPerformed(evt);
}
});
jMEntrega.add(jMIListagemEntrega);
jMenuSCC.add(jMEntrega);
jMRF.setText("Cadastros");
jMCadastroAcessorio.setText("Cadastro Acessorio");
jMIInserirAcessorio.setText("Inserir Acessório");
jMIInserirAcessorio.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMIInserirAcessorioActionPerformed(evt);
}
});
jMCadastroAcessorio.add(jMIInserirAcessorio);
jMIListagemAcessorio.setText("Listagem Acessório");
jMIListagemAcessorio.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMIListagemAcessorioActionPerformed(evt);
}
});
jMCadastroAcessorio.add(jMIListagemAcessorio);
jMRF.add(jMCadastroAcessorio);
jMCadastroOficina.setText("Cadastro Oficina");
jMIInserirOficina.setText("Inserir Oficina");
jMIInserirOficina.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMIInserirOficinaActionPerformed(evt);
}
});
jMCadastroOficina.add(jMIInserirOficina);
jMIListagemOficina.setText("Listagem Oficina");
jMIListagemOficina.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMIListagemOficinaActionPerformed(evt);
}
});
jMCadastroOficina.add(jMIListagemOficina);
jMRF.add(jMCadastroOficina);
jMCadastroCidade.setText("Cadastro Cidade");
jMIInserirCidade.setText("Inserir Cidade");
jMIInserirCidade.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMIInserirCidadeActionPerformed(evt);
}
});
jMCadastroCidade.add(jMIInserirCidade);
jMIListagemCidade.setText("Listagem Cidade");
jMIListagemCidade.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMIListagemCidadeActionPerformed(evt);
}
});
jMCadastroCidade.add(jMIListagemCidade);
jMRF.add(jMCadastroCidade);
jMCadastroTipoCarro.setText("Cadastro Tipo Carro");
jMIInserirTipoCarro.setText("Inserir Tipo Carro");
jMIInserirTipoCarro.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMIInserirTipoCarroActionPerformed(evt);
}
});
jMCadastroTipoCarro.add(jMIInserirTipoCarro);
jMIListagemTipoCarro.setText("Listagem Tipo Carro");
jMIListagemTipoCarro.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMIListagemTipoCarroActionPerformed(evt);
}
});
jMCadastroTipoCarro.add(jMIListagemTipoCarro);
jMRF.add(jMCadastroTipoCarro);
jMCadastroUF.setText("Cadastro UF");
jMIInserirUF.setText("Inserir UF");
jMIInserirUF.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMIInserirUFActionPerformed(evt);
}
});
jMCadastroUF.add(jMIInserirUF);
jMIListagemUF.setText("Listagem UF");
jMIListagemUF.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMIListagemUFActionPerformed(evt);
}
});
jMCadastroUF.add(jMIListagemUF);
jMRF.add(jMCadastroUF);
jMCadastroFuncionario.setText("Cadastro Funcionários");
jMIInserirFuncionario.setText("Inserir Funcionario");
jMIInserirFuncionario.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMIInserirFuncionarioActionPerformed(evt);
}
});
jMCadastroFuncionario.add(jMIInserirFuncionario);
jMIListagemFuncionario.setText("Listagem Funcionario");
jMIListagemFuncionario.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMIListagemFuncionarioActionPerformed(evt);
}
});
jMCadastroFuncionario.add(jMIListagemFuncionario);
jMRF.add(jMCadastroFuncionario);
jMCadastroCliente.setText("Cadastro Cliente");
jMIInserirCliente.setText("Inserir Cliente");
jMIInserirCliente.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMIInserirClienteActionPerformed(evt);
}
});
jMCadastroCliente.add(jMIInserirCliente);
jMIListagemCliente.setText("Listagem Cliente");
jMIListagemCliente.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMIListagemClienteActionPerformed(evt);
}
});
jMCadastroCliente.add(jMIListagemCliente);
jMRF.add(jMCadastroCliente);
jMCadastroGrupoCarro.setText("Cadastro Grupo de Carro");
jMIInserirGC.setText("Inserir Grupo Carro");
jMIInserirGC.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMIInserirGCActionPerformed(evt);
}
});
jMCadastroGrupoCarro.add(jMIInserirGC);
jMIListagemGrupoCarro.setText("Listagem Grupo Carro");
jMIListagemGrupoCarro.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMIListagemGrupoCarroActionPerformed(evt);
}
});
jMCadastroGrupoCarro.add(jMIListagemGrupoCarro);
jMRF.add(jMCadastroGrupoCarro);
jMCadastroCarro.setText("Cadastro Carro");
jMIInserirCarro.setText("Inserir Carro");
jMIInserirCarro.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMIInserirCarroActionPerformed(evt);
}
});
jMCadastroCarro.add(jMIInserirCarro);
jMIListagemCarro.setText("Listagem Carro");
jMIListagemCarro.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMIListagemCarroActionPerformed(evt);
}
});
jMCadastroCarro.add(jMIListagemCarro);
jMRF.add(jMCadastroCarro);
jMenuSCC.add(jMRF);
jMRelatorio.setText("Relatórios");
jMICarroMaisLocado.setText("Carro Mais Locado");
jMICarroMaisLocado.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMICarroMaisLocadoActionPerformed(evt);
}
});
jMRelatorio.add(jMICarroMaisLocado);
jMIRelatorioCarroMaisLocadoPorUmCliente.setText("Carro mais Locado Por Um Cliente");
jMIRelatorioCarroMaisLocadoPorUmCliente.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMIRelatorioCarroMaisLocadoPorUmClienteActionPerformed(evt);
}
});
jMRelatorio.add(jMIRelatorioCarroMaisLocadoPorUmCliente);
jMIGCMaisLocado.setText("Grupo de carro mais Locado");
jMIGCMaisLocado.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMIGCMaisLocadoActionPerformed(evt);
}
});
jMRelatorio.add(jMIGCMaisLocado);
jMILocacaoPorCliente.setText("Locação Por Cliente");
jMILocacaoPorCliente.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMILocacaoPorClienteActionPerformed(evt);
}
});
jMRelatorio.add(jMILocacaoPorCliente);
jMIReservaPorData.setText("Reserva por Data");
jMIReservaPorData.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMIReservaPorDataActionPerformed(evt);
}
});
jMRelatorio.add(jMIReservaPorData);
jMIRelatorioPagamento.setText("Pagamentos");
jMIRelatorioPagamento.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMIRelatorioPagamentoActionPerformed(evt);
}
});
jMRelatorio.add(jMIRelatorioPagamento);
jMIRelatorioCarroAposData.setText("Carro que passou da Data de Entrega");
jMIRelatorioCarroAposData.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMIRelatorioCarroAposDataActionPerformed(evt);
}
});
jMRelatorio.add(jMIRelatorioCarroAposData);
jMenuSCC.add(jMRelatorio);
setJMenuBar(jMenuSCC);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(jBSair)
.addGap(65, 65, 65))
.addGroup(layout.createSequentialGroup()
.addComponent(jLTipo)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLNomeUsuario)
.addContainerGap(959, Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 983, Short.MAX_VALUE)
.addContainerGap())))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 455, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jBSair)
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLTipo)
.addComponent(jLNomeUsuario))
.addContainerGap())
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void jBSairActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBSairActionPerformed
System.exit(0);
}//GEN-LAST:event_jBSairActionPerformed
private void jMIReservaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIReservaActionPerformed
try {
new FrmReserva(usuarioTipo, usuario).setVisible(true);
} catch (MinhaException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
} catch (SQLException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
} catch (ConexaoException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_jMIReservaActionPerformed
private void jMIListagemReservaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIListagemReservaActionPerformed
try {
// TODO add your handling code here:
new FrmListagemReserva(usuarioTipo,usuario).setVisible(true);
} catch (ConexaoException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_jMIListagemReservaActionPerformed
private void jMIInserirEntregaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIInserirEntregaActionPerformed
// TODO add your handling code here:
new FrmRegistrarEntrega(usuarioTipo, usuario).setVisible(true);
}//GEN-LAST:event_jMIInserirEntregaActionPerformed
private void jMIListagemEntregaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIListagemEntregaActionPerformed
// TODO add your handling code here:
try{
new FrmListagemEntrega(usuarioTipo, usuario).setVisible(true);
} catch (ConexaoException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_jMIListagemEntregaActionPerformed
private void jMIListagemAcessorioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIListagemAcessorioActionPerformed
try {
new FrmListagemAcessorio(usuarioTipo, usuario).setVisible(true);
} catch (MinhaException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
} catch (ConexaoException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_jMIListagemAcessorioActionPerformed
private void jMIInserirAcessorioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIInserirAcessorioActionPerformed
// TODO add your handling code here:
new FrmCadastroAcessorio().setVisible(true);
}//GEN-LAST:event_jMIInserirAcessorioActionPerformed
private void jMIListagemOficinaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIListagemOficinaActionPerformed
// TODO add your handling code here:
try {
new FrmListagemOficina(usuarioTipo, usuario).setVisible(true);
} catch (ConexaoException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_jMIListagemOficinaActionPerformed
private void jMIInserirOficinaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIInserirOficinaActionPerformed
try {
// TODO add your handling code here:
new FrmCadastroOficina().setVisible(true);
} catch (MinhaException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
} catch (SQLException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
} catch (ConexaoException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_jMIInserirOficinaActionPerformed
private void jMIInserirCidadeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIInserirCidadeActionPerformed
try {
// TODO add your handling code here:
new FrmCadastroCidade().setVisible(true);
} catch (MinhaException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
} catch (SQLException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
} catch (ConexaoException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_jMIInserirCidadeActionPerformed
private void jMIListagemCidadeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIListagemCidadeActionPerformed
try {
new FrmListagemCidade(usuario, usua).setVisible(true);
} catch (MinhaException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
} catch (ConexaoException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_jMIListagemCidadeActionPerformed
private void jMIInserirTipoCarroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIInserirTipoCarroActionPerformed
new FrmCadastroTipoCarro().setVisible(true);
}//GEN-LAST:event_jMIInserirTipoCarroActionPerformed
private void jMIListagemTipoCarroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIListagemTipoCarroActionPerformed
try {
// TODO add your handling code here:
new FrmListagemTipoCarro(usuario, usua).setVisible(true);
} catch (MinhaException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
} catch (ConexaoException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_jMIListagemTipoCarroActionPerformed
private void jMIRelatorioCarroMaisLocadoPorUmClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIRelatorioCarroMaisLocadoPorUmClienteActionPerformed
// TODO add your handling code here:
String param_inicial = JOptionPane.showInputDialog(null, "Digite a Data inicial {no formato-> dd/mm/aaaa}", "Passagem de Prametro", JOptionPane.INFORMATION_MESSAGE);
String param_final = JOptionPane.showInputDialog(null, "Digite a Data Final {no formato-> dd/mm/aaaa}", "Passagem de Prametro", JOptionPane.INFORMATION_MESSAGE);
String nomeRelatorio = "CarroMaisLocadoPorUmCliente";
if (!param_inicial.equals(null)){
if (!param_final.equals(null)){
try {
try {
try {
controlRelatorio.relatorio(nomeRelatorio, param_inicial, param_final, usuario);
} catch (ParseException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
}
} catch (SQLException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
} catch (ConexaoException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
}
} catch (MinhaException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
}//GEN-LAST:event_jMIRelatorioCarroMaisLocadoPorUmClienteActionPerformed
private void jMIInserirUFActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIInserirUFActionPerformed
new FrmUF().setVisible(true);
}//GEN-LAST:event_jMIInserirUFActionPerformed
private void jMIListagemUFActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIListagemUFActionPerformed
try {
// TODO add your handling code here:
new FrmListagemUF(usuario, usua).setVisible(true);
} catch (ConexaoException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
} catch (MinhaException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_jMIListagemUFActionPerformed
private void jMIInserirFuncionarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIInserirFuncionarioActionPerformed
new FrmCadastroFuncionario().setVisible(true);
}//GEN-LAST:event_jMIInserirFuncionarioActionPerformed
private void jMIListagemFuncionarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIListagemFuncionarioActionPerformed
try {
// TODO add your handling code here:
new FrmListagemFuncionarios().setVisible(true);
} catch (ConexaoException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_jMIListagemFuncionarioActionPerformed
private void jMIInserirClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIInserirClienteActionPerformed
// TODO add your handling code here:
new FrmCadastroCliente().setVisible(true);
}//GEN-LAST:event_jMIInserirClienteActionPerformed
private void jMIListagemClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIListagemClienteActionPerformed
try {
// TODO add your handling code here:
new FrmListagemClientes().setVisible(true);
} catch (ConexaoException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_jMIListagemClienteActionPerformed
private void jMIReservaPorDataActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIReservaPorDataActionPerformed
// TODO add your handling code here:
String param_inicial = JOptionPane.showInputDialog(null, "Digite a Data inicial {no formato-> dd/mm/aaaa}", "Passagem de Prametro", JOptionPane.INFORMATION_MESSAGE);
String param_final = JOptionPane.showInputDialog(null, "Digite a Data Final {no formato-> dd/mm/aaaa}", "Passagem de Prametro", JOptionPane.INFORMATION_MESSAGE);
String nomeRelatorio = "ReservaPorDataLoca";
if (!param_inicial.equals(null)){
if (!param_final.equals(null)){
try {
try {
try {
controlRelatorio.relatorio(nomeRelatorio, param_inicial, param_final, usuario);
} catch (ParseException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
}
} catch (SQLException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
} catch (ConexaoException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
}
} catch (MinhaException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
}//GEN-LAST:event_jMIReservaPorDataActionPerformed
private void jMICarroMaisLocadoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMICarroMaisLocadoActionPerformed
// TODO add your handling code here:
String nomeRelatorio = "CarroMaisLocado";
try {
controlRelatorio.relatorio(nomeRelatorio, usuario);
} catch (MinhaException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
} catch (SQLException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
} catch (ConexaoException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
} catch (ParseException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_jMICarroMaisLocadoActionPerformed
private void jMIGCMaisLocadoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIGCMaisLocadoActionPerformed
// TODO add your handling code here:
String nomeRelatorio = "GrupoCarroMaisLocad";
try {
controlRelatorio.relatorio(nomeRelatorio, usuario);
} catch (MinhaException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
} catch (SQLException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
} catch (ConexaoException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
} catch (ParseException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_jMIGCMaisLocadoActionPerformed
private void jMILocacaoPorClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMILocacaoPorClienteActionPerformed
// TODO add your handling code here:
String nomeRelatorio = "LocacaoPorClient";
try {
controlRelatorio.relatorio(nomeRelatorio, usuario);
} catch (MinhaException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
} catch (SQLException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
} catch (ConexaoException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
} catch (ParseException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_jMILocacaoPorClienteActionPerformed
private void jMIInserirRevisaoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIInserirRevisaoActionPerformed
// TODO add your handling code here:
//new FrmRevisao().setVisible(true);
}//GEN-LAST:event_jMIInserirRevisaoActionPerformed
private void jMIListagemRevisaoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIListagemRevisaoActionPerformed
try {
// TODO add your handling code here:
new FrmListagemRevisao().setVisible(true);
} catch (ConexaoException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_jMIListagemRevisaoActionPerformed
private void jMIInserirLocacaoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIInserirLocacaoActionPerformed
try {
// TODO add your handling code here:
new FrmRegistrarLocacao().setVisible(true);
} catch (ConexaoException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_jMIInserirLocacaoActionPerformed
private void jMIRelatorioPagamentoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIRelatorioPagamentoActionPerformed
// TODO add your handling code here:
String nomeRelatorio = "RelatorioPagamento";
try {
controlRelatorio.relatorio(nomeRelatorio, usuario);
} catch (MinhaException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
} catch (SQLException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
} catch (ConexaoException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
} catch (ParseException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_jMIRelatorioPagamentoActionPerformed
private void jMIRelatorioCarroAposDataActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIRelatorioCarroAposDataActionPerformed
// TODO add your handling code here:
String param_inicial = JOptionPane.showInputDialog(null, "Digite a Data inicial {no formato-> dd/mm/aaaa}", "Passagem de Prametro", JOptionPane.INFORMATION_MESSAGE);
String param_final = JOptionPane.showInputDialog(null, "Digite a Data Final {no formato-> dd/mm/aaaa}", "Passagem de Prametro", JOptionPane.INFORMATION_MESSAGE);
String nomeRelatorio = "CarroQuePassouDODiaDEEntrega";
if (!param_inicial.equals(null)){
if (!param_final.equals(null)){
try {
try {
try {
controlRelatorio.relatorio(nomeRelatorio, param_inicial, param_final, usuario);
} catch (ParseException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
}
} catch (SQLException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
} catch (ConexaoException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
}
} catch (MinhaException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
}//GEN-LAST:event_jMIRelatorioCarroAposDataActionPerformed
private void jMIInserirGCActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIInserirGCActionPerformed
try {
// TODO add your handling code here:
new FrmCadastroGrupoCarro().setVisible(true);
} catch (ConexaoException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_jMIInserirGCActionPerformed
private void jMIListagemGrupoCarroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIListagemGrupoCarroActionPerformed
try {
// TODO add your handling code here:
new FrmListagemGrupoCarro().setVisible(true);
} catch (ConexaoException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_jMIListagemGrupoCarroActionPerformed
private void jMIInserirCarroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIInserirCarroActionPerformed
try {
// TODO add your handling code here:
new FrmCadastroCarro().setVisible(true);
} catch (ConexaoException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_jMIInserirCarroActionPerformed
private void jMIListagemCarroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIListagemCarroActionPerformed
try {
// TODO add your handling code here:
new FrmListagemCarros().setVisible(true);
} catch (ConexaoException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_jMIListagemCarroActionPerformed
private void MIListagemLocacaoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_MIListagemLocacaoActionPerformed
try {
// TODO add your handling code here:
new FrmListagemLocacao().setVisible(true);
} catch (ConexaoException ex) {
Logger.getLogger(FrmPrincipalSCC.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_MIListagemLocacaoActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JMenuItem MIListagemLocacao;
private javax.swing.JButton jBSair;
private javax.swing.JLabel jLNomeUsuario;
private javax.swing.JLabel jLTipo;
private javax.swing.JLabel jLabel1;
private javax.swing.JMenu jMCadastroAcessorio;
private javax.swing.JMenu jMCadastroCarro;
private javax.swing.JMenu jMCadastroCidade;
private javax.swing.JMenu jMCadastroCliente;
private javax.swing.JMenu jMCadastroFuncionario;
private javax.swing.JMenu jMCadastroGrupoCarro;
private javax.swing.JMenu jMCadastroOficina;
private javax.swing.JMenu jMCadastroTipoCarro;
private javax.swing.JMenu jMCadastroUF;
private javax.swing.JMenu jMEntrega;
private javax.swing.JMenuItem jMICarroMaisLocado;
private javax.swing.JMenuItem jMIGCMaisLocado;
private javax.swing.JMenuItem jMIInserirAcessorio;
private javax.swing.JMenuItem jMIInserirCarro;
private javax.swing.JMenuItem jMIInserirCidade;
private javax.swing.JMenuItem jMIInserirCliente;
private javax.swing.JMenuItem jMIInserirEntrega;
private javax.swing.JMenuItem jMIInserirFuncionario;
private javax.swing.JMenuItem jMIInserirGC;
private javax.swing.JMenuItem jMIInserirLocacao;
private javax.swing.JMenuItem jMIInserirOficina;
private javax.swing.JMenuItem jMIInserirRevisao;
private javax.swing.JMenuItem jMIInserirTipoCarro;
private javax.swing.JMenuItem jMIInserirUF;
private javax.swing.JMenuItem jMIListagemAcessorio;
private javax.swing.JMenuItem jMIListagemCarro;
private javax.swing.JMenuItem jMIListagemCidade;
private javax.swing.JMenuItem jMIListagemCliente;
private javax.swing.JMenuItem jMIListagemEntrega;
private javax.swing.JMenuItem jMIListagemFuncionario;
private javax.swing.JMenuItem jMIListagemGrupoCarro;
private javax.swing.JMenuItem jMIListagemOficina;
private javax.swing.JMenuItem jMIListagemReserva;
private javax.swing.JMenuItem jMIListagemRevisao;
private javax.swing.JMenuItem jMIListagemTipoCarro;
private javax.swing.JMenuItem jMIListagemUF;
private javax.swing.JMenuItem jMILocacaoPorCliente;
private javax.swing.JMenuItem jMIRelatorioCarroAposData;
private javax.swing.JMenuItem jMIRelatorioCarroMaisLocadoPorUmCliente;
private javax.swing.JMenuItem jMIRelatorioPagamento;
private javax.swing.JMenuItem jMIReserva;
private javax.swing.JMenuItem jMIReservaPorData;
private javax.swing.JMenu jMLocacao;
private javax.swing.JMenu jMRF;
private javax.swing.JMenu jMRelatorio;
private javax.swing.JMenu jMReserva;
private javax.swing.JMenu jMRevisao;
private javax.swing.JMenuBar jMenuSCC;
// End of variables declaration//GEN-END:variables
}