cancellazione classe MyDialog non usata
This commit is contained in:
parent
1a824c9a11
commit
f5259135fd
@ -1,109 +0,0 @@
|
|||||||
/*
|
|
||||||
* To change this license header, choose License Headers in Project Properties.
|
|
||||||
* To change this template file, choose Tools | Templates
|
|
||||||
* and open the template in the editor.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package puntocassa;
|
|
||||||
|
|
||||||
import java.awt.event.ActionEvent;
|
|
||||||
import java.awt.event.ActionListener;
|
|
||||||
import java.sql.Connection;
|
|
||||||
import java.sql.DriverManager;
|
|
||||||
import java.sql.ResultSet;
|
|
||||||
import java.sql.SQLException;
|
|
||||||
import java.sql.Statement;
|
|
||||||
import javax.swing.JButton;
|
|
||||||
import javax.swing.JComboBox;
|
|
||||||
import javax.swing.JDialog;
|
|
||||||
import javax.swing.JLabel;
|
|
||||||
import javax.swing.JPanel;
|
|
||||||
import org.apache.poi.poifs.property.Parent;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author Marco
|
|
||||||
*/
|
|
||||||
public class MyDialog extends JDialog{
|
|
||||||
PuntoCassa frmPuntoCassa;
|
|
||||||
JPnlPagamenti panel=new JPnlPagamenti();
|
|
||||||
public MyDialog(){
|
|
||||||
super();
|
|
||||||
// JPnlPagamenti panel=new JPnlPagamenti();
|
|
||||||
// //panel.add(new JLabel("Hello dialog"));
|
|
||||||
// this.getContentPane().add(panel);
|
|
||||||
}
|
|
||||||
|
|
||||||
public MyDialog(PuntoCassa PuntoC,String title,boolean modal){
|
|
||||||
super(PuntoC,title,modal);
|
|
||||||
frmPuntoCassa=PuntoC;
|
|
||||||
//this.setSize(300,200);
|
|
||||||
|
|
||||||
//panel.add(new JLabel("Hello dialog"));
|
|
||||||
this.getContentPane().add(panel);
|
|
||||||
//this.setVisible(true);
|
|
||||||
|
|
||||||
CaricaCombo("Select nome,id from tipi_pagamenti where id<>0 order by nome", "nome", "id", panel.jCmbCat);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
JButton btn=panel.jBtnAggiorna;
|
|
||||||
btn.addActionListener(new ActionListener(){
|
|
||||||
public void actionPerformed(ActionEvent e) {
|
|
||||||
ComboItem c = new ComboItem(null, null);
|
|
||||||
c = (ComboItem) panel.jCmbCat.getSelectedItem();
|
|
||||||
|
|
||||||
|
|
||||||
frmPuntoCassa.idModoPagamento=c.getKey();
|
|
||||||
frmPuntoCassa.ClickModoPagamento(c.getValue().toString());
|
|
||||||
// if (c.getKey()==0){frmPuntoCassa.ClickCarta();}
|
|
||||||
// if (c.getKey()==1){frmPuntoCassa.ClickContanti();}
|
|
||||||
// if (c.getKey()==2){frmPuntoCassa.ClickTicket();}
|
|
||||||
|
|
||||||
MyDialog.this.dispose();
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
JButton jBtnAnnulla=panel.jBtnAnnulla;
|
|
||||||
jBtnAnnulla.addActionListener(new ActionListener(){
|
|
||||||
public void actionPerformed(ActionEvent e) {
|
|
||||||
frmPuntoCassa.ClickCarta();
|
|
||||||
MyDialog.this.dispose();
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
public void AssegnaPagamento(){
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void CaricaCombo (String Query, String itemValue, String itemId, JComboBox cmb) {
|
|
||||||
try {
|
|
||||||
Connection dbConnection = DriverManager.getConnection(frmPuntoCassa.dbStringa, frmPuntoCassa.dbUsername, frmPuntoCassa.dbPassword);
|
|
||||||
Connection c = dbConnection;
|
|
||||||
Statement stmt = null;
|
|
||||||
cmb.removeAllItems();
|
|
||||||
stmt = c.createStatement();
|
|
||||||
ResultSet rs = stmt.executeQuery(Query);
|
|
||||||
int r = 0;
|
|
||||||
while (rs.next()) {
|
|
||||||
|
|
||||||
ComboItem row=new ComboItem(rs.getLong(itemId), rs.getString(itemValue)) ;
|
|
||||||
cmb.addItem(row);
|
|
||||||
|
|
||||||
r++;
|
|
||||||
|
|
||||||
}
|
|
||||||
rs.close();
|
|
||||||
stmt.close();
|
|
||||||
dbConnection.close();
|
|
||||||
|
|
||||||
} catch (SQLException e) {
|
|
||||||
System.err.println(e.getClass().getName() + ": " + e.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user