Esempio n. 1
0
 private void logIn(int personId) {
   Connection con = getConnect();
   try {
     // MessageBox.infoBox("You have successfully logged in", "Login");
     // INSERT INTO LogInOut (PersonId, TimeIn) VALUES (1, NOW())
     String SQLLogin = "******" + personId + ", NOW())";
     Statement stmtLogin = con.createStatement();
     stmtLogin.executeUpdate(SQLLogin);
     Update_table();
   } catch (SQLException err) {
     MessageBox.infoBox(err.toString(), "Error");
   }
   closeConnect();
 }
Esempio n. 2
0
 private void logOut(int personId) {
   Connection con = getConnect();
   try {
     // MessageBox.infoBox("You have successfully logged out", "Logout");
     // UPDATE LogInOut SET TimeOut = NOW() WHERE PersonId = 1 AND TimeOut IS NULL
     String SQLLogin =
         "******"
             + personId
             + " AND TimeOut IS NULL";
     Statement stmtLogin = con.createStatement();
     stmtLogin.executeUpdate(SQLLogin);
     Update_table();
   } catch (SQLException err) {
     System.out.println(err);
     MessageBox.infoBox(err.toString(), "Error");
   }
   closeConnect();
 }
Esempio n. 3
0
 private void manualInputFocusGained(
     java.awt.event.FocusEvent evt) { // GEN-FIRST:event_manualInputFocusGained
   // TODO add your handling code here:
   Update_table();
 } // GEN-LAST:event_manualInputFocusGained
Esempio n. 4
0
 private void formWindowOpened(
     java.awt.event.WindowEvent evt) { // GEN-FIRST:event_formWindowOpened
   // TODO add your handling code here:
   Update_table();
 } // GEN-LAST:event_formWindowOpened