Update StolowkaZPM.java

This commit is contained in:
s441433 2019-01-11 04:49:26 +01:00
parent 76d923c5ab
commit d65a16dc3a

View File

@ -39,9 +39,11 @@ public class StolowkaZPM {
});
}
Connection conn=null;
protected String imie;
protected String IDuzytkownika;
protected int IDuzytkownika;
public StolowkaZPM() {
initialize1();
@ -60,10 +62,6 @@ public class StolowkaZPM {
});
//Dimension size = Toolkit.getDefaultToolkit().getScreenSize();
//int x = (int) ((size.getWidth() - frmStowkaZpm.getWidth()) / 2);
//int y = (int) ((size.getHeight() - frmStowkaZpm.getHeight()) / 2);
//frmStowkaZpm.setLocation(x, y);
frmStolowkaZpm.setTitle("Sto\u0142\u00F3wka ZPM");
frmStolowkaZpm.setBounds(1, 1, 499, 356);
@ -75,12 +73,6 @@ public class StolowkaZPM {
int ysize = (int) tk.getScreenSize().getHeight();
frmStolowkaZpm.setSize(xsize, ysize);
/*
lblNewLabel_1 = new JLabel("New label");
Image img = new ImageIcon(this.getClass().getResource("/icon.png")).getImage();
lblNewLabel_1.setIcon(new ImageIcon(img));
frmStolowkaZpm.getContentPane().add(lblNewLabel_1);
*/
lblNewLabel = new JLabel("\"Sto\u0142\u00F3wka ZPM\"");
lblNewLabel.setFont(new Font("Tahoma", Font.PLAIN, 70));
@ -129,7 +121,8 @@ public class StolowkaZPM {
ResultSet rFID = pst.executeQuery();
String Dalej = rFID.getString("PIN");
imie = rFID.getString("User");
IDuzytkownika = rFID.getString("IDusers");
IDuzytkownika = rFID.getInt("IDusers");
//JOptionPane.showMessageDialog(null, IDuzytkownika);
int count = 0;
while (rFID.next()) {
count=count+1;
@ -138,31 +131,6 @@ public class StolowkaZPM {
rfidView.setText(imie);
//JOptionPane.showMessageDialog(frmStolowkaZpm, "Zalogowano!");
//JOptionPane.showMessageDialog(frmStolowkaZpm, Dalej);
//oknoPIN wpiszPin = new oknoPIN();
//wpiszPin.noweOkno();
//frmStolowkaZpm.remove(lblZbliKartDo);
//frmStolowkaZpm.remove(rfidView);
/*
JLabel podajPINlabel = new JLabel("PODAJ PIN (4 CYFRY)");
podajPINlabel.setHorizontalAlignment(SwingConstants.CENTER);
frmStolowkaZpm.getContentPane().add(podajPINlabel);
podajPINlabel.setFont(new Font("Tahoma", Font.PLAIN, 40));
JPasswordField pinView = new JPasswordField();
pinView.setHorizontalAlignment(SwingConstants.CENTER);
frmStolowkaZpm.getContentPane().add(pinView);
pinView.setFont(new Font("Tahoma", Font.PLAIN, 50));
pinView.setToolTipText("PIN");
JButton btnZaloguj = new JButton("Zaloguj");
btnZaloguj.setFont(new Font("Tahoma", Font.PLAIN, 50));
btnZaloguj.setBounds(724, 298, 213, 69);
frmStolowkaZpm.getContentPane().add(btnZaloguj);
*/
btnZaloguj.addActionListener(new ActionListener() {
@SuppressWarnings("deprecation")
public void actionPerformed(ActionEvent e) {
@ -175,52 +143,19 @@ public class StolowkaZPM {
if(Dalej.equals(Dalej1)){
rFID.close();
pst.close();
DrukujBilet wybierzMenu = new DrukujBilet();
wybierzMenu.oknoDrukujBilet();
}else{
//JOptionPane.showMessageDialog(frmStolowkaZpm, Dalej1);
//JOptionPane.showMessageDialog(frmStolowkaZpm, Dalej);
}
} catch (Exception e1){
JOptionPane.showMessageDialog(null, e1);
pinView.setText("");
}
/*
try {
String query2 = "SELECT * FROM users WHERE RFID=? and Password=?";
PreparedStatement pst2 = conn.prepareStatement(query2);
pst2.setString(1, rfidView.getText());
pst2.setString(2, pinView.getText());
ResultSet pass2 = pst2.executeQuery();
//JOptionPane.showMessageDialog(frmStolowkaZpm, rfidView.getText());
//JOptionPane.showMessageDialog(frmStolowkaZpm, pinView.getText());
int count2 = 0;
while (pass2.next()) {
count2=count2+1;
}
if (count2 == 1) {
pinView.setText("");
JOptionPane.showMessageDialog(frmStolowkaZpm, "Zalogowano!");
//frmStolowkaZpm.setVisible(false);
DrukujBilet wybierzMenu = new DrukujBilet();
wybierzMenu.oknoDrukujBilet();
} else {
pinView.setText("");
JOptionPane.showMessageDialog(frmStolowkaZpm, "NIE Zalogowano!");
}
pass2.close();
pst2.close();
} catch (Exception e1){
JOptionPane.showMessageDialog(null, e1);
pinView.setText("");
}
}
*/
}});
} else {