UCA-1: find customers update

This commit is contained in:
2023-09-14 14:59:47 +01:00
parent cdc81b4517
commit cd95e2c7fd
6 changed files with 40 additions and 20 deletions
@@ -67,12 +67,12 @@ public class PreparedSentence extends JDBCSentence {
/** /**
* *
* @param s * @param session
* @param sentence * @param sentence
* @param serwrite * @param serwrite
*/ */
public PreparedSentence(Session s, String sentence, SerializerWrite serwrite) { public PreparedSentence(Session session, String sentence, SerializerWrite serwrite) {
this(s, sentence, serwrite, null); this(session, sentence, serwrite, null);
} }
/** /**
@@ -29,14 +29,14 @@ import com.unicenta.basic.BasicException;
*/ */
public abstract class SentenceExecTransaction implements SentenceExec { public abstract class SentenceExecTransaction implements SentenceExec {
private Session m_s; private Session session;
/** /**
* *
* @param s * @param session
*/ */
public SentenceExecTransaction(Session s) { public SentenceExecTransaction(Session session) {
m_s = s; this.session = session;
} }
/** /**
@@ -66,7 +66,7 @@ public abstract class SentenceExecTransaction implements SentenceExec {
*/ */
public final int exec(final Object params) throws BasicException { public final int exec(final Object params) throws BasicException {
Transaction<Integer> t = new Transaction<Integer>(m_s) { Transaction<Integer> t = new Transaction<Integer>(session) {
public Integer transact() throws BasicException{ public Integer transact() throws BasicException{
return execInTransaction(params); return execInTransaction(params);
} }
@@ -61,6 +61,14 @@ public class JRootFrame extends javax.swing.JFrame implements AppMessage {
initComponents(); initComponents();
} }
public JRootApp getRootapp() {
return m_rootapp;
}
public void setRootapp(JRootApp m_rootapp) {
this.m_rootapp = m_rootapp;
}
/** /**
* @param props * @param props
*/ */
@@ -98,6 +106,7 @@ public class JRootFrame extends javax.swing.JFrame implements AppMessage {
new JFrmConfig(props).setVisible(true); // Show the configuration window. new JFrmConfig(props).setVisible(true); // Show the configuration window.
} }
setRootapp(m_rootapp);
} }
/** /**
@@ -58,6 +58,14 @@ public class JRootKiosk extends javax.swing.JFrame implements AppMessage {
initComponents(); initComponents();
} }
public JRootApp getRootapp() {
return m_rootapp;
}
public void setRootapp(JRootApp m_rootapp) {
this.m_rootapp = m_rootapp;
}
/** /**
* *
* @param props * @param props
@@ -86,12 +94,12 @@ public class JRootKiosk extends javax.swing.JFrame implements AppMessage {
Dimension d = Toolkit.getDefaultToolkit().getScreenSize(); Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
setBounds(0, 0, d.width, d.height); setBounds(0, 0, d.width, d.height);
/* /*
* 4 Sep 17 JG * 4 Sep 17 JG
* 2 Dec 17 - Mod' Thanks Hayk Sokolov! * 2 Dec 17 - Mod' Thanks Hayk Sokolov!
* Change here for Linux/Ubuntu full screen * Change here for Linux/Ubuntu full screen
* Thanks to Hans Lengerke for solution * Thanks to Hans Lengerke for solution
*/ */
String osName = System.getProperty("os.name").toLowerCase(); String osName = System.getProperty("os.name").toLowerCase();
boolean isWindows = osName.startsWith("windows"); boolean isWindows = osName.startsWith("windows");
@@ -121,7 +129,8 @@ public class JRootKiosk extends javax.swing.JFrame implements AppMessage {
"Connection", JOptionPane.INFORMATION_MESSAGE); "Connection", JOptionPane.INFORMATION_MESSAGE);
new JFrmConfig(props).setVisible(true); // Show the configuration window. new JFrmConfig(props).setVisible(true); // Show the configuration window.
} }
setRootapp(m_rootapp);
} }
@Override @Override
@@ -98,7 +98,6 @@ public class StartPOS {
String hostname = config.getProperty("machine.hostname"); String hostname = config.getProperty("machine.hostname");
TicketInfo.setHostname(hostname); TicketInfo.setHostname(hostname);
applicationStarted(hostname);
String screenmode = config.getProperty("machine.screenmode"); String screenmode = config.getProperty("machine.screenmode");
@@ -106,6 +105,8 @@ public class StartPOS {
JRootKiosk rootkiosk = new JRootKiosk(); JRootKiosk rootkiosk = new JRootKiosk();
try { try {
rootkiosk.initFrame(config); rootkiosk.initFrame(config);
applicationStarted(hostname, rootkiosk.getRootapp());
} catch (IOException ex) { } catch (IOException ex) {
log.error(ex.getMessage()); log.error(ex.getMessage());
} }
@@ -113,13 +114,14 @@ public class StartPOS {
JRootFrame rootframe = new JRootFrame(); JRootFrame rootframe = new JRootFrame();
try { try {
rootframe.initFrame(config); rootframe.initFrame(config);
applicationStarted(hostname, rootframe.getRootapp());
} catch (Exception ex) { } catch (Exception ex) {
log.error(ex.getMessage()); log.error(ex.getMessage());
} }
} }
}); });
} }
private static void applicationStarted(String host) { private static void applicationStarted(String host, JRootApp jRootApp) {
new Thread(() -> { new Thread(() -> {
try { try {
Metrics metrics = new Metrics(); Metrics metrics = new Metrics();
@@ -79,14 +79,14 @@ public final class TicketInfo implements SerializableRead, Externalizable {
private Double nsum; private Double nsum;
private int ticketstatus; private int ticketstatus;
private static String Hostname; private static String hostname;
public static void setHostname(String name) { public static void setHostname(String name) {
Hostname=name; hostname =name;
} }
public static String getHostname() { public static String getHostname() {
return Hostname; return hostname;
} }
/** Creates new TicketModel */ /** Creates new TicketModel */