Compare commits
9 Commits
main
...
0002064-av
Author | SHA1 | Date | |
---|---|---|---|
4f8e168111 | |||
e9e31abf00 | |||
a6384a95d3 | |||
086dc95e49 | |||
f7f5a3975e | |||
27b6e934a1 | |||
88b560a8d5 | |||
7e37550e09 | |||
b9529e4f7e |
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,2 +1,4 @@
|
|||||||
/nbproject/
|
/nbproject/
|
||||||
/.idea/
|
/.idea/
|
||||||
|
dist
|
||||||
|
build
|
||||||
|
BIN
dist/Cassa.jar
vendored
BIN
dist/Cassa.jar
vendored
Binary file not shown.
32
dist/README.TXT
vendored
32
dist/README.TXT
vendored
@ -1,32 +0,0 @@
|
|||||||
========================
|
|
||||||
BUILD OUTPUT DESCRIPTION
|
|
||||||
========================
|
|
||||||
|
|
||||||
When you build an Java application project that has a main class, the IDE
|
|
||||||
automatically copies all of the JAR
|
|
||||||
files on the projects classpath to your projects dist/lib folder. The IDE
|
|
||||||
also adds each of the JAR files to the Class-Path element in the application
|
|
||||||
JAR files manifest file (MANIFEST.MF).
|
|
||||||
|
|
||||||
To run the project from the command line, go to the dist folder and
|
|
||||||
type the following:
|
|
||||||
|
|
||||||
java -jar "Cassa.jar"
|
|
||||||
|
|
||||||
To distribute this project, zip up the dist folder (including the lib folder)
|
|
||||||
and distribute the ZIP file.
|
|
||||||
|
|
||||||
Notes:
|
|
||||||
|
|
||||||
* If two JAR files on the project classpath have the same name, only the first
|
|
||||||
JAR file is copied to the lib folder.
|
|
||||||
* Only JAR files are copied to the lib folder.
|
|
||||||
If the classpath contains other types of files or folders, these files (folders)
|
|
||||||
are not copied.
|
|
||||||
* If a library on the projects classpath also has a Class-Path element
|
|
||||||
specified in the manifest,the content of the Class-Path element has to be on
|
|
||||||
the projects runtime path.
|
|
||||||
* To set a main class in a standard Java project, right-click the project node
|
|
||||||
in the Projects window and choose Properties. Then click Run and enter the
|
|
||||||
class name in the Main Class field. Alternatively, you can manually type the
|
|
||||||
class name in the manifest Main-Class element.
|
|
BIN
dist/lib/AbsoluteLayout.jar
vendored
BIN
dist/lib/AbsoluteLayout.jar
vendored
Binary file not shown.
BIN
dist/lib/avalon-framework-impl-4.2.0.jar
vendored
BIN
dist/lib/avalon-framework-impl-4.2.0.jar
vendored
Binary file not shown.
BIN
dist/lib/barbecue-1.5-beta1.jar
vendored
BIN
dist/lib/barbecue-1.5-beta1.jar
vendored
Binary file not shown.
BIN
dist/lib/barcode4j-2.0.jar
vendored
BIN
dist/lib/barcode4j-2.0.jar
vendored
Binary file not shown.
BIN
dist/lib/batik-anim-1.7.jar
vendored
BIN
dist/lib/batik-anim-1.7.jar
vendored
Binary file not shown.
BIN
dist/lib/batik-awt-util-1.7.jar
vendored
BIN
dist/lib/batik-awt-util-1.7.jar
vendored
Binary file not shown.
BIN
dist/lib/batik-bridge-1.7.jar
vendored
BIN
dist/lib/batik-bridge-1.7.jar
vendored
Binary file not shown.
BIN
dist/lib/batik-css-1.7.jar
vendored
BIN
dist/lib/batik-css-1.7.jar
vendored
Binary file not shown.
BIN
dist/lib/batik-dom-1.7.jar
vendored
BIN
dist/lib/batik-dom-1.7.jar
vendored
Binary file not shown.
BIN
dist/lib/batik-ext-1.7.jar
vendored
BIN
dist/lib/batik-ext-1.7.jar
vendored
Binary file not shown.
BIN
dist/lib/batik-gvt-1.7.jar
vendored
BIN
dist/lib/batik-gvt-1.7.jar
vendored
Binary file not shown.
BIN
dist/lib/batik-parser-1.7.jar
vendored
BIN
dist/lib/batik-parser-1.7.jar
vendored
Binary file not shown.
BIN
dist/lib/batik-script-1.7.jar
vendored
BIN
dist/lib/batik-script-1.7.jar
vendored
Binary file not shown.
BIN
dist/lib/batik-svg-dom-1.7.jar
vendored
BIN
dist/lib/batik-svg-dom-1.7.jar
vendored
Binary file not shown.
BIN
dist/lib/batik-util-1.7.jar
vendored
BIN
dist/lib/batik-util-1.7.jar
vendored
Binary file not shown.
BIN
dist/lib/batik-xml-1.7.jar
vendored
BIN
dist/lib/batik-xml-1.7.jar
vendored
Binary file not shown.
BIN
dist/lib/bcprov-jdk14-138.jar
vendored
BIN
dist/lib/bcprov-jdk14-138.jar
vendored
Binary file not shown.
BIN
dist/lib/beansbinding-1.2.1.jar
vendored
BIN
dist/lib/beansbinding-1.2.1.jar
vendored
Binary file not shown.
BIN
dist/lib/commons-beanutils-1.8.0.jar
vendored
BIN
dist/lib/commons-beanutils-1.8.0.jar
vendored
Binary file not shown.
BIN
dist/lib/commons-collections-3.2.1.jar
vendored
BIN
dist/lib/commons-collections-3.2.1.jar
vendored
Binary file not shown.
BIN
dist/lib/commons-digester-2.1.jar
vendored
BIN
dist/lib/commons-digester-2.1.jar
vendored
Binary file not shown.
BIN
dist/lib/commons-lang-2.5.jar
vendored
BIN
dist/lib/commons-lang-2.5.jar
vendored
Binary file not shown.
BIN
dist/lib/commons-lang3-3.1.jar
vendored
BIN
dist/lib/commons-lang3-3.1.jar
vendored
Binary file not shown.
BIN
dist/lib/commons-logging-1.1.1.jar
vendored
BIN
dist/lib/commons-logging-1.1.1.jar
vendored
Binary file not shown.
BIN
dist/lib/dynamicreports-adhoc-3.2.0-sources.jar
vendored
BIN
dist/lib/dynamicreports-adhoc-3.2.0-sources.jar
vendored
Binary file not shown.
BIN
dist/lib/dynamicreports-adhoc-3.2.0.jar
vendored
BIN
dist/lib/dynamicreports-adhoc-3.2.0.jar
vendored
Binary file not shown.
BIN
dist/lib/dynamicreports-core-3.2.0-javadoc.jar
vendored
BIN
dist/lib/dynamicreports-core-3.2.0-javadoc.jar
vendored
Binary file not shown.
BIN
dist/lib/dynamicreports-core-3.2.0-sources.jar
vendored
BIN
dist/lib/dynamicreports-core-3.2.0-sources.jar
vendored
Binary file not shown.
BIN
dist/lib/dynamicreports-core-3.2.0.jar
vendored
BIN
dist/lib/dynamicreports-core-3.2.0.jar
vendored
Binary file not shown.
BIN
dist/lib/dynamicreports-examples-3.2.0-sources.jar
vendored
BIN
dist/lib/dynamicreports-examples-3.2.0-sources.jar
vendored
Binary file not shown.
BIN
dist/lib/dynamicreports-examples-3.2.0.jar
vendored
BIN
dist/lib/dynamicreports-examples-3.2.0.jar
vendored
Binary file not shown.
Binary file not shown.
BIN
dist/lib/dynamicreports-googlecharts-3.2.0.jar
vendored
BIN
dist/lib/dynamicreports-googlecharts-3.2.0.jar
vendored
Binary file not shown.
BIN
dist/lib/hsqldb-1.8.0.10.jar
vendored
BIN
dist/lib/hsqldb-1.8.0.10.jar
vendored
Binary file not shown.
BIN
dist/lib/itext-2.1.7.js2.jar
vendored
BIN
dist/lib/itext-2.1.7.js2.jar
vendored
Binary file not shown.
BIN
dist/lib/jackson-annotations-2.1.4.jar
vendored
BIN
dist/lib/jackson-annotations-2.1.4.jar
vendored
Binary file not shown.
BIN
dist/lib/jackson-core-2.1.4.jar
vendored
BIN
dist/lib/jackson-core-2.1.4.jar
vendored
Binary file not shown.
BIN
dist/lib/jackson-databind-2.1.4.jar
vendored
BIN
dist/lib/jackson-databind-2.1.4.jar
vendored
Binary file not shown.
BIN
dist/lib/jasperreports-5.5.1.jar
vendored
BIN
dist/lib/jasperreports-5.5.1.jar
vendored
Binary file not shown.
BIN
dist/lib/jcommon-1.0.15.jar
vendored
BIN
dist/lib/jcommon-1.0.15.jar
vendored
Binary file not shown.
BIN
dist/lib/jdtcore-3.1.0.jar
vendored
BIN
dist/lib/jdtcore-3.1.0.jar
vendored
Binary file not shown.
BIN
dist/lib/jfreechart-1.0.12.jar
vendored
BIN
dist/lib/jfreechart-1.0.12.jar
vendored
Binary file not shown.
BIN
dist/lib/json-20080701.jar
vendored
BIN
dist/lib/json-20080701.jar
vendored
Binary file not shown.
BIN
dist/lib/jssc-2.8.0.jar
vendored
BIN
dist/lib/jssc-2.8.0.jar
vendored
Binary file not shown.
BIN
dist/lib/jxl-2.6.10.jar
vendored
BIN
dist/lib/jxl-2.6.10.jar
vendored
Binary file not shown.
BIN
dist/lib/log4j-1.2.14.jar
vendored
BIN
dist/lib/log4j-1.2.14.jar
vendored
Binary file not shown.
BIN
dist/lib/ojdbc6.jar
vendored
BIN
dist/lib/ojdbc6.jar
vendored
Binary file not shown.
BIN
dist/lib/poi-3.7.jar
vendored
BIN
dist/lib/poi-3.7.jar
vendored
Binary file not shown.
BIN
dist/lib/serializer-2.7.1.jar
vendored
BIN
dist/lib/serializer-2.7.1.jar
vendored
Binary file not shown.
BIN
dist/lib/servlet-api-2.4.jar
vendored
BIN
dist/lib/servlet-api-2.4.jar
vendored
Binary file not shown.
BIN
dist/lib/spring-beans-2.5.jar
vendored
BIN
dist/lib/spring-beans-2.5.jar
vendored
Binary file not shown.
BIN
dist/lib/spring-core-2.5.jar
vendored
BIN
dist/lib/spring-core-2.5.jar
vendored
Binary file not shown.
BIN
dist/lib/velocity-1.7.jar
vendored
BIN
dist/lib/velocity-1.7.jar
vendored
Binary file not shown.
BIN
dist/lib/xalan-2.7.1.jar
vendored
BIN
dist/lib/xalan-2.7.1.jar
vendored
Binary file not shown.
BIN
dist/lib/xml-apis-1.3.04.jar
vendored
BIN
dist/lib/xml-apis-1.3.04.jar
vendored
Binary file not shown.
BIN
dist/lib/xml-apis-ext-1.3.04.jar
vendored
BIN
dist/lib/xml-apis-ext-1.3.04.jar
vendored
Binary file not shown.
@ -150,6 +150,8 @@ javac.processorpath=\
|
|||||||
${javac.classpath}
|
${javac.classpath}
|
||||||
javac.source=1.7
|
javac.source=1.7
|
||||||
javac.target=1.7
|
javac.target=1.7
|
||||||
|
javac.source=17
|
||||||
|
javac.target=17
|
||||||
javac.test.classpath=\
|
javac.test.classpath=\
|
||||||
${javac.classpath}:\
|
${javac.classpath}:\
|
||||||
${build.classes.dir}
|
${build.classes.dir}
|
||||||
|
@ -7,8 +7,6 @@ import javax.smartcardio.Card;
|
|||||||
import javax.smartcardio.CardChannel;
|
import javax.smartcardio.CardChannel;
|
||||||
import javax.smartcardio.CardException;
|
import javax.smartcardio.CardException;
|
||||||
import javax.smartcardio.CardTerminal;
|
import javax.smartcardio.CardTerminal;
|
||||||
import javax.smartcardio.CommandAPDU;
|
|
||||||
import javax.smartcardio.ResponseAPDU;
|
|
||||||
import javax.smartcardio.TerminalFactory;
|
import javax.smartcardio.TerminalFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -6,7 +6,9 @@
|
|||||||
|
|
||||||
package puntocassa;
|
package puntocassa;
|
||||||
|
|
||||||
import org.bouncycastle.util.encoders.Base64;
|
import java.util.Base64;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -17,7 +19,7 @@ public class Encoding {
|
|||||||
public static String encodeString(String var) {
|
public static String encodeString(String var) {
|
||||||
String varEncode;
|
String varEncode;
|
||||||
|
|
||||||
varEncode = new String(Base64.encode(new StringBuffer(new String(Base64.encode(var.getBytes()))).reverse().toString().getBytes()));
|
varEncode = new String(Base64.getEncoder().encode(new StringBuffer(new String(Base64.getEncoder().encode(var.getBytes()))).reverse().toString().getBytes()));
|
||||||
|
|
||||||
return varEncode;
|
return varEncode;
|
||||||
}
|
}
|
||||||
@ -25,7 +27,7 @@ public class Encoding {
|
|||||||
public static String decodeString(String var) {
|
public static String decodeString(String var) {
|
||||||
String varDecode;
|
String varDecode;
|
||||||
|
|
||||||
varDecode = new String(Base64.decode(new StringBuffer(new String(Base64.decode(var.getBytes()))).reverse().toString().getBytes()));
|
varDecode = new String(Base64.getDecoder().decode(new StringBuffer(new String(Base64.getDecoder().decode(var.getBytes()))).reverse().toString().getBytes()));
|
||||||
|
|
||||||
return varDecode;
|
return varDecode;
|
||||||
}
|
}
|
||||||
|
@ -8,17 +8,10 @@ package puntocassa;
|
|||||||
import static net.sf.dynamicreports.report.builder.DynamicReports.*;
|
import static net.sf.dynamicreports.report.builder.DynamicReports.*;
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.Cursor;
|
import java.awt.Cursor;
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
|
||||||
import net.sf.dynamicreports.examples.complex.dynamicreport.DynamicColumn;
|
|
||||||
import net.sf.dynamicreports.jasper.builder.JasperReportBuilder;
|
import net.sf.dynamicreports.jasper.builder.JasperReportBuilder;
|
||||||
import net.sf.dynamicreports.jasper.constant.JasperProperty;
|
import net.sf.dynamicreports.jasper.constant.JasperProperty;
|
||||||
import net.sf.dynamicreports.report.builder.column.ColumnBuilder;
|
|
||||||
import net.sf.dynamicreports.report.builder.column.PercentageColumnBuilder;
|
|
||||||
import net.sf.dynamicreports.report.builder.column.TextColumnBuilder;
|
import net.sf.dynamicreports.report.builder.column.TextColumnBuilder;
|
||||||
import net.sf.dynamicreports.report.builder.group.GroupBuilders;
|
|
||||||
import net.sf.dynamicreports.report.builder.style.ReportStyleBuilder;
|
|
||||||
import net.sf.dynamicreports.report.builder.style.StyleBuilder;
|
import net.sf.dynamicreports.report.builder.style.StyleBuilder;
|
||||||
import net.sf.dynamicreports.report.builder.subtotal.AggregationSubtotalBuilder;
|
import net.sf.dynamicreports.report.builder.subtotal.AggregationSubtotalBuilder;
|
||||||
import net.sf.dynamicreports.report.constant.HorizontalAlignment;
|
import net.sf.dynamicreports.report.constant.HorizontalAlignment;
|
||||||
@ -71,7 +64,7 @@ public class JInternalReport extends javax.swing.JInternalFrame {
|
|||||||
TextColumnBuilder<Integer> integerColumn = col.column(Col[i].replace("_", " "), Col[i], type.integerType());
|
TextColumnBuilder<Integer> integerColumn = col.column(Col[i].replace("_", " "), Col[i], type.integerType());
|
||||||
|
|
||||||
columns.add(integerColumn);
|
columns.add(integerColumn);
|
||||||
if (Col[i].equalsIgnoreCase(MyA.ReportColonnaGroupBy)){
|
if (Col[i].equalsIgnoreCase(MyA.reportColonnaGroupBy)){
|
||||||
itemPosizione=integerColumn;
|
itemPosizione=integerColumn;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -86,7 +79,7 @@ public class JInternalReport extends javax.swing.JInternalFrame {
|
|||||||
floatColumn.setPattern("#,##0.00");
|
floatColumn.setPattern("#,##0.00");
|
||||||
columns.add(floatColumn);
|
columns.add(floatColumn);
|
||||||
|
|
||||||
if (Col[i].equalsIgnoreCase(MyA.ReportColonnaSomma)){
|
if (Col[i].equalsIgnoreCase(MyA.reportColonnaSomma)){
|
||||||
itemColumn=floatColumn;
|
itemColumn=floatColumn;
|
||||||
}
|
}
|
||||||
ColonnaPrezzi=floatColumn;
|
ColonnaPrezzi=floatColumn;
|
||||||
@ -134,10 +127,10 @@ public class JInternalReport extends javax.swing.JInternalFrame {
|
|||||||
for (int i = 0; i < columns.size(); i++) {
|
for (int i = 0; i < columns.size(); i++) {
|
||||||
columns.get(i).setStretchWithOverflow(true);
|
columns.get(i).setStretchWithOverflow(true);
|
||||||
columns.get(i).addProperty(JasperProperty.PRINT_KEEP_FULL_TEXT, "true");
|
columns.get(i).addProperty(JasperProperty.PRINT_KEEP_FULL_TEXT, "true");
|
||||||
Integer Pos=MyA.ElencoColonneReport.indexOf(";" + i + "|");
|
Integer Pos=MyA.elencoColonneReport.indexOf(";" + i + "|");
|
||||||
if (Pos>=0){
|
if (Pos>=0){
|
||||||
Integer PosF=MyA.ElencoColonneReport.indexOf(";",Pos+1);
|
Integer PosF=MyA.elencoColonneReport.indexOf(";",Pos+1);
|
||||||
String T=MyA.ElencoColonneReport.substring(Pos, PosF);
|
String T=MyA.elencoColonneReport.substring(Pos, PosF);
|
||||||
String E[]=T.split("\\|");
|
String E[]=T.split("\\|");
|
||||||
columns.get(i).setFixedWidth(Integer.parseInt(E[1]));
|
columns.get(i).setFixedWidth(Integer.parseInt(E[1]));
|
||||||
}
|
}
|
||||||
@ -146,12 +139,12 @@ public class JInternalReport extends javax.swing.JInternalFrame {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// if (MyA.ReportColonnaGroupBy.length()>0){
|
// if (MyA.reportColonnaGroupBy.length()>0){
|
||||||
// myReport.groupBy(itemPosizione);
|
// myReport.groupBy(itemPosizione);
|
||||||
// myReport.subtotalsAtSummary(sbt.sum(itemColumn));
|
// myReport.subtotalsAtSummary(sbt.sum(itemColumn));
|
||||||
// //myReport.subtotalsAtFirstGroupFooter(sbt.sum(itemPosizione),sbt.sum(itemColumn));
|
// //myReport.subtotalsAtFirstGroupFooter(sbt.sum(itemPosizione),sbt.sum(itemColumn));
|
||||||
// }
|
// }
|
||||||
MyA.ReportColonnaGroupBy="";MyA.ElencoColonneReport="";
|
MyA.reportColonnaGroupBy="";MyA.elencoColonneReport="";
|
||||||
JasperPrint reportPrint = myReport.toJasperPrint();
|
JasperPrint reportPrint = myReport.toJasperPrint();
|
||||||
JasperViewer reportViewer = new JasperViewer(
|
JasperViewer reportViewer = new JasperViewer(
|
||||||
DefaultJasperReportsContext.getInstance(),
|
DefaultJasperReportsContext.getInstance(),
|
||||||
|
@ -1,164 +1,128 @@
|
|||||||
package puntocassa;
|
package puntocassa;
|
||||||
|
|
||||||
|
|
||||||
import SmartCard.ISO7816Response;
|
import SmartCard.ISO7816Response;
|
||||||
import SmartCard.SmartCard;
|
import SmartCard.SmartCard;
|
||||||
import SmartCard.StringUtil;
|
import SmartCard.StringUtil;
|
||||||
import java.sql.Connection;
|
|
||||||
import java.sql.DriverManager;
|
|
||||||
import java.sql.ResultSet;
|
|
||||||
import java.sql.SQLException;
|
|
||||||
import java.sql.Statement;
|
|
||||||
import java.text.DecimalFormat;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Properties;
|
|
||||||
import javax.smartcardio.CardException;
|
import javax.smartcardio.CardException;
|
||||||
import javax.smartcardio.CommandAPDU;
|
import javax.smartcardio.CommandAPDU;
|
||||||
import javax.smartcardio.ResponseAPDU;
|
import javax.smartcardio.ResponseAPDU;
|
||||||
import javax.swing.JComboBox;
|
|
||||||
import javax.swing.JOptionPane;
|
import javax.swing.JOptionPane;
|
||||||
|
import puntocassa.utils.Utils;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* To change this license header, choose License Headers in Project Properties.
|
* To change this license header, choose License Headers in Project Properties.
|
||||||
* To change this template file, choose Tools | Templates
|
* To change this template file, choose Tools | Templates
|
||||||
* and open the template in the editor.
|
* and open the template in the editor.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Marco
|
* @author Marco
|
||||||
*/
|
*/
|
||||||
public class MyApplication {
|
public class MyApplication {
|
||||||
|
|
||||||
public static String path = "";// System.getProperty("user.dir") + "/db/MyFactoryDB.sqlite";
|
public static String path = "";// System.getProperty("user.dir") + "/db/MyFactoryDB.sqlite";
|
||||||
public static String ElencoRigheDivisori="";
|
//public static String elencoRigheDivisori = "";
|
||||||
public static String ElencoColonneFloat="";
|
//public static String elencoColonneFloat = "";
|
||||||
public static String ElencoColonneReport="";
|
public static String elencoColonneReport = "";
|
||||||
public static String ReportColonnaGroupBy="";
|
public static String reportColonnaGroupBy = "";
|
||||||
public static String ReportColonnaSomma="";
|
public static String reportColonnaSomma = "";
|
||||||
public static SmartCard SC = new SmartCard();
|
public static SmartCard smartCard = new SmartCard();
|
||||||
public static String idTesseraA = "";
|
public static String idTesseraA = "";
|
||||||
public static String UltimoTxt=" ";
|
public static String ultimoTxt = " ";
|
||||||
public static Boolean TastieraVideo=true;
|
public static Boolean tastieraVideo = true;
|
||||||
public static Boolean UnaVolta=false;
|
public static Boolean unaVolta = false;
|
||||||
|
|
||||||
public boolean isNumeric(String s) {
|
|
||||||
return s.matches("[-+]?\\d*\\.?\\d+");
|
|
||||||
}
|
|
||||||
public String NumericMonth(String Month) {
|
|
||||||
String num="";
|
|
||||||
switch (Month) {
|
|
||||||
case "Jan":
|
|
||||||
num="01";
|
|
||||||
break;
|
|
||||||
case "Feb":
|
|
||||||
num="02";
|
|
||||||
break;
|
|
||||||
case "Mar":
|
|
||||||
num="03";
|
|
||||||
break;
|
|
||||||
case "Apr":
|
|
||||||
num="04";
|
|
||||||
break;
|
|
||||||
case "May":
|
|
||||||
num="05";
|
|
||||||
break;
|
|
||||||
case "Jun":
|
|
||||||
num="06";
|
|
||||||
break;
|
|
||||||
case "Jul":
|
|
||||||
num="07";
|
|
||||||
break;
|
|
||||||
case "Aug":
|
|
||||||
num="08";
|
|
||||||
break;
|
|
||||||
case "Sep":
|
|
||||||
num="09";
|
|
||||||
break;
|
|
||||||
case "Oct":
|
|
||||||
num="10";
|
|
||||||
break;
|
|
||||||
case "Nov":
|
|
||||||
num="11";
|
|
||||||
break;
|
|
||||||
case "Dec":
|
|
||||||
num="12";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return num;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String MySelect(PuntoCassa frmA, String Query,String Campo) {
|
|
||||||
|
|
||||||
|
|
||||||
|
/*public String mySelect(PuntoCassa frmA, String query, String campo) {
|
||||||
String res = "";
|
String res = "";
|
||||||
try {
|
try {
|
||||||
Connection dbConnection = DriverManager.getConnection(frmA.dbStringa, frmA.dbUsername, frmA.dbPassword);
|
Connection dbConnection = DriverManager.getConnection(frmA.dbStringa, frmA.dbUsername, frmA.dbPassword);
|
||||||
Statement st = dbConnection.createStatement();
|
Statement st = dbConnection.createStatement();
|
||||||
ResultSet rs = st.executeQuery(Query);
|
ResultSet rs = st.executeQuery(query);
|
||||||
while (rs.next()) {
|
while (rs.next()) {
|
||||||
|
|
||||||
res = rs.getString(Campo);
|
res = rs.getString(campo);
|
||||||
}
|
}
|
||||||
rs.close();
|
rs.close();
|
||||||
st.close();
|
st.close();
|
||||||
dbConnection.close();
|
dbConnection.close();
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
JOptionPane.showMessageDialog(frmA, "Errore MySelect ['" + e.getMessage() + " " + Query + "']");
|
JOptionPane.showMessageDialog(frmA, "Errore MySelect ['" + e.getMessage() + " " + query + "']");
|
||||||
|
|
||||||
}
|
}
|
||||||
if(res==null){res="";}
|
if (res == null) {
|
||||||
return res;
|
res = "";
|
||||||
}
|
}
|
||||||
public String ExportCSV(Object[][] data, String[] Cols,String[] ColType,int ColInizio) {
|
return res;
|
||||||
|
}*/
|
||||||
|
|
||||||
|
/*public String exportCSV(Object[][] data, String[] cols, String[] colType, int colInizio) {
|
||||||
StringBuilder s = new StringBuilder("");
|
StringBuilder s = new StringBuilder("");
|
||||||
DecimalFormat df = new DecimalFormat("#0.00");
|
DecimalFormat df = new DecimalFormat("#0.00");
|
||||||
for (int i = ColInizio; i < Cols.length; i++) {
|
for (int i = colInizio; i < cols.length; i++) {
|
||||||
s.append(Cols[i] + ";");
|
s.append(cols[i]).append(";");
|
||||||
}
|
}
|
||||||
s.append("\r");
|
s.append("\r");
|
||||||
for (int i = 0; i < data.length; i++) {
|
for (Object[] data1 : data) {
|
||||||
for (int c = ColInizio; c < Cols.length; c++) {
|
for (int c = colInizio; c < cols.length; c++) {
|
||||||
if (data[i][c] == null) {
|
if (data1[c] == null) {
|
||||||
s.append(";");
|
s.append(";");
|
||||||
} else {
|
} else {
|
||||||
|
String field = data1[c].toString().replace("\r", " ");
|
||||||
|
if (colType[c].equalsIgnoreCase("integer")) {
|
||||||
|
Integer in = Integer.valueOf(field);
|
||||||
|
if (in == 0) {
|
||||||
|
field = "";
|
||||||
|
} else {
|
||||||
|
field = "" + in;
|
||||||
|
}
|
||||||
|
|
||||||
String field=data[i][c].toString().replace("\r", " ");
|
} else if (colType[c].equalsIgnoreCase("float")) {
|
||||||
|
Float in = Float.valueOf(field);
|
||||||
|
if (in == 0) {
|
||||||
|
field = "";
|
||||||
|
} else {
|
||||||
|
field = "" + df.format(in);
|
||||||
|
}
|
||||||
|
|
||||||
if (ColType[c].toString().equalsIgnoreCase("integer")){
|
} else if (colType[c].equalsIgnoreCase("boolean")) {
|
||||||
Integer in=Integer.parseInt(field);
|
Boolean in = Boolean.valueOf(field);
|
||||||
if (in==0){field="";}else{field="" + in;}
|
if (in == true) {
|
||||||
|
field = "Si";
|
||||||
}else if (ColType[c].toString().equalsIgnoreCase("float")){
|
} else {
|
||||||
Float in=Float.parseFloat(field);
|
field = "No";
|
||||||
if (in==0){field="";}else{field="" + df.format(in);}
|
}
|
||||||
|
|
||||||
} else if (ColType[c].toString().equalsIgnoreCase("boolean")){
|
|
||||||
Boolean in=Boolean.parseBoolean(field);
|
|
||||||
if (in==true){field="Si";}else{field="No";}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
field = field.replace("\n", " ");
|
field = field.replace("\n", " ");
|
||||||
field = field.replace(";", ",");
|
field = field.replace(";", ",");
|
||||||
s.append(field + ";");
|
s.append(field).append(";");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
s.append("\r");
|
s.append("\r");
|
||||||
}
|
}
|
||||||
|
|
||||||
return s.toString();
|
return s.toString();
|
||||||
}
|
}*/
|
||||||
public static String sendAPDU(PuntoCassa frmATT, String Sdata,String Scla,String Sins,String Sp1,String Sp2,String Sp3,String Sle) throws CardException{
|
|
||||||
CommandAPDU apdu=null;
|
|
||||||
|
|
||||||
if(!SC.isConnected()){
|
public static String sendAPDU(PuntoCassa frmATT, String sData, String sCla, String sIns,
|
||||||
|
String sP1, String sP2, String sP3, String sLe) throws CardException {
|
||||||
|
CommandAPDU apdu;
|
||||||
|
|
||||||
|
if (!smartCard.isConnected()) {
|
||||||
JOptionPane.showMessageDialog(frmATT, new Exception("Please connect first"), "Exception", JOptionPane.ERROR_MESSAGE);
|
JOptionPane.showMessageDialog(frmATT, new Exception("Please connect first"), "Exception", JOptionPane.ERROR_MESSAGE);
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
Integer cla = StringUtil.parseHex(Scla);
|
Integer cla = StringUtil.parseHex(sCla);
|
||||||
Integer ins = StringUtil.parseHex(Sins);
|
Integer ins = StringUtil.parseHex(sIns);
|
||||||
Integer p1 = StringUtil.parseHex(Sp1);
|
Integer p1 = StringUtil.parseHex(sP1);
|
||||||
Integer p2 = StringUtil.parseHex(Sp2);
|
Integer p2 = StringUtil.parseHex(sP2);
|
||||||
Integer p3 = StringUtil.parseHex(Sp3);
|
Integer p3 = StringUtil.parseHex(sP3);
|
||||||
Integer le = StringUtil.parseHex(Sle);
|
Integer le = StringUtil.parseHex(sLe);
|
||||||
|
|
||||||
if (cla == null) {
|
if (cla == null) {
|
||||||
JOptionPane.showMessageDialog(frmATT, new Exception("Invalid value for CLASS"), "Exception", JOptionPane.ERROR_MESSAGE);
|
JOptionPane.showMessageDialog(frmATT, new Exception("Invalid value for CLASS"), "Exception", JOptionPane.ERROR_MESSAGE);
|
||||||
@ -174,118 +138,66 @@ public class MyApplication {
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
byte[] data = StringUtil.stringToByteArr(Sdata);
|
byte[] data = StringUtil.stringToByteArr(sData);
|
||||||
|
|
||||||
if(Sdata.length()==0 && le==null)
|
if (sData.length() == 0 && le == null) {
|
||||||
apdu = new CommandAPDU(cla, ins, p1, p2);
|
apdu = new CommandAPDU(cla, ins, p1, p2);
|
||||||
else if(p3 == null && le == null)
|
} else if (p3 == null && le == null) {
|
||||||
apdu = new CommandAPDU(cla, ins, p1, p2, data);
|
apdu = new CommandAPDU(cla, ins, p1, p2, data);
|
||||||
else if(le == null)
|
} else if (le == null) {
|
||||||
apdu = new CommandAPDU(cla, ins, p1, p2, data, 0, p3);
|
apdu = new CommandAPDU(cla, ins, p1, p2, data, 0, p3);
|
||||||
else{
|
} else {
|
||||||
if(p3==null) p3 = data.length;
|
if (p3 == null) {
|
||||||
|
p3 = data.length;
|
||||||
|
}
|
||||||
apdu = new CommandAPDU(cla, ins, p1, p2, data, 0, p3, le);
|
apdu = new CommandAPDU(cla, ins, p1, p2, data, 0, p3, le);
|
||||||
}
|
}
|
||||||
|
|
||||||
ResponseAPDU res = SC.getChannel().transmit(apdu);
|
ResponseAPDU res = smartCard.getChannel().transmit(apdu);
|
||||||
|
|
||||||
String sw = StringUtil.byteToHex(res.getSW1()) + " " + StringUtil.byteToHex(res.getSW2());
|
String sw = StringUtil.byteToHex(res.getSW1()) + " " + StringUtil.byteToHex(res.getSW2());
|
||||||
ISO7816Response isoResp = new ISO7816Response(res.getSW1(), res.getSW2());
|
ISO7816Response isoResp = new ISO7816Response(res.getSW1(), res.getSW2());
|
||||||
String status = isoResp.toString();
|
String status = isoResp.toString();
|
||||||
|
|
||||||
/*if(isoResp.isGood())
|
|
||||||
lbLastStatus.setForeground(Color.GREEN);
|
|
||||||
else
|
|
||||||
lbLastStatus.setForeground(Color.RED);
|
|
||||||
lbLastStatus.setText(status);*/
|
|
||||||
|
|
||||||
/*String dataoutHex = StringUtil.byteArrToString(res.getData()," ");
|
String CF = "", DS;
|
||||||
String dataoutStr = StringUtil.byteArrToPrintableString(res.getData());
|
if (sLe.length() > 0 && Integer.parseInt(sLe) == 140) {
|
||||||
String fullResHex = StringUtil.byteArrToString(res.getBytes()," ");*/
|
String dati = StringUtil.byteArrToPrintableString(res.getBytes());
|
||||||
String CF="",DS="";
|
if (dati.length() >= 47) {
|
||||||
//jtxtDati.setText(StringUtil.hexDump(res.getBytes(), 16));
|
idTesseraA = dati.substring(12, 26).replace(".", "");
|
||||||
if (Sle.length()>0 && Integer.parseInt(Sle)==140 ) {
|
CF = dati.substring(31, 47);
|
||||||
String Dati = StringUtil.byteArrToPrintableString(res.getBytes());
|
DS = Utils.trovaScadenza(dati);//data scadenza
|
||||||
if (Dati.length() >= 47) {
|
|
||||||
// jtxtDati.append(Dati+ "\n");
|
|
||||||
// StringBuilder S = new StringBuilder();
|
|
||||||
// S.append(Dati.substring(12, 26) + "\n");
|
|
||||||
idTesseraA = Dati.substring(12, 26).replace(".", "");
|
|
||||||
CF = Dati.substring(31, 47);
|
|
||||||
DS = TrovaScadenza(Dati);//Dati.substring(188, 196);//data scadenza
|
|
||||||
CF = CF + "|" + DS;
|
CF = CF + "|" + DS;
|
||||||
// S.append(Dati.substring(31, 47) + "\n");//CF
|
|
||||||
// jtxtCF.setText(Dati.substring(31, 47));
|
|
||||||
// S.append(Dati.substring(47, 74) + "\n");
|
|
||||||
// S.append(Dati.substring(75, 83) + "\n");
|
|
||||||
// S.append(Dati.substring(99, 133) + "\n");
|
|
||||||
// jtxtDati.append(S.toString());
|
|
||||||
}
|
}
|
||||||
return CF;
|
return CF;
|
||||||
}
|
}
|
||||||
if (Sle.length()>0 && Integer.parseInt(Sle)==14) {
|
if (sLe.length() > 0 && Integer.parseInt(sLe) == 14) {
|
||||||
String Dati = StringUtil.byteArrToPrintableString(res.getBytes());
|
String dati = StringUtil.byteArrToPrintableString(res.getBytes());
|
||||||
// jtxtDati.append(Dati+ "\n");
|
StringBuilder s = new StringBuilder();
|
||||||
StringBuilder S = new StringBuilder();
|
if (dati.length() >= 16) {
|
||||||
if (Dati.length() >= 16) {
|
s.append(dati.substring(4, 16)).append("\n");
|
||||||
S.append(Dati.substring(4, 16) + "\n");
|
idTesseraA = idTesseraA + dati.substring(4, 13) + Utils.luhn(idTesseraA + dati.substring(4, 13));
|
||||||
idTesseraA = idTesseraA + Dati.substring(4, 13) + Luhn(idTesseraA + Dati.substring(4, 13));
|
|
||||||
}
|
}
|
||||||
// jtxtIDT.setText(IdTesseraA);
|
|
||||||
// jtxtDati.append(S.toString());
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return idTesseraA;
|
return idTesseraA;
|
||||||
|
|
||||||
}
|
|
||||||
private static String TrovaScadenza(String Testo) {
|
|
||||||
String Scadenza = "";
|
|
||||||
String Tag = "#";
|
|
||||||
Integer PI = Testo.lastIndexOf(Tag);
|
|
||||||
if (PI > 0) {
|
|
||||||
Scadenza=Testo.substring(PI-9, PI-1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return Scadenza;
|
|
||||||
}
|
|
||||||
public String AggiustaDateTessera(String data){
|
/*public String aggiustaDateTessera(String data) {
|
||||||
String Data="";
|
String newData = "";
|
||||||
if (data.length() >= 8) {
|
if (data.length() >= 8) {
|
||||||
String m="",d="",a="";
|
String m, d, a;
|
||||||
m = data.substring(4, 6);
|
m = data.substring(4, 6);
|
||||||
d = data.substring(6, 8);
|
d = data.substring(6, 8);
|
||||||
a = data.substring(0, 4);
|
a = data.substring(0, 4);
|
||||||
Data= d + "/" + m + "/" + a;
|
newData = d + "/" + m + "/" + a;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return Data;
|
return newData;
|
||||||
|
|
||||||
}
|
}*/
|
||||||
static String Luhn(String Dati){
|
|
||||||
|
|
||||||
|
|
||||||
Integer s=0;
|
|
||||||
for (Integer i=0;i<Dati.length(); i++){
|
|
||||||
Integer d= Integer.parseInt(Dati.substring(i, i+1));
|
|
||||||
if (i % 2 ==0 ){
|
|
||||||
Integer doppio=d*2;
|
|
||||||
if (doppio>=10){doppio=1+(doppio%10);}
|
|
||||||
s=s+doppio;
|
|
||||||
}else{
|
|
||||||
s=s+d;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Integer resto=s%10;
|
|
||||||
if (resto == 0) {
|
|
||||||
return "0";
|
|
||||||
} else {
|
|
||||||
Integer ris=10 - resto;
|
|
||||||
return "" + ris;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -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());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -48,7 +48,7 @@
|
|||||||
</Group>
|
</Group>
|
||||||
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
||||||
<Component id="jBtnCanc" alignment="0" max="32767" attributes="0"/>
|
<Component id="jBtnCanc" alignment="0" max="32767" attributes="0"/>
|
||||||
<Component id="jBtnInvio" alignment="0" pref="90" max="32767" attributes="0"/>
|
<Component id="jBtnInvio" alignment="0" max="32767" attributes="0"/>
|
||||||
<Component id="jBtnShift" alignment="0" pref="0" max="32767" attributes="0"/>
|
<Component id="jBtnShift" alignment="0" pref="0" max="32767" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
||||||
|
@ -3,10 +3,8 @@
|
|||||||
* To change this template file, choose Tools | Templates
|
* To change this template file, choose Tools | Templates
|
||||||
* and open the template in the editor.
|
* and open the template in the editor.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package puntocassa;
|
package puntocassa;
|
||||||
|
|
||||||
import java.awt.Desktop;
|
|
||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
import java.awt.event.ActionListener;
|
import java.awt.event.ActionListener;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@ -21,22 +19,23 @@ import javax.swing.JTextField;
|
|||||||
* @author Marco
|
* @author Marco
|
||||||
*/
|
*/
|
||||||
public class MyKeyBoard extends javax.swing.JFrame {
|
public class MyKeyBoard extends javax.swing.JFrame {
|
||||||
|
|
||||||
public JTextField txt;
|
public JTextField txt;
|
||||||
public JFrame Parent;
|
public JFrame parent;
|
||||||
Process proc;
|
Boolean formCerca = false;
|
||||||
Boolean FormCerca=false;
|
|
||||||
/**
|
/**
|
||||||
* Creates new form MyKeyBoard
|
* Creates new form MyKeyBoard
|
||||||
*/
|
*/
|
||||||
public MyKeyBoard(JFrame parent,Boolean Ricerca) {
|
public MyKeyBoard(JFrame parent, Boolean ricerca) {
|
||||||
initComponents();
|
initComponents();
|
||||||
CreaPulsanti();
|
creaPulsanti();
|
||||||
Parent=parent;
|
this.parent = parent;
|
||||||
FormCerca=Ricerca;
|
formCerca = ricerca;
|
||||||
Parent.setEnabled(false);
|
this.parent.setEnabled(false);
|
||||||
String startDir = System.getProperty("user.dir");
|
String startDir = System.getProperty("user.dir");
|
||||||
File IconaApp = new File(startDir + "/risorse/logo.png");
|
File iconaApp = new File(startDir + "/risorse/logo.png");
|
||||||
if (IconaApp.exists()) {
|
if (iconaApp.exists()) {
|
||||||
|
|
||||||
ImageIcon icon = new ImageIcon(startDir + "/risorse/logo.png");
|
ImageIcon icon = new ImageIcon(startDir + "/risorse/logo.png");
|
||||||
this.setIconImage(icon.getImage());
|
this.setIconImage(icon.getImage());
|
||||||
@ -44,20 +43,21 @@ public class MyKeyBoard extends javax.swing.JFrame {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CreaPulsanti(){
|
private void creaPulsanti() {
|
||||||
String [] Tasti={"1","2","3","4","5","6","7","8","9","0","/","ì"};
|
String[] tasti = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "/", "ì"};
|
||||||
Crea(Tasti,jPanel1);
|
crea(tasti, jPanel1);
|
||||||
String [] Tasti2={"q","w","e","r","t","y","u","i","o","p","è","é"};
|
String[] tasti2 = {"q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "è", "é"};
|
||||||
Crea(Tasti2,jPanel2);
|
crea(tasti2, jPanel2);
|
||||||
String [] Tasti3={"a","s","d","f","g","h","j","k","l","ò","à","ù"};
|
String[] tasti3 = {"a", "s", "d", "f", "g", "h", "j", "k", "l", "ò", "à", "ù"};
|
||||||
Crea(Tasti3,jPanel3);
|
crea(tasti3, jPanel3);
|
||||||
String [] Tasti4={"z","x","c","v","b","n","m",",",".",":","-","'"};
|
String[] tasti4 = {"z", "x", "c", "v", "b", "n", "m", ",", ".", ":", "-", "'"};
|
||||||
Crea(Tasti4,jPanel4);
|
crea(tasti4, jPanel4);
|
||||||
}
|
}
|
||||||
private void Crea(String [] Tasti,JPanel pnl){
|
|
||||||
|
private void crea(String[] tasti, JPanel pnl) {
|
||||||
ActionListener listenerBottoni = new ListenerPulsanti();
|
ActionListener listenerBottoni = new ListenerPulsanti();
|
||||||
for (int i=0;i<Tasti.length;i++){
|
for (int i = 0; i < tasti.length; i++) {
|
||||||
JButton btn=new JButton(Tasti[i]);
|
JButton btn = new JButton(tasti[i]);
|
||||||
btn.setFont(new java.awt.Font("Tahoma", 1, 12));
|
btn.setFont(new java.awt.Font("Tahoma", 1, 12));
|
||||||
pnl.add(btn);
|
pnl.add(btn);
|
||||||
btn.addActionListener(listenerBottoni);
|
btn.addActionListener(listenerBottoni);
|
||||||
@ -65,6 +65,7 @@ public class MyKeyBoard extends javax.swing.JFrame {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is called from within the constructor to initialize the form.
|
* 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
|
* WARNING: Do NOT modify this code. The content of this method is always
|
||||||
@ -175,33 +176,25 @@ public class MyKeyBoard extends javax.swing.JFrame {
|
|||||||
private void jBtnCancActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnCancActionPerformed
|
private void jBtnCancActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnCancActionPerformed
|
||||||
// TODO add your handling code here:
|
// TODO add your handling code here:
|
||||||
try {
|
try {
|
||||||
// Desktop desktop = null;
|
|
||||||
// if (Desktop.isDesktopSupported()) {
|
|
||||||
// desktop = Desktop.getDesktop();
|
|
||||||
// }
|
|
||||||
// String sysroot = System.getenv("SystemRoot");
|
|
||||||
// desktop.open(new File(sysroot + "/system32/osk.exe"));
|
|
||||||
// proc = Runtime.getRuntime().exec( "cmd /c c:/windows/system32/osk.exe");
|
|
||||||
// proc =Runtime.getRuntime().exec("osk");
|
|
||||||
int d = txt.getText().length();
|
int d = txt.getText().length();
|
||||||
if (d > 0) {
|
if (d > 0) {
|
||||||
txt.setText(txt.getText().substring(0, d - 1));
|
txt.setText(txt.getText().substring(0, d - 1));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
}catch(Exception e){}
|
}
|
||||||
}//GEN-LAST:event_jBtnCancActionPerformed
|
}//GEN-LAST:event_jBtnCancActionPerformed
|
||||||
|
|
||||||
private void jBtnInvioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnInvioActionPerformed
|
private void jBtnInvioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnInvioActionPerformed
|
||||||
|
|
||||||
if (FormCerca) {
|
if (formCerca) {
|
||||||
frmCerca frm;
|
FrmCerca frm;
|
||||||
frm = (frmCerca) Parent;
|
frm = (FrmCerca) parent;
|
||||||
frm.Cerca();
|
frm.Cerca();
|
||||||
}
|
}
|
||||||
|
|
||||||
Parent.setEnabled(true);
|
parent.setEnabled(true);
|
||||||
this.dispose();
|
this.dispose();
|
||||||
}//GEN-LAST:event_jBtnInvioActionPerformed
|
}//GEN-LAST:event_jBtnInvioActionPerformed
|
||||||
|
|
||||||
@ -212,36 +205,23 @@ public class MyKeyBoard extends javax.swing.JFrame {
|
|||||||
|
|
||||||
private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing
|
private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing
|
||||||
// TODO add your handling code here:
|
// TODO add your handling code here:
|
||||||
Parent.setEnabled(true);
|
parent.setEnabled(true);
|
||||||
|
|
||||||
this.dispose();
|
this.dispose();
|
||||||
}//GEN-LAST:event_formWindowClosing
|
}//GEN-LAST:event_formWindowClosing
|
||||||
private class ListenerPulsanti implements ActionListener
|
private class ListenerPulsanti implements ActionListener {
|
||||||
{
|
|
||||||
public void actionPerformed(ActionEvent ev)
|
public void actionPerformed(ActionEvent ev) {
|
||||||
{
|
|
||||||
JButton pressed = (JButton) ev.getSource();
|
JButton pressed = (JButton) ev.getSource();
|
||||||
String c = pressed.getText();
|
String c = pressed.getText();
|
||||||
if(jBtnShift.isSelected()){c=c.toUpperCase();}
|
if (jBtnShift.isSelected()) {
|
||||||
|
c = c.toUpperCase();
|
||||||
|
}
|
||||||
txt.setText(txt.getText() + c);
|
txt.setText(txt.getText() + c);
|
||||||
/*if (c!="Canc" && c!="Maiuscolo" && c!="Spazio")
|
|
||||||
{
|
|
||||||
mainFrame.inserisciCarattere(c);
|
|
||||||
}
|
|
||||||
else if (c=="Canc")
|
|
||||||
{
|
|
||||||
mainFrame.inserisciCanc(c);
|
|
||||||
}
|
|
||||||
else if(c=="Maiuscolo")
|
|
||||||
{
|
|
||||||
mainFrame.inserisciMaiuscolo(c);
|
|
||||||
}
|
|
||||||
else if(c=="Spazio")
|
|
||||||
{
|
|
||||||
mainFrame.inserisciCarattere(" ");
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param args the command line arguments
|
* @param args the command line arguments
|
||||||
*/
|
*/
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
package puntocassa;
|
package puntocassa;
|
||||||
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Vector;
|
|
||||||
import javax.swing.table.AbstractTableModel;
|
import javax.swing.table.AbstractTableModel;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -10,12 +7,12 @@ import javax.swing.table.AbstractTableModel;
|
|||||||
* To change this template file, choose Tools | Templates
|
* To change this template file, choose Tools | Templates
|
||||||
* and open the template in the editor.
|
* and open the template in the editor.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Marco
|
* @author Marco
|
||||||
*/
|
*/
|
||||||
public class MyTableModel extends AbstractTableModel {
|
public class MyTableModel extends AbstractTableModel {
|
||||||
|
|
||||||
private String[] columnNames;
|
private String[] columnNames;
|
||||||
private Object[][] data;
|
private Object[][] data;
|
||||||
private Boolean editable = false;
|
private Boolean editable = false;
|
||||||
@ -24,19 +21,19 @@ import javax.swing.table.AbstractTableModel;
|
|||||||
private int[] colBoolean;
|
private int[] colBoolean;
|
||||||
private Object[] row;
|
private Object[] row;
|
||||||
|
|
||||||
public Double Somma(int col) {
|
public Double somma(int col) {
|
||||||
Double tot = 0.0;
|
Double tot = 0.0;
|
||||||
if (data != null) {
|
if (data != null) {
|
||||||
for (int i = 0; i < data.length; i++) {
|
for (int i = 0; i < data.length; i++) {
|
||||||
if (data[i][col] != null) {
|
if (data[i][col] != null) {
|
||||||
tot = tot + Double.parseDouble(data[i][col].toString());
|
tot = tot + Double.valueOf(data[i][col].toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return tot;
|
return tot;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int SommaInt(int col) {
|
public int sommaInt(int col) {
|
||||||
int tot = 0;
|
int tot = 0;
|
||||||
if (data != null) {
|
if (data != null) {
|
||||||
for (int i = 0; i < data.length; i++) {
|
for (int i = 0; i < data.length; i++) {
|
||||||
@ -54,7 +51,7 @@ import javax.swing.table.AbstractTableModel;
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void addRow(Object[] rowData) {
|
public void addRow(Object[] rowData) {
|
||||||
Object[][] data2=null;
|
Object[][] data2;
|
||||||
if (data != null) {
|
if (data != null) {
|
||||||
data2 = new Object[data.length + 1][];
|
data2 = new Object[data.length + 1][];
|
||||||
int r = 0;
|
int r = 0;
|
||||||
@ -69,7 +66,6 @@ import javax.swing.table.AbstractTableModel;
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.data = data2;
|
this.data = data2;
|
||||||
// fireTableRowsInserted(data2.length, data2.length);
|
|
||||||
fireTableDataChanged();
|
fireTableDataChanged();
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -87,6 +83,7 @@ import javax.swing.table.AbstractTableModel;
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void deleteRow(int row) {
|
public void deleteRow(int row) {
|
||||||
if (data.length > 0) {
|
if (data.length > 0) {
|
||||||
Object[][] data2;
|
Object[][] data2;
|
||||||
@ -103,6 +100,13 @@ import javax.swing.table.AbstractTableModel;
|
|||||||
this.fireTableDataChanged();
|
this.fireTableDataChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void clearTable() {
|
||||||
|
for (Integer i = this.getRowCount() - 1; i >= 0; i--) {
|
||||||
|
this.deleteRow(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public int[] isColBoolean() {
|
public int[] isColBoolean() {
|
||||||
return colBoolean;
|
return colBoolean;
|
||||||
}
|
}
|
||||||
@ -149,7 +153,10 @@ import javax.swing.table.AbstractTableModel;
|
|||||||
|
|
||||||
public int getRowCount() {
|
public int getRowCount() {
|
||||||
int rows = 0;
|
int rows = 0;
|
||||||
try{rows=data.length;}catch(Exception ex){}
|
try {
|
||||||
|
rows = data.length;
|
||||||
|
} catch (Exception ex) {
|
||||||
|
}
|
||||||
return rows;
|
return rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -199,7 +206,6 @@ import javax.swing.table.AbstractTableModel;
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isCellEditable(int row, int col) {
|
public boolean isCellEditable(int row, int col) {
|
||||||
if (editable) {
|
if (editable) {
|
||||||
@ -223,5 +229,4 @@ import javax.swing.table.AbstractTableModel;
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -173,7 +173,7 @@
|
|||||||
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
||||||
<Component id="lblResiduo" pref="140" max="32767" attributes="0"/>
|
<Component id="lblResiduo" pref="140" max="32767" attributes="0"/>
|
||||||
<Component id="lblTipoPagamento" max="32767" attributes="0"/>
|
<Component id="lblTipoPagamento" max="32767" attributes="0"/>
|
||||||
<Component id="lblGratuità" alignment="0" pref="140" max="32767" attributes="0"/>
|
<Component id="lblGratuita" alignment="0" pref="140" max="32767" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
<Component id="btnImpostaCliente" alignment="0" pref="252" max="32767" attributes="0"/>
|
<Component id="btnImpostaCliente" alignment="0" pref="252" max="32767" attributes="0"/>
|
||||||
@ -225,7 +225,7 @@
|
|||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="3" attributes="0">
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
<Component id="lblCodice5" alignment="3" min="-2" max="-2" attributes="0"/>
|
<Component id="lblCodice5" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
<Component id="lblGratuità" alignment="3" min="-2" max="-2" attributes="0"/>
|
<Component id="lblGratuita" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
@ -357,12 +357,13 @@
|
|||||||
<Property name="AccessibleContext.accessibleName" type="java.lang.String" value="Gtratuità Residue:"/>
|
<Property name="AccessibleContext.accessibleName" type="java.lang.String" value="Gtratuità Residue:"/>
|
||||||
</AccessibilityProperties>
|
</AccessibilityProperties>
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JLabel" name="lblGratuità">
|
<Component class="javax.swing.JLabel" name="lblGratuita">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||||
<Font name="Tahoma" size="12" style="1"/>
|
<Font name="Tahoma" size="12" style="1"/>
|
||||||
</Property>
|
</Property>
|
||||||
<Property name="text" type="java.lang.String" value="[...]"/>
|
<Property name="text" type="java.lang.String" value="[...]"/>
|
||||||
|
<Property name="name" type="java.lang.String" value="" noResource="true"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
</SubComponents>
|
</SubComponents>
|
||||||
@ -736,11 +737,6 @@
|
|||||||
</Events>
|
</Events>
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JButton" name="jbtnStampa">
|
<Component class="javax.swing.JButton" name="jbtnStampa">
|
||||||
<Properties>
|
|
||||||
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
|
||||||
<Color blue="ff" green="ff" red="ff" type="rgb"/>
|
|
||||||
</Property>
|
|
||||||
</Properties>
|
|
||||||
<Events>
|
<Events>
|
||||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jbtnStampaActionPerformed"/>
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jbtnStampaActionPerformed"/>
|
||||||
</Events>
|
</Events>
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -9,7 +9,6 @@ package puntocassa;
|
|||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
import java.awt.Image;
|
import java.awt.Image;
|
||||||
import java.awt.KeyboardFocusManager;
|
|
||||||
import java.awt.Rectangle;
|
import java.awt.Rectangle;
|
||||||
import java.awt.event.MouseAdapter;
|
import java.awt.event.MouseAdapter;
|
||||||
import java.awt.event.MouseEvent;
|
import java.awt.event.MouseEvent;
|
||||||
@ -25,12 +24,13 @@ import javax.swing.JTable;
|
|||||||
import javax.swing.JTextField;
|
import javax.swing.JTextField;
|
||||||
import javax.swing.ListSelectionModel;
|
import javax.swing.ListSelectionModel;
|
||||||
import javax.swing.table.TableColumn;
|
import javax.swing.table.TableColumn;
|
||||||
|
import puntocassa.utils.Utils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Marco
|
* @author Marco
|
||||||
*/
|
*/
|
||||||
public class frmCerca extends javax.swing.JFrame {
|
public class FrmCerca extends javax.swing.JFrame {
|
||||||
|
|
||||||
private PuntoCassa frmPuntoCassa;
|
private PuntoCassa frmPuntoCassa;
|
||||||
private JTextField jtxtTessera;
|
private JTextField jtxtTessera;
|
||||||
@ -46,11 +46,11 @@ private JTextField jtxtTessera;
|
|||||||
/**
|
/**
|
||||||
* Creates new form frm
|
* Creates new form frm
|
||||||
*/
|
*/
|
||||||
public frmCerca(PuntoCassa frm,JTextField jtxtT,String imgPath,String BuoniPasto,Boolean flagMostraDataNascita) {
|
public FrmCerca(PuntoCassa frm,JTextField jtxtT,String imgPath,String BuoniPasto,Boolean flagMostraDataNascita) {
|
||||||
BP=BuoniPasto;
|
BP=BuoniPasto;
|
||||||
frmPuntoCassa=frm;
|
frmPuntoCassa=frm;
|
||||||
frmPuntoCassa.setEnabled(false);
|
frmPuntoCassa.setEnabled(false);
|
||||||
frmPuntoCassa.AddRemoveKeyDispatcher(false);
|
frmPuntoCassa.addRemoveKeyDispatcher(false);
|
||||||
//KeyboardFocusManager.getCurrentKeyboardFocusManager().removeKeyEventDispatcher(frmPuntoCassa.keyDispatcher);
|
//KeyboardFocusManager.getCurrentKeyboardFocusManager().removeKeyEventDispatcher(frmPuntoCassa.keyDispatcher);
|
||||||
// FlagMostraDataNascita=flagMostraDataNascita;
|
// FlagMostraDataNascita=flagMostraDataNascita;
|
||||||
jtxtTessera=jtxtT;
|
jtxtTessera=jtxtT;
|
||||||
@ -361,7 +361,7 @@ private JTextField jtxtTessera;
|
|||||||
if (DisabilitaPerBuono==false){
|
if (DisabilitaPerBuono==false){
|
||||||
MyKeyBoard myk=new MyKeyBoard(this,true);
|
MyKeyBoard myk=new MyKeyBoard(this,true);
|
||||||
myk.txt=jTxt;
|
myk.txt=jTxt;
|
||||||
myk.Parent=this;
|
myk.parent=this;
|
||||||
Rectangle s=this.getBounds();
|
Rectangle s=this.getBounds();
|
||||||
Rectangle s2=jTxt.getBounds();
|
Rectangle s2=jTxt.getBounds();
|
||||||
Integer l=s.x+s2.x+MyX;
|
Integer l=s.x+s2.x+MyX;
|
||||||
@ -429,7 +429,7 @@ private JTextField jtxtTessera;
|
|||||||
private void formWindowClosed(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosed
|
private void formWindowClosed(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosed
|
||||||
try{
|
try{
|
||||||
frmPuntoCassa.setEnabled(true);
|
frmPuntoCassa.setEnabled(true);
|
||||||
frmPuntoCassa.AddRemoveKeyDispatcher(true);
|
frmPuntoCassa.addRemoveKeyDispatcher(true);
|
||||||
//KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(frmPuntoCassa.keyDispatcher);
|
//KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(frmPuntoCassa.keyDispatcher);
|
||||||
frmPuntoCassa.toFront();
|
frmPuntoCassa.toFront();
|
||||||
frmPuntoCassa.repaint();
|
frmPuntoCassa.repaint();
|
||||||
@ -446,7 +446,7 @@ private JTextField jtxtTessera;
|
|||||||
|
|
||||||
jtxtTessera.setText(nTessera);
|
jtxtTessera.setText(nTessera);
|
||||||
this.dispose();
|
this.dispose();
|
||||||
frmPuntoCassa.CercaTessera();
|
frmPuntoCassa.cercaTessera();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -481,11 +481,11 @@ private JTextField jtxtTessera;
|
|||||||
}//GEN-LAST:event_jtxtNumTesseraMouseClicked
|
}//GEN-LAST:event_jtxtNumTesseraMouseClicked
|
||||||
private void Tastiera(java.awt.event.MouseEvent evt) {
|
private void Tastiera(java.awt.event.MouseEvent evt) {
|
||||||
MyApplication MyA = new MyApplication();
|
MyApplication MyA = new MyApplication();
|
||||||
if (MyA.TastieraVideo) {
|
if (MyA.tastieraVideo) {
|
||||||
if (MyA.UltimoTxt.equalsIgnoreCase(evt.getComponent().toString())) {
|
if (MyA.ultimoTxt.equalsIgnoreCase(evt.getComponent().toString())) {
|
||||||
MyA.UltimoTxt = " ";
|
MyA.ultimoTxt = " ";
|
||||||
} else {
|
} else {
|
||||||
MyA.UltimoTxt = evt.getComponent().toString();
|
MyA.ultimoTxt = evt.getComponent().toString();
|
||||||
Tastiera((JTextField) evt.getComponent(), 0, 0);
|
Tastiera((JTextField) evt.getComponent(), 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -493,11 +493,11 @@ private JTextField jtxtTessera;
|
|||||||
//java.awt.event.FocusEvent
|
//java.awt.event.FocusEvent
|
||||||
private void Tastiera(java.awt.event.FocusEvent evt) {
|
private void Tastiera(java.awt.event.FocusEvent evt) {
|
||||||
MyApplication MyA = new MyApplication();
|
MyApplication MyA = new MyApplication();
|
||||||
if (MyA.TastieraVideo) {
|
if (MyA.tastieraVideo) {
|
||||||
if (MyA.UltimoTxt.equalsIgnoreCase(evt.getComponent().toString())) {
|
if (MyA.ultimoTxt.equalsIgnoreCase(evt.getComponent().toString())) {
|
||||||
MyA.UltimoTxt = " ";
|
MyA.ultimoTxt = " ";
|
||||||
} else {
|
} else {
|
||||||
MyA.UltimoTxt = evt.getComponent().toString();
|
MyA.ultimoTxt = evt.getComponent().toString();
|
||||||
Tastiera((JTextField) evt.getComponent(), 0, 0);
|
Tastiera((JTextField) evt.getComponent(), 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -516,7 +516,7 @@ private JTextField jtxtTessera;
|
|||||||
// int[] cols=new int[1];
|
// int[] cols=new int[1];
|
||||||
// cols[0]=7;
|
// cols[0]=7;
|
||||||
// model.setColModificabile(cols);
|
// model.setColModificabile(cols);
|
||||||
int rowCount=Integer.parseInt(MyA.MySelect(frmPuntoCassa,QueryCount, "righe"));
|
int rowCount=Integer.parseInt(Utils.mySelect(QueryCount, "righe", frmPuntoCassa));
|
||||||
Object[][] data = RowData(Query, Colonne,ColType,rowCount);
|
Object[][] data = RowData(Query, Colonne,ColType,rowCount);
|
||||||
model.setData(data);
|
model.setData(data);
|
||||||
|
|
||||||
@ -708,20 +708,21 @@ private JTextField jtxtTessera;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (ClassNotFoundException ex) {
|
} catch (ClassNotFoundException ex) {
|
||||||
java.util.logging.Logger.getLogger(frmCerca.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
java.util.logging.Logger.getLogger(FrmCerca.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||||
} catch (InstantiationException ex) {
|
} catch (InstantiationException ex) {
|
||||||
java.util.logging.Logger.getLogger(frmCerca.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
java.util.logging.Logger.getLogger(FrmCerca.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||||
} catch (IllegalAccessException ex) {
|
} catch (IllegalAccessException ex) {
|
||||||
java.util.logging.Logger.getLogger(frmCerca.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
java.util.logging.Logger.getLogger(FrmCerca.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||||
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
|
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
|
||||||
java.util.logging.Logger.getLogger(frmCerca.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
java.util.logging.Logger.getLogger(FrmCerca.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||||
}
|
}
|
||||||
//</editor-fold>
|
//</editor-fold>
|
||||||
|
//</editor-fold>
|
||||||
|
|
||||||
/* Create and display the form */
|
/* Create and display the form */
|
||||||
java.awt.EventQueue.invokeLater(new Runnable() {
|
java.awt.EventQueue.invokeLater(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
new frmCerca(null,null,null,null,true).setVisible(true);
|
new FrmCerca(null,null,null,null,true).setVisible(true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -747,8 +748,8 @@ private JTextField jtxtTessera;
|
|||||||
private void CercaValoriDefault() {
|
private void CercaValoriDefault() {
|
||||||
try {
|
try {
|
||||||
MyApplication MyA = new MyApplication();
|
MyApplication MyA = new MyApplication();
|
||||||
String txtbox = MyA.MySelect(frmPuntoCassa, "Select Valore from PARAMETRI where chiave='ImpostaTesseraCampo'", "Valore");
|
String txtbox = Utils.mySelect("Select Valore from PARAMETRI where chiave='ImpostaTesseraCampo'", "Valore", frmPuntoCassa);
|
||||||
String txtboxValore = MyA.MySelect(frmPuntoCassa, "Select Valore from PARAMETRI where chiave='ImpostaTesseraStringa'", "Valore");
|
String txtboxValore = Utils.mySelect("Select Valore from PARAMETRI where chiave='ImpostaTesseraStringa'", "Valore", frmPuntoCassa);
|
||||||
|
|
||||||
if (txtbox.equalsIgnoreCase("COGNOME")) {
|
if (txtbox.equalsIgnoreCase("COGNOME")) {
|
||||||
jtxtCognome.requestFocus();
|
jtxtCognome.requestFocus();
|
||||||
|
@ -7,10 +7,7 @@
|
|||||||
package puntocassa;
|
package puntocassa;
|
||||||
|
|
||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
import java.awt.KeyboardFocusManager;
|
|
||||||
import java.awt.Rectangle;
|
import java.awt.Rectangle;
|
||||||
import java.awt.event.MouseAdapter;
|
|
||||||
import java.awt.event.MouseEvent;
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.DriverManager;
|
import java.sql.DriverManager;
|
||||||
@ -19,7 +16,6 @@ import java.sql.SQLException;
|
|||||||
import java.sql.Statement;
|
import java.sql.Statement;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Properties;
|
|
||||||
import javax.swing.ImageIcon;
|
import javax.swing.ImageIcon;
|
||||||
import javax.swing.JComboBox;
|
import javax.swing.JComboBox;
|
||||||
import javax.swing.JOptionPane;
|
import javax.swing.JOptionPane;
|
||||||
@ -27,12 +23,13 @@ import javax.swing.JTable;
|
|||||||
import javax.swing.JTextField;
|
import javax.swing.JTextField;
|
||||||
import javax.swing.ListSelectionModel;
|
import javax.swing.ListSelectionModel;
|
||||||
import javax.swing.table.TableColumn;
|
import javax.swing.table.TableColumn;
|
||||||
|
import puntocassa.utils.Utils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Marco
|
* @author Marco
|
||||||
*/
|
*/
|
||||||
public class frmMeteo extends javax.swing.JFrame {
|
public class FrmMeteo extends javax.swing.JFrame {
|
||||||
|
|
||||||
private PuntoCassa frmPuntoCassa;
|
private PuntoCassa frmPuntoCassa;
|
||||||
private Long idPuntoCassa=0L;
|
private Long idPuntoCassa=0L;
|
||||||
@ -45,12 +42,12 @@ public class frmMeteo extends javax.swing.JFrame {
|
|||||||
/**
|
/**
|
||||||
* Creates new form frm
|
* Creates new form frm
|
||||||
*/
|
*/
|
||||||
public frmMeteo(PuntoCassa frm, Long id_Punto_Cassa,Boolean Nuovo) {
|
public FrmMeteo(PuntoCassa frm, Long id_Punto_Cassa,Boolean Nuovo) {
|
||||||
|
|
||||||
frmPuntoCassa=frm;
|
frmPuntoCassa=frm;
|
||||||
frmPuntoCassa.setEnabled(false);
|
frmPuntoCassa.setEnabled(false);
|
||||||
//KeyboardFocusManager.getCurrentKeyboardFocusManager().removeKeyEventDispatcher(frmPuntoCassa.keyDispatcher);
|
//KeyboardFocusManager.getCurrentKeyboardFocusManager().removeKeyEventDispatcher(frmPuntoCassa.keyDispatcher);
|
||||||
frmPuntoCassa.AddRemoveKeyDispatcher(false);
|
frmPuntoCassa.addRemoveKeyDispatcher(false);
|
||||||
idPuntoCassa=id_Punto_Cassa;
|
idPuntoCassa=id_Punto_Cassa;
|
||||||
Inserimento=Nuovo;
|
Inserimento=Nuovo;
|
||||||
initComponents();
|
initComponents();
|
||||||
@ -144,7 +141,7 @@ public class frmMeteo extends javax.swing.JFrame {
|
|||||||
|
|
||||||
MyKeyBoard myk=new MyKeyBoard(this,false);
|
MyKeyBoard myk=new MyKeyBoard(this,false);
|
||||||
myk.txt=jTxt;
|
myk.txt=jTxt;
|
||||||
myk.Parent=this;
|
myk.parent=this;
|
||||||
Rectangle s=this.getBounds();
|
Rectangle s=this.getBounds();
|
||||||
Rectangle s2=jTxt.getBounds();
|
Rectangle s2=jTxt.getBounds();
|
||||||
Integer l=s.x+s2.x+MyX;
|
Integer l=s.x+s2.x+MyX;
|
||||||
@ -157,7 +154,7 @@ public class frmMeteo extends javax.swing.JFrame {
|
|||||||
try {
|
try {
|
||||||
frmPuntoCassa.setEnabled(true);
|
frmPuntoCassa.setEnabled(true);
|
||||||
//KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(frmPuntoCassa.keyDispatcher);
|
//KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(frmPuntoCassa.keyDispatcher);
|
||||||
frmPuntoCassa.AddRemoveKeyDispatcher(true);
|
frmPuntoCassa.addRemoveKeyDispatcher(true);
|
||||||
frmPuntoCassa.toFront();
|
frmPuntoCassa.toFront();
|
||||||
frmPuntoCassa.repaint();
|
frmPuntoCassa.repaint();
|
||||||
|
|
||||||
@ -216,7 +213,7 @@ public class frmMeteo extends javax.swing.JFrame {
|
|||||||
// int[] cols=new int[1];
|
// int[] cols=new int[1];
|
||||||
// cols[0]=7;
|
// cols[0]=7;
|
||||||
// model.setColModificabile(cols);
|
// model.setColModificabile(cols);
|
||||||
int rowCount=Integer.parseInt(MyA.MySelect(frmPuntoCassa,QueryCount, "righe"));
|
int rowCount=Integer.parseInt(Utils.mySelect(QueryCount, "righe", frmPuntoCassa));
|
||||||
Object[][] data = RowData(Query, Colonne,ColType,rowCount);
|
Object[][] data = RowData(Query, Colonne,ColType,rowCount);
|
||||||
model.setData(data);
|
model.setData(data);
|
||||||
|
|
||||||
@ -355,20 +352,21 @@ public class frmMeteo extends javax.swing.JFrame {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (ClassNotFoundException ex) {
|
} catch (ClassNotFoundException ex) {
|
||||||
java.util.logging.Logger.getLogger(frmMeteo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
java.util.logging.Logger.getLogger(FrmMeteo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||||
} catch (InstantiationException ex) {
|
} catch (InstantiationException ex) {
|
||||||
java.util.logging.Logger.getLogger(frmMeteo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
java.util.logging.Logger.getLogger(FrmMeteo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||||
} catch (IllegalAccessException ex) {
|
} catch (IllegalAccessException ex) {
|
||||||
java.util.logging.Logger.getLogger(frmMeteo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
java.util.logging.Logger.getLogger(FrmMeteo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||||
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
|
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
|
||||||
java.util.logging.Logger.getLogger(frmMeteo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
java.util.logging.Logger.getLogger(FrmMeteo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||||
}
|
}
|
||||||
//</editor-fold>
|
//</editor-fold>
|
||||||
|
//</editor-fold>
|
||||||
|
|
||||||
/* Create and display the form */
|
/* Create and display the form */
|
||||||
java.awt.EventQueue.invokeLater(new Runnable() {
|
java.awt.EventQueue.invokeLater(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
new frmMeteo(null,0L,true).setVisible(true);
|
new FrmMeteo(null,0L,true).setVisible(true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -8,10 +8,7 @@ package puntocassa;
|
|||||||
|
|
||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
import java.awt.Image;
|
import java.awt.Image;
|
||||||
import java.awt.KeyboardFocusManager;
|
|
||||||
import java.awt.Rectangle;
|
import java.awt.Rectangle;
|
||||||
import java.awt.event.MouseAdapter;
|
|
||||||
import java.awt.event.MouseEvent;
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.DriverManager;
|
import java.sql.DriverManager;
|
||||||
@ -24,12 +21,13 @@ import javax.swing.JTable;
|
|||||||
import javax.swing.JTextField;
|
import javax.swing.JTextField;
|
||||||
import javax.swing.ListSelectionModel;
|
import javax.swing.ListSelectionModel;
|
||||||
import javax.swing.table.TableColumn;
|
import javax.swing.table.TableColumn;
|
||||||
|
import puntocassa.utils.Utils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Marco
|
* @author Marco
|
||||||
*/
|
*/
|
||||||
public class frmMovimenti extends javax.swing.JFrame {
|
public class FrmMovimenti extends javax.swing.JFrame {
|
||||||
|
|
||||||
private PuntoCassa frmPuntoCassa;
|
private PuntoCassa frmPuntoCassa;
|
||||||
private Long idTessera=0L,idPuntoCassa=0L;
|
private Long idTessera=0L,idPuntoCassa=0L;
|
||||||
@ -42,12 +40,12 @@ public class frmMovimenti extends javax.swing.JFrame {
|
|||||||
/**
|
/**
|
||||||
* Creates new form frm
|
* Creates new form frm
|
||||||
*/
|
*/
|
||||||
public frmMovimenti(PuntoCassa frm,Long IDTessera,Long IDPuntoCassa,String imgPath) {
|
public FrmMovimenti(PuntoCassa frm,Long IDTessera,Long IDPuntoCassa,String imgPath) {
|
||||||
|
|
||||||
frmPuntoCassa=frm;
|
frmPuntoCassa=frm;
|
||||||
frmPuntoCassa.setEnabled(false);
|
frmPuntoCassa.setEnabled(false);
|
||||||
//KeyboardFocusManager.getCurrentKeyboardFocusManager().removeKeyEventDispatcher(frmPuntoCassa.keyDispatcher);
|
//KeyboardFocusManager.getCurrentKeyboardFocusManager().removeKeyEventDispatcher(frmPuntoCassa.keyDispatcher);
|
||||||
frmPuntoCassa.AddRemoveKeyDispatcher(false);
|
frmPuntoCassa.addRemoveKeyDispatcher(false);
|
||||||
|
|
||||||
idPuntoCassa=IDPuntoCassa;
|
idPuntoCassa=IDPuntoCassa;
|
||||||
idTessera=IDTessera;
|
idTessera=IDTessera;
|
||||||
@ -218,7 +216,7 @@ public class frmMovimenti extends javax.swing.JFrame {
|
|||||||
|
|
||||||
MyKeyBoard myk=new MyKeyBoard(this,false);
|
MyKeyBoard myk=new MyKeyBoard(this,false);
|
||||||
myk.txt=jTxt;
|
myk.txt=jTxt;
|
||||||
myk.Parent=this;
|
myk.parent=this;
|
||||||
Rectangle s=this.getBounds();
|
Rectangle s=this.getBounds();
|
||||||
Rectangle s2=jTxt.getBounds();
|
Rectangle s2=jTxt.getBounds();
|
||||||
Integer l=s.x+s2.x+MyX;
|
Integer l=s.x+s2.x+MyX;
|
||||||
@ -231,7 +229,7 @@ public class frmMovimenti extends javax.swing.JFrame {
|
|||||||
try{
|
try{
|
||||||
frmPuntoCassa.setEnabled(true);
|
frmPuntoCassa.setEnabled(true);
|
||||||
//KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(frmPuntoCassa.keyDispatcher);
|
//KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(frmPuntoCassa.keyDispatcher);
|
||||||
frmPuntoCassa.AddRemoveKeyDispatcher(true);
|
frmPuntoCassa.addRemoveKeyDispatcher(true);
|
||||||
frmPuntoCassa.toFront();
|
frmPuntoCassa.toFront();
|
||||||
frmPuntoCassa.repaint();
|
frmPuntoCassa.repaint();
|
||||||
frmPuntoCassa=null;
|
frmPuntoCassa=null;
|
||||||
@ -285,7 +283,7 @@ public class frmMovimenti extends javax.swing.JFrame {
|
|||||||
// int[] cols=new int[1];
|
// int[] cols=new int[1];
|
||||||
// cols[0]=7;
|
// cols[0]=7;
|
||||||
// model.setColModificabile(cols);
|
// model.setColModificabile(cols);
|
||||||
int rowCount=Integer.parseInt(MyA.MySelect(frmPuntoCassa,QueryCount, "righe"));
|
int rowCount=Integer.parseInt(Utils.mySelect(QueryCount, "righe", frmPuntoCassa));
|
||||||
Object[][] data = RowData(Query, Colonne,ColType,rowCount);
|
Object[][] data = RowData(Query, Colonne,ColType,rowCount);
|
||||||
model.setData(data);
|
model.setData(data);
|
||||||
|
|
||||||
@ -485,21 +483,23 @@ public class frmMovimenti extends javax.swing.JFrame {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (ClassNotFoundException ex) {
|
} catch (ClassNotFoundException ex) {
|
||||||
java.util.logging.Logger.getLogger(frmMovimenti.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
java.util.logging.Logger.getLogger(FrmMovimenti.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||||
} catch (InstantiationException ex) {
|
} catch (InstantiationException ex) {
|
||||||
java.util.logging.Logger.getLogger(frmMovimenti.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
java.util.logging.Logger.getLogger(FrmMovimenti.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||||
} catch (IllegalAccessException ex) {
|
} catch (IllegalAccessException ex) {
|
||||||
java.util.logging.Logger.getLogger(frmMovimenti.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
java.util.logging.Logger.getLogger(FrmMovimenti.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||||
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
|
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
|
||||||
java.util.logging.Logger.getLogger(frmMovimenti.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
java.util.logging.Logger.getLogger(FrmMovimenti.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||||
}
|
}
|
||||||
//</editor-fold>
|
//</editor-fold>
|
||||||
//</editor-fold>
|
//</editor-fold>
|
||||||
|
//</editor-fold>
|
||||||
|
//</editor-fold>
|
||||||
|
|
||||||
/* Create and display the form */
|
/* Create and display the form */
|
||||||
java.awt.EventQueue.invokeLater(new Runnable() {
|
java.awt.EventQueue.invokeLater(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
new frmMovimenti(null,0L,0L,null).setVisible(true);
|
new FrmMovimenti(null,0L,0L,null).setVisible(true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,6 @@ package puntocassa;
|
|||||||
|
|
||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
import java.awt.Image;
|
import java.awt.Image;
|
||||||
import java.awt.KeyboardFocusManager;
|
|
||||||
import java.awt.Rectangle;
|
import java.awt.Rectangle;
|
||||||
import java.awt.event.MouseAdapter;
|
import java.awt.event.MouseAdapter;
|
||||||
import java.awt.event.MouseEvent;
|
import java.awt.event.MouseEvent;
|
||||||
@ -18,7 +17,6 @@ import java.sql.DriverManager;
|
|||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.sql.Statement;
|
import java.sql.Statement;
|
||||||
import java.util.Properties;
|
|
||||||
import javax.swing.ImageIcon;
|
import javax.swing.ImageIcon;
|
||||||
import javax.swing.JComboBox;
|
import javax.swing.JComboBox;
|
||||||
import javax.swing.JOptionPane;
|
import javax.swing.JOptionPane;
|
||||||
@ -26,12 +24,13 @@ import javax.swing.JTable;
|
|||||||
import javax.swing.JTextField;
|
import javax.swing.JTextField;
|
||||||
import javax.swing.ListSelectionModel;
|
import javax.swing.ListSelectionModel;
|
||||||
import javax.swing.table.TableColumn;
|
import javax.swing.table.TableColumn;
|
||||||
|
import puntocassa.utils.Utils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Marco
|
* @author Marco
|
||||||
*/
|
*/
|
||||||
public class frmProdotti extends javax.swing.JFrame {
|
public class FrmProdotti extends javax.swing.JFrame {
|
||||||
|
|
||||||
private PuntoCassa frmPuntoCassa;
|
private PuntoCassa frmPuntoCassa;
|
||||||
|
|
||||||
@ -44,12 +43,12 @@ private PuntoCassa frmPuntoCassa;
|
|||||||
/**
|
/**
|
||||||
* Creates new form frm
|
* Creates new form frm
|
||||||
*/
|
*/
|
||||||
public frmProdotti(PuntoCassa frm,String imgPath) {
|
public FrmProdotti(PuntoCassa frm,String imgPath) {
|
||||||
|
|
||||||
frmPuntoCassa=frm;
|
frmPuntoCassa=frm;
|
||||||
frmPuntoCassa.setEnabled(false);
|
frmPuntoCassa.setEnabled(false);
|
||||||
//KeyboardFocusManager.getCurrentKeyboardFocusManager().removeKeyEventDispatcher(frmPuntoCassa.keyDispatcher);
|
//KeyboardFocusManager.getCurrentKeyboardFocusManager().removeKeyEventDispatcher(frmPuntoCassa.keyDispatcher);
|
||||||
frmPuntoCassa.AddRemoveKeyDispatcher(false);
|
frmPuntoCassa.addRemoveKeyDispatcher(false);
|
||||||
initComponents();
|
initComponents();
|
||||||
|
|
||||||
String startDir = System.getProperty("user.dir");
|
String startDir = System.getProperty("user.dir");
|
||||||
@ -323,7 +322,7 @@ private PuntoCassa frmPuntoCassa;
|
|||||||
|
|
||||||
MyKeyBoard myk=new MyKeyBoard(this,false);
|
MyKeyBoard myk=new MyKeyBoard(this,false);
|
||||||
myk.txt=jTxt;
|
myk.txt=jTxt;
|
||||||
myk.Parent=this;
|
myk.parent=this;
|
||||||
Rectangle s=this.getBounds();
|
Rectangle s=this.getBounds();
|
||||||
Rectangle s2=jTxt.getBounds();
|
Rectangle s2=jTxt.getBounds();
|
||||||
Integer l=s.x+s2.x+MyX;
|
Integer l=s.x+s2.x+MyX;
|
||||||
@ -336,7 +335,7 @@ private PuntoCassa frmPuntoCassa;
|
|||||||
try{
|
try{
|
||||||
frmPuntoCassa.setEnabled(true);
|
frmPuntoCassa.setEnabled(true);
|
||||||
//KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(frmPuntoCassa.keyDispatcher);
|
//KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(frmPuntoCassa.keyDispatcher);
|
||||||
frmPuntoCassa.AddRemoveKeyDispatcher(true);
|
frmPuntoCassa.addRemoveKeyDispatcher(true);
|
||||||
frmPuntoCassa.toFront();
|
frmPuntoCassa.toFront();
|
||||||
frmPuntoCassa.repaint();
|
frmPuntoCassa.repaint();
|
||||||
frmPuntoCassa=null;
|
frmPuntoCassa=null;
|
||||||
@ -350,8 +349,8 @@ private PuntoCassa frmPuntoCassa;
|
|||||||
Long cod = 0L;
|
Long cod = 0L;
|
||||||
if (jTblProdotti.getSelectedRow() >= 0) {
|
if (jTblProdotti.getSelectedRow() >= 0) {
|
||||||
cod = Long.parseLong(model.getValueAt(jTblProdotti.getSelectedRow(), 0).toString());
|
cod = Long.parseLong(model.getValueAt(jTblProdotti.getSelectedRow(), 0).toString());
|
||||||
Boolean Cè = Boolean.parseBoolean(model.getValueAt(jTblProdotti.getSelectedRow(), 4).toString());
|
Boolean presente = Boolean.parseBoolean(model.getValueAt(jTblProdotti.getSelectedRow(), 4).toString());
|
||||||
if (Cè == false) {
|
if (presente == false) {
|
||||||
MyInsert("Insert into Catalogo_punti_cassa (id,id_prodotto,id_punto_cassa,flag_locale) values(-1," + cod + "," + frmPuntoCassa.idPuntoCassa + ",1)");
|
MyInsert("Insert into Catalogo_punti_cassa (id,id_prodotto,id_punto_cassa,flag_locale) values(-1," + cod + "," + frmPuntoCassa.idPuntoCassa + ",1)");
|
||||||
frmPuntoCassa.caricaDati("PRODOTTI", "-1");
|
frmPuntoCassa.caricaDati("PRODOTTI", "-1");
|
||||||
this.dispose();
|
this.dispose();
|
||||||
@ -442,8 +441,8 @@ private PuntoCassa frmPuntoCassa;
|
|||||||
Long cod = 0L;
|
Long cod = 0L;
|
||||||
if (jTblProdotti.getSelectedRow() >= 0) {
|
if (jTblProdotti.getSelectedRow() >= 0) {
|
||||||
cod = Long.parseLong(model.getValueAt(jTblProdotti.getSelectedRow(), 0).toString());
|
cod = Long.parseLong(model.getValueAt(jTblProdotti.getSelectedRow(), 0).toString());
|
||||||
Boolean Cè = Boolean.parseBoolean(model.getValueAt(jTblProdotti.getSelectedRow(), 4).toString());
|
Boolean presente = Boolean.parseBoolean(model.getValueAt(jTblProdotti.getSelectedRow(), 4).toString());
|
||||||
if (Cè) {
|
if (presente) {
|
||||||
MyInsert("Delete Catalogo_punti_cassa where id_prodotto=" + cod + " and id_punto_cassa=" + frmPuntoCassa.idPuntoCassa);
|
MyInsert("Delete Catalogo_punti_cassa where id_prodotto=" + cod + " and id_punto_cassa=" + frmPuntoCassa.idPuntoCassa);
|
||||||
frmPuntoCassa.caricaDati("PRODOTTI", "-1");
|
frmPuntoCassa.caricaDati("PRODOTTI", "-1");
|
||||||
this.dispose();
|
this.dispose();
|
||||||
@ -453,11 +452,11 @@ private PuntoCassa frmPuntoCassa;
|
|||||||
}//GEN-LAST:event_jbtnEliminaActionPerformed
|
}//GEN-LAST:event_jbtnEliminaActionPerformed
|
||||||
private void Tastiera(java.awt.event.MouseEvent evt) {
|
private void Tastiera(java.awt.event.MouseEvent evt) {
|
||||||
MyApplication MyA = new MyApplication();
|
MyApplication MyA = new MyApplication();
|
||||||
if (MyA.TastieraVideo) {
|
if (MyA.tastieraVideo) {
|
||||||
if (MyA.UltimoTxt.equalsIgnoreCase(evt.getComponent().toString())) {
|
if (MyA.ultimoTxt.equalsIgnoreCase(evt.getComponent().toString())) {
|
||||||
MyA.UltimoTxt = " ";
|
MyA.ultimoTxt = " ";
|
||||||
} else {
|
} else {
|
||||||
MyA.UltimoTxt = evt.getComponent().toString();
|
MyA.ultimoTxt = evt.getComponent().toString();
|
||||||
Tastiera((JTextField) evt.getComponent(), 0, 0);
|
Tastiera((JTextField) evt.getComponent(), 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -465,11 +464,11 @@ private PuntoCassa frmPuntoCassa;
|
|||||||
//java.awt.event.FocusEvent
|
//java.awt.event.FocusEvent
|
||||||
private void Tastiera(java.awt.event.FocusEvent evt) {
|
private void Tastiera(java.awt.event.FocusEvent evt) {
|
||||||
MyApplication MyA = new MyApplication();
|
MyApplication MyA = new MyApplication();
|
||||||
if (MyA.TastieraVideo) {
|
if (MyA.tastieraVideo) {
|
||||||
if (MyA.UltimoTxt.equalsIgnoreCase(evt.getComponent().toString())) {
|
if (MyA.ultimoTxt.equalsIgnoreCase(evt.getComponent().toString())) {
|
||||||
MyA.UltimoTxt = " ";
|
MyA.ultimoTxt = " ";
|
||||||
} else {
|
} else {
|
||||||
MyA.UltimoTxt = evt.getComponent().toString();
|
MyA.ultimoTxt = evt.getComponent().toString();
|
||||||
Tastiera((JTextField) evt.getComponent(), 0, 0);
|
Tastiera((JTextField) evt.getComponent(), 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -487,7 +486,7 @@ private PuntoCassa frmPuntoCassa;
|
|||||||
// int[] cols=new int[1];
|
// int[] cols=new int[1];
|
||||||
// cols[0]=7;
|
// cols[0]=7;
|
||||||
// model.setColModificabile(cols);
|
// model.setColModificabile(cols);
|
||||||
int rowCount=Integer.parseInt(MyA.MySelect(frmPuntoCassa,QueryCount, "righe"));
|
int rowCount=Integer.parseInt(Utils.mySelect(QueryCount, "righe", frmPuntoCassa));
|
||||||
Object[][] data = RowData(Query, Colonne,ColType,rowCount);
|
Object[][] data = RowData(Query, Colonne,ColType,rowCount);
|
||||||
model.setData(data);
|
model.setData(data);
|
||||||
|
|
||||||
@ -679,20 +678,21 @@ private PuntoCassa frmPuntoCassa;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (ClassNotFoundException ex) {
|
} catch (ClassNotFoundException ex) {
|
||||||
java.util.logging.Logger.getLogger(frmProdotti.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
java.util.logging.Logger.getLogger(FrmProdotti.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||||
} catch (InstantiationException ex) {
|
} catch (InstantiationException ex) {
|
||||||
java.util.logging.Logger.getLogger(frmProdotti.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
java.util.logging.Logger.getLogger(FrmProdotti.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||||
} catch (IllegalAccessException ex) {
|
} catch (IllegalAccessException ex) {
|
||||||
java.util.logging.Logger.getLogger(frmProdotti.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
java.util.logging.Logger.getLogger(FrmProdotti.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||||
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
|
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
|
||||||
java.util.logging.Logger.getLogger(frmProdotti.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
java.util.logging.Logger.getLogger(FrmProdotti.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||||
}
|
}
|
||||||
//</editor-fold>
|
//</editor-fold>
|
||||||
|
//</editor-fold>
|
||||||
|
|
||||||
/* Create and display the form */
|
/* Create and display the form */
|
||||||
java.awt.EventQueue.invokeLater(new Runnable() {
|
java.awt.EventQueue.invokeLater(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
new frmProdotti(null,null).setVisible(true);
|
new FrmProdotti(null,null).setVisible(true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<Property name="defaultCloseOperation" type="int" value="2"/>
|
<Property name="defaultCloseOperation" type="int" value="2"/>
|
||||||
<Property name="title" type="java.lang.String" value="Aggiorna database..."/>
|
<Property name="title" type="java.lang.String" value="Aggiorna database..."/>
|
||||||
<Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor">
|
<Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor">
|
||||||
<Color id="Cursore predefinito"/>
|
<Color id="Default Cursor"/>
|
||||||
</Property>
|
</Property>
|
||||||
<Property name="resizable" type="boolean" value="false"/>
|
<Property name="resizable" type="boolean" value="false"/>
|
||||||
<Property name="type" type="java.awt.Window$Type" editor="org.netbeans.modules.form.editors.EnumEditor">
|
<Property name="type" type="java.awt.Window$Type" editor="org.netbeans.modules.form.editors.EnumEditor">
|
||||||
|
@ -6,40 +6,21 @@
|
|||||||
|
|
||||||
package puntocassa;
|
package puntocassa;
|
||||||
|
|
||||||
import java.awt.Font;
|
|
||||||
import java.awt.KeyboardFocusManager;
|
|
||||||
import java.awt.Rectangle;
|
|
||||||
import java.awt.event.MouseAdapter;
|
|
||||||
import java.awt.event.MouseEvent;
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.sql.Connection;
|
|
||||||
import java.sql.DriverManager;
|
|
||||||
import java.sql.ResultSet;
|
|
||||||
import java.sql.SQLException;
|
|
||||||
import java.sql.Statement;
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Properties;
|
|
||||||
import javax.swing.ImageIcon;
|
import javax.swing.ImageIcon;
|
||||||
import javax.swing.JComboBox;
|
|
||||||
import javax.swing.JOptionPane;
|
|
||||||
import javax.swing.JTable;
|
|
||||||
import javax.swing.JTextField;
|
|
||||||
import javax.swing.ListSelectionModel;
|
|
||||||
import javax.swing.table.TableColumn;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Marco
|
* @author Marco
|
||||||
*/
|
*/
|
||||||
public class frmProgress extends javax.swing.JFrame {
|
public class FrmProgress extends javax.swing.JFrame {
|
||||||
|
|
||||||
private PuntoCassa frmPuntoCassa;
|
private PuntoCassa frmPuntoCassa;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates new form frm
|
* Creates new form frm
|
||||||
*/
|
*/
|
||||||
public frmProgress(PuntoCassa frm) {
|
public FrmProgress(PuntoCassa frm) {
|
||||||
frmPuntoCassa=frm;
|
frmPuntoCassa=frm;
|
||||||
initComponents();
|
initComponents();
|
||||||
String startDir = System.getProperty("user.dir");
|
String startDir = System.getProperty("user.dir");
|
||||||
@ -136,20 +117,21 @@ public class frmProgress extends javax.swing.JFrame {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (ClassNotFoundException ex) {
|
} catch (ClassNotFoundException ex) {
|
||||||
java.util.logging.Logger.getLogger(frmProgress.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
java.util.logging.Logger.getLogger(FrmProgress.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||||
} catch (InstantiationException ex) {
|
} catch (InstantiationException ex) {
|
||||||
java.util.logging.Logger.getLogger(frmProgress.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
java.util.logging.Logger.getLogger(FrmProgress.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||||
} catch (IllegalAccessException ex) {
|
} catch (IllegalAccessException ex) {
|
||||||
java.util.logging.Logger.getLogger(frmProgress.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
java.util.logging.Logger.getLogger(FrmProgress.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||||
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
|
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
|
||||||
java.util.logging.Logger.getLogger(frmProgress.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
java.util.logging.Logger.getLogger(FrmProgress.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||||
}
|
}
|
||||||
//</editor-fold>
|
//</editor-fold>
|
||||||
|
//</editor-fold>
|
||||||
|
|
||||||
/* Create and display the form */
|
/* Create and display the form */
|
||||||
java.awt.EventQueue.invokeLater(new Runnable() {
|
java.awt.EventQueue.invokeLater(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
new frmProgress(null).setVisible(true);
|
new FrmProgress(null).setVisible(true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -8,10 +8,7 @@ package puntocassa;
|
|||||||
|
|
||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
import java.awt.Image;
|
import java.awt.Image;
|
||||||
import java.awt.KeyboardFocusManager;
|
|
||||||
import java.awt.Rectangle;
|
import java.awt.Rectangle;
|
||||||
import java.awt.event.MouseAdapter;
|
|
||||||
import java.awt.event.MouseEvent;
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.DriverManager;
|
import java.sql.DriverManager;
|
||||||
@ -24,12 +21,13 @@ import javax.swing.JTable;
|
|||||||
import javax.swing.JTextField;
|
import javax.swing.JTextField;
|
||||||
import javax.swing.ListSelectionModel;
|
import javax.swing.ListSelectionModel;
|
||||||
import javax.swing.table.TableColumn;
|
import javax.swing.table.TableColumn;
|
||||||
|
import puntocassa.utils.Utils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Marco
|
* @author Marco
|
||||||
*/
|
*/
|
||||||
public class frmStorno extends javax.swing.JFrame {
|
public class FrmStorno extends javax.swing.JFrame {
|
||||||
|
|
||||||
private PuntoCassa frmPuntoCassa;
|
private PuntoCassa frmPuntoCassa;
|
||||||
private Long idTessera=0L,idPuntoCassa=0L;
|
private Long idTessera=0L,idPuntoCassa=0L;
|
||||||
@ -43,12 +41,12 @@ public class frmStorno extends javax.swing.JFrame {
|
|||||||
/**
|
/**
|
||||||
* Creates new form frm
|
* Creates new form frm
|
||||||
*/
|
*/
|
||||||
public frmStorno(PuntoCassa frm,Long IDTessera,Long IDPuntoCassa,String imgPath,Boolean azzera) {
|
public FrmStorno(PuntoCassa frm,Long IDTessera,Long IDPuntoCassa,String imgPath,Boolean azzera) {
|
||||||
|
|
||||||
frmPuntoCassa=frm;
|
frmPuntoCassa=frm;
|
||||||
frmPuntoCassa.setEnabled(false);
|
frmPuntoCassa.setEnabled(false);
|
||||||
//KeyboardFocusManager.getCurrentKeyboardFocusManager().removeKeyEventDispatcher(frmPuntoCassa.keyDispatcher);
|
//KeyboardFocusManager.getCurrentKeyboardFocusManager().removeKeyEventDispatcher(frmPuntoCassa.keyDispatcher);
|
||||||
frmPuntoCassa.AddRemoveKeyDispatcher(false);
|
frmPuntoCassa.addRemoveKeyDispatcher(false);
|
||||||
|
|
||||||
idPuntoCassa=IDPuntoCassa;
|
idPuntoCassa=IDPuntoCassa;
|
||||||
idTessera=IDTessera;
|
idTessera=IDTessera;
|
||||||
@ -234,7 +232,7 @@ public class frmStorno extends javax.swing.JFrame {
|
|||||||
|
|
||||||
MyKeyBoard myk=new MyKeyBoard(this,false);
|
MyKeyBoard myk=new MyKeyBoard(this,false);
|
||||||
myk.txt=jTxt;
|
myk.txt=jTxt;
|
||||||
myk.Parent=this;
|
myk.parent=this;
|
||||||
Rectangle s=this.getBounds();
|
Rectangle s=this.getBounds();
|
||||||
Rectangle s2=jTxt.getBounds();
|
Rectangle s2=jTxt.getBounds();
|
||||||
Integer l=s.x+s2.x+MyX;
|
Integer l=s.x+s2.x+MyX;
|
||||||
@ -248,11 +246,11 @@ public class frmStorno extends javax.swing.JFrame {
|
|||||||
|
|
||||||
frmPuntoCassa.setEnabled(true);
|
frmPuntoCassa.setEnabled(true);
|
||||||
//KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(frmPuntoCassa.keyDispatcher);
|
//KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(frmPuntoCassa.keyDispatcher);
|
||||||
frmPuntoCassa.AddRemoveKeyDispatcher(true);
|
frmPuntoCassa.addRemoveKeyDispatcher(true);
|
||||||
frmPuntoCassa.toFront();
|
frmPuntoCassa.toFront();
|
||||||
frmPuntoCassa.repaint();
|
frmPuntoCassa.repaint();
|
||||||
if (Azzera && StornoEffettuato==false){
|
if (Azzera && StornoEffettuato==false){
|
||||||
frmPuntoCassa.AzzeraDopoStorno();
|
frmPuntoCassa.azzeraDopoStorno();
|
||||||
}
|
}
|
||||||
frmPuntoCassa=null;
|
frmPuntoCassa=null;
|
||||||
|
|
||||||
@ -284,7 +282,7 @@ public class frmStorno extends javax.swing.JFrame {
|
|||||||
// frmPuntoCassa.AzzeraDopoStorno();
|
// frmPuntoCassa.AzzeraDopoStorno();
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
frmPuntoCassa.AggiornaProgressivi();
|
frmPuntoCassa.aggiornaProgressivi();
|
||||||
}
|
}
|
||||||
//frmPuntoCassa.CercaTessera();
|
//frmPuntoCassa.CercaTessera();
|
||||||
this.dispose();
|
this.dispose();
|
||||||
@ -338,7 +336,7 @@ public class frmStorno extends javax.swing.JFrame {
|
|||||||
// int[] cols=new int[1];
|
// int[] cols=new int[1];
|
||||||
// cols[0]=7;
|
// cols[0]=7;
|
||||||
// model.setColModificabile(cols);
|
// model.setColModificabile(cols);
|
||||||
int rowCount=Integer.parseInt(MyA.MySelect(frmPuntoCassa,QueryCount, "righe"));
|
int rowCount=Integer.parseInt(Utils.mySelect(QueryCount, "righe", frmPuntoCassa));
|
||||||
Object[][] data = RowData(Query, Colonne,ColType,rowCount);
|
Object[][] data = RowData(Query, Colonne,ColType,rowCount);
|
||||||
model.setData(data);
|
model.setData(data);
|
||||||
|
|
||||||
@ -556,20 +554,21 @@ public class frmStorno extends javax.swing.JFrame {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (ClassNotFoundException ex) {
|
} catch (ClassNotFoundException ex) {
|
||||||
java.util.logging.Logger.getLogger(frmStorno.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
java.util.logging.Logger.getLogger(FrmStorno.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||||
} catch (InstantiationException ex) {
|
} catch (InstantiationException ex) {
|
||||||
java.util.logging.Logger.getLogger(frmStorno.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
java.util.logging.Logger.getLogger(FrmStorno.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||||
} catch (IllegalAccessException ex) {
|
} catch (IllegalAccessException ex) {
|
||||||
java.util.logging.Logger.getLogger(frmStorno.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
java.util.logging.Logger.getLogger(FrmStorno.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||||
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
|
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
|
||||||
java.util.logging.Logger.getLogger(frmStorno.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
java.util.logging.Logger.getLogger(FrmStorno.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||||
}
|
}
|
||||||
//</editor-fold>
|
//</editor-fold>
|
||||||
|
//</editor-fold>
|
||||||
|
|
||||||
/* Create and display the form */
|
/* Create and display the form */
|
||||||
java.awt.EventQueue.invokeLater(new Runnable() {
|
java.awt.EventQueue.invokeLater(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
new frmStorno(null,0L,0L,null,false).setVisible(true);
|
new FrmStorno(null,0L,0L,null,false).setVisible(true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
139
src/puntocassa/utils/Utils.java
Normal file
139
src/puntocassa/utils/Utils.java
Normal file
@ -0,0 +1,139 @@
|
|||||||
|
/*
|
||||||
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||||
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
|
||||||
|
*/
|
||||||
|
package puntocassa.utils;
|
||||||
|
|
||||||
|
import java.sql.*;
|
||||||
|
import javax.swing.JOptionPane;
|
||||||
|
import puntocassa.PuntoCassa;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Francesco DS
|
||||||
|
*/
|
||||||
|
public class Utils {
|
||||||
|
|
||||||
|
public static boolean isNumeric(String s) {
|
||||||
|
return s.matches("[-+]?\\d*\\.?\\d+");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static String mySelect(String query, String campo, PuntoCassa puntoCassa) {
|
||||||
|
String res = "";
|
||||||
|
try {
|
||||||
|
Connection dbConnection = DriverManager.getConnection(puntoCassa.dbStringa, puntoCassa.dbUsername, puntoCassa.dbPassword);
|
||||||
|
Statement st = dbConnection.createStatement();
|
||||||
|
ResultSet rs = st.executeQuery(query);
|
||||||
|
while (rs.next()) {
|
||||||
|
|
||||||
|
res = rs.getString(campo);
|
||||||
|
}
|
||||||
|
rs.close();
|
||||||
|
st.close();
|
||||||
|
dbConnection.close();
|
||||||
|
} catch (SQLException e) {
|
||||||
|
JOptionPane.showMessageDialog(puntoCassa, "Errore MySelect ['" + e.getMessage() + " " + query + "']");
|
||||||
|
|
||||||
|
}
|
||||||
|
if (res == null) {
|
||||||
|
res = "";
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Boolean myInsert(String query, PuntoCassa puntoCassa) {
|
||||||
|
//System.out.println(query);
|
||||||
|
Boolean res = false;
|
||||||
|
try {
|
||||||
|
Connection dbConnection = DriverManager.getConnection(puntoCassa.dbStringa, puntoCassa.dbUsername, puntoCassa.dbPassword);
|
||||||
|
Statement st = dbConnection.createStatement();
|
||||||
|
ResultSet rs = st.executeQuery(query);
|
||||||
|
rs.close();
|
||||||
|
st.close();
|
||||||
|
dbConnection.close();
|
||||||
|
res = true;
|
||||||
|
} catch (Exception e) {
|
||||||
|
JOptionPane.showMessageDialog(puntoCassa, "Errore MySelect ['" + e.getMessage() + " " + query + "']");
|
||||||
|
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Long mySelectInteger(String query, String campo, PuntoCassa puntoCassa) {
|
||||||
|
System.out.println(query);
|
||||||
|
Long res = 0L;
|
||||||
|
try {
|
||||||
|
Connection dbConnection = DriverManager.getConnection(puntoCassa.dbStringa, puntoCassa.dbUsername, puntoCassa.dbPassword);
|
||||||
|
Statement st = dbConnection.createStatement();
|
||||||
|
ResultSet rs = st.executeQuery(query);
|
||||||
|
while (rs.next()) {
|
||||||
|
|
||||||
|
res = rs.getLong(campo);
|
||||||
|
}
|
||||||
|
rs.close();
|
||||||
|
st.close();
|
||||||
|
dbConnection.close();
|
||||||
|
} catch (SQLException e) {
|
||||||
|
JOptionPane.showMessageDialog(puntoCassa, "Errore MySelectInteger ['" + e.getMessage() + " " + query + "']");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static String spaziBianchi(String testo, Integer Num, Boolean suffisso) {
|
||||||
|
String res = testo;
|
||||||
|
StringBuilder suff = new StringBuilder();
|
||||||
|
if (testo.length() < Num) {
|
||||||
|
Integer delta = Num - testo.length();
|
||||||
|
for (Integer i = 0; i < delta; i++) {
|
||||||
|
suff.append(" ");
|
||||||
|
}
|
||||||
|
if (suffisso == false) {
|
||||||
|
res = suff.toString() + testo;
|
||||||
|
} else {
|
||||||
|
res = testo + suff.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String trovaScadenza(String testo) {
|
||||||
|
String scadenza = "";
|
||||||
|
String tag = "#";
|
||||||
|
Integer pi = testo.lastIndexOf(tag);
|
||||||
|
if (pi > 0) {
|
||||||
|
scadenza = testo.substring(pi - 9, pi - 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
return scadenza;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String luhn(String dati) {
|
||||||
|
|
||||||
|
Integer s = 0;
|
||||||
|
for (Integer i = 0; i < dati.length(); i++) {
|
||||||
|
Integer d = Integer.valueOf(dati.substring(i, i + 1));
|
||||||
|
if (i % 2 == 0) {
|
||||||
|
Integer doppio = d * 2;
|
||||||
|
if (doppio >= 10) {
|
||||||
|
doppio = 1 + (doppio % 10);
|
||||||
|
}
|
||||||
|
s = s + doppio;
|
||||||
|
} else {
|
||||||
|
s = s + d;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Integer resto = s % 10;
|
||||||
|
if (resto == 0) {
|
||||||
|
return "0";
|
||||||
|
} else {
|
||||||
|
Integer ris = 10 - resto;
|
||||||
|
return "" + ris;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user