bug #6772
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/Integracion/IntegracaoReceitaDespesa/trunk/IntegracaoReceitaDespesa@49987 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
1cb9d6ae1c
commit
1a473b016a
|
@ -1,4 +0,0 @@
|
||||||
url=jdbc:oracle:thin:@db-proj.cg09ytaizn5g.us-east-1.rds.amazonaws.com:1521:ORCL
|
|
||||||
username=vtabol
|
|
||||||
password=vtax05
|
|
||||||
|
|
|
@ -1,16 +0,0 @@
|
||||||
# Root logger option
|
|
||||||
log4j.rootLogger=DEBUG, stdout, file
|
|
||||||
|
|
||||||
# Redirect log messages to console
|
|
||||||
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
|
|
||||||
log4j.appender.stdout.Target=System.out
|
|
||||||
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
|
|
||||||
log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
|
|
||||||
|
|
||||||
# Redirect log messages to a log file, support file rolling.
|
|
||||||
log4j.appender.file=org.apache.log4j.RollingFileAppender
|
|
||||||
log4j.appender.file.File=${user.home}/integracaoReceitaDespesa.log
|
|
||||||
log4j.appender.file.MaxFileSize=5MB
|
|
||||||
log4j.appender.file.MaxBackupIndex=10
|
|
||||||
log4j.appender.file.layout=org.apache.log4j.PatternLayout
|
|
||||||
log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
|
|
|
@ -1,122 +0,0 @@
|
||||||
package com.rjconsultores.integracaoreceitadespesa.view;
|
|
||||||
import java.awt.BorderLayout;
|
|
||||||
import java.awt.Cursor;
|
|
||||||
import java.io.File;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import javax.swing.JDesktopPane;
|
|
||||||
import javax.swing.JFileChooser;
|
|
||||||
import javax.swing.JMenu;
|
|
||||||
import javax.swing.JMenuBar;
|
|
||||||
import javax.swing.JMenuItem;
|
|
||||||
import javax.swing.JOptionPane;
|
|
||||||
import javax.swing.SwingUtilities;
|
|
||||||
import javax.swing.WindowConstants;
|
|
||||||
import javax.swing.event.MenuEvent;
|
|
||||||
import javax.swing.event.MenuListener;
|
|
||||||
|
|
||||||
import com.rjconsultores.integracaoreceitadespesa.Application;
|
|
||||||
import com.rjconsultores.integracaoreceitadespesa.Arquivo;
|
|
||||||
import com.rjconsultores.integracaoreceitadespesa.dao.Totalbus;
|
|
||||||
import com.rjconsultores.integracaoreceitadespesa.entidades.DespesaReceita;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This code was edited or generated using CloudGarden's Jigloo
|
|
||||||
* SWT/Swing GUI Builder, which is free for non-commercial
|
|
||||||
* use. If Jigloo is being used commercially (ie, by a corporation,
|
|
||||||
* company or business for any purpose whatever) then you
|
|
||||||
* should purchase a license for each developer using Jigloo.
|
|
||||||
* Please visit www.cloudgarden.com for details.
|
|
||||||
* Use of Jigloo implies acceptance of these licensing terms.
|
|
||||||
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
|
|
||||||
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
|
|
||||||
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
|
|
||||||
*/
|
|
||||||
public class FrmMain extends javax.swing.JFrame implements MenuListener {
|
|
||||||
private JDesktopPane jDesktopPane1;
|
|
||||||
private JMenuBar jMenuBar1;
|
|
||||||
private JMenuItem mnuGerarArquivo;
|
|
||||||
private JMenu jMenu1;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Auto-generated main method to display this JFrame
|
|
||||||
*/
|
|
||||||
public static void main(String[] args) {
|
|
||||||
SwingUtilities.invokeLater(new Runnable() {
|
|
||||||
public void run() {
|
|
||||||
FrmMain inst = new FrmMain();
|
|
||||||
inst.setLocationRelativeTo(null);
|
|
||||||
inst.setVisible(true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public FrmMain() {
|
|
||||||
super();
|
|
||||||
initGUI();
|
|
||||||
setExtendedState(java.awt.Frame.MAXIMIZED_BOTH);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void initGUI() {
|
|
||||||
try {
|
|
||||||
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
|
|
||||||
{
|
|
||||||
jMenuBar1 = new JMenuBar();
|
|
||||||
setJMenuBar(jMenuBar1);
|
|
||||||
{
|
|
||||||
jMenu1 = new JMenu();
|
|
||||||
jMenuBar1.add(jMenu1);
|
|
||||||
jMenu1.setText("Gerar Arquivo");
|
|
||||||
jMenu1.addMenuListener(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
{
|
|
||||||
jDesktopPane1 = new JDesktopPane();
|
|
||||||
getContentPane().add(jDesktopPane1, BorderLayout.CENTER);
|
|
||||||
}
|
|
||||||
pack();
|
|
||||||
setSize(400, 300);
|
|
||||||
} catch (Exception e) {
|
|
||||||
//add your error handling code here
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void menuCanceled(MenuEvent e) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void menuDeselected(MenuEvent e) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void menuSelected(MenuEvent e) {
|
|
||||||
if (e.getSource() == jMenu1){
|
|
||||||
PnlPeriodo pnl = new PnlPeriodo();
|
|
||||||
|
|
||||||
int answer = JOptionPane.showConfirmDialog(null, pnl, "Executar Exportação", JOptionPane.OK_CANCEL_OPTION);
|
|
||||||
if (answer == JOptionPane.OK_OPTION) {
|
|
||||||
|
|
||||||
this.setCursor(new Cursor(Cursor.WAIT_CURSOR));
|
|
||||||
final JFileChooser fc = new JFileChooser();
|
|
||||||
int returnVal = fc.showSaveDialog(this);
|
|
||||||
|
|
||||||
if (returnVal == JFileChooser.APPROVE_OPTION) {
|
|
||||||
File file = fc.getSelectedFile();
|
|
||||||
Totalbus totalbus = new Totalbus(Application.getInstance().getConnection());
|
|
||||||
Arquivo.GravaArquivo(file.getAbsolutePath(), totalbus.getDespesasReceitas(pnl.getPuntoventa(), pnl.getEmpresa()));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
JOptionPane.showMessageDialog(null, "Operação cancelada pelo usuário");
|
|
||||||
}
|
|
||||||
this.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,116 +0,0 @@
|
||||||
package com.rjconsultores.integracaoreceitadespesa.view;
|
|
||||||
|
|
||||||
import javax.swing.DefaultComboBoxModel;
|
|
||||||
import javax.swing.JComboBox;
|
|
||||||
import javax.swing.JFrame;
|
|
||||||
import javax.swing.JLabel;
|
|
||||||
import javax.swing.JTextField;
|
|
||||||
import javax.swing.WindowConstants;
|
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
|
||||||
|
|
||||||
import com.rjconsultores.integracaoreceitadespesa.Application;
|
|
||||||
import com.rjconsultores.integracaoreceitadespesa.dao.Totalbus;
|
|
||||||
import com.rjconsultores.integracaoreceitadespesa.entidades.Empresa;
|
|
||||||
import com.rjconsultores.integracaoreceitadespesa.entidades.PuntoVenta;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This code was edited or generated using CloudGarden's Jigloo
|
|
||||||
* SWT/Swing GUI Builder, which is free for non-commercial
|
|
||||||
* use. If Jigloo is being used commercially (ie, by a corporation,
|
|
||||||
* company or business for any purpose whatever) then you
|
|
||||||
* should purchase a license for each developer using Jigloo.
|
|
||||||
* Please visit www.cloudgarden.com for details.
|
|
||||||
* Use of Jigloo implies acceptance of these licensing terms.
|
|
||||||
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
|
|
||||||
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
|
|
||||||
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
|
|
||||||
*/
|
|
||||||
public class PnlPeriodo extends javax.swing.JPanel {
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
private static final Logger log = Logger.getLogger(PnlPeriodo.class);
|
|
||||||
|
|
||||||
private JLabel lblPuntoventa;
|
|
||||||
private JComboBox txtPuntoventa;
|
|
||||||
private JLabel lblEmpresa;
|
|
||||||
private JComboBox txtEmpresa;
|
|
||||||
|
|
||||||
private Totalbus totalbus = new Totalbus(Application.getInstance().getConnection());
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Auto-generated main method to display this
|
|
||||||
* JPanel inside a new JFrame.
|
|
||||||
*/
|
|
||||||
public static void main(String[] args) {
|
|
||||||
JFrame frame = new JFrame();
|
|
||||||
frame.getContentPane().add(new PnlPeriodo());
|
|
||||||
frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
|
|
||||||
frame.pack();
|
|
||||||
frame.setVisible(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public PnlPeriodo() {
|
|
||||||
super();
|
|
||||||
initGUI();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void initGUI() {
|
|
||||||
try {
|
|
||||||
this.setPreferredSize(new java.awt.Dimension(425, 72));
|
|
||||||
this.setLayout(null);
|
|
||||||
|
|
||||||
|
|
||||||
this.add(getLblPuntoventa());
|
|
||||||
this.add(getTxtPuntoventa());
|
|
||||||
this.add(getLblEmpresa());
|
|
||||||
this.add(getTxtEmpresa());
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public JLabel getLblPuntoventa() {
|
|
||||||
if (lblPuntoventa == null){
|
|
||||||
lblPuntoventa = new JLabel();
|
|
||||||
lblPuntoventa.setText("Ponto de Venda");
|
|
||||||
lblPuntoventa.setBounds(12, 12, 93, 16);
|
|
||||||
}
|
|
||||||
return lblPuntoventa;
|
|
||||||
}
|
|
||||||
|
|
||||||
public JComboBox getTxtPuntoventa() {
|
|
||||||
if (txtPuntoventa == null){
|
|
||||||
txtPuntoventa = new JComboBox(new DefaultComboBoxModel(totalbus.getPontosVenda().toArray()));
|
|
||||||
txtPuntoventa.setBounds(105, 9, 308, 23);
|
|
||||||
}
|
|
||||||
return txtPuntoventa;
|
|
||||||
}
|
|
||||||
|
|
||||||
public JLabel getLblEmpresa() {
|
|
||||||
if (lblEmpresa == null){
|
|
||||||
lblEmpresa = new JLabel();
|
|
||||||
lblEmpresa.setText("Empresa");
|
|
||||||
lblEmpresa.setBounds(12, 40, 81, 16);
|
|
||||||
}
|
|
||||||
return lblEmpresa;
|
|
||||||
}
|
|
||||||
|
|
||||||
public JComboBox getTxtEmpresa() {
|
|
||||||
if (txtEmpresa == null){
|
|
||||||
txtEmpresa = new JComboBox(new DefaultComboBoxModel(totalbus.getEmpresas().toArray()));
|
|
||||||
txtEmpresa.setBounds(105, 37, 308, 23);
|
|
||||||
}
|
|
||||||
return txtEmpresa;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getPuntoventa(){
|
|
||||||
return ((PuntoVenta)txtPuntoventa.getSelectedItem()).codigo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getEmpresa(){
|
|
||||||
return ((Empresa)txtEmpresa.getSelectedItem()).codigo;
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue