Ejemplo n.º 1
0
  private void guncelleActionPerformed(
      java.awt.event.ActionEvent evt) { // GEN-FIRST:event_guncelleActionPerformed
    db.dbBaglan();
    String sql2 =
        ("UPDATE SERVIS SET SERVIS ='"
            + yeniServiAdi.getText()
            + "', UCRET = "
            + Integer.valueOf(yeniServisUcret.getText())
            + " WHERE SERVIS_ID= "
            + servis_id
            + "");
    try {
      PreparedStatement ps = con.prepareStatement(sql2);

      if (ps.executeUpdate() != 0) {
        JOptionPane.showMessageDialog(null, "\"Mesaj\", \"Veri Başarıyla Güncellendi!");

      } else {
        JOptionPane.showMessageDialog(null, "\"Mesaj\", \"Hata Oluştu!");
      }
      sifirlaActionPerformed(evt);
      con.close();
    } catch (SQLException ex) {
      Logger.getLogger(gorevEkle.class.getName()).log(Level.SEVERE, null, ex);
    }
  } // GEN-LAST:event_guncelleActionPerformed
Ejemplo n.º 2
0
  private void silActionPerformed(
      java.awt.event.ActionEvent evt) { // GEN-FIRST:event_silActionPerformed
    db.dbBaglan();
    String sql2 = ("DELETE FROM SERVIS WHERE SERVIS_ID= " + servis_id + "");
    try {
      PreparedStatement ps = con.prepareStatement(sql2);

      if (ps.executeUpdate() != 0) {
        JOptionPane.showMessageDialog(null, "\"Mesaj\", \"Veri Başarıyla silindi!");

      } else {
        JOptionPane.showMessageDialog(null, "\"Mesaj\", \"Hata Oluştu!");
      }
      sifirlaActionPerformed(evt);
      con.close();
    } catch (SQLException ex) {
      Logger.getLogger(gorevEkle.class.getName()).log(Level.SEVERE, null, ex);
    }
  } // GEN-LAST:event_silActionPerformed
Ejemplo n.º 3
0
 private void servisTablosuMouseClicked(
     java.awt.event.MouseEvent evt) { // GEN-FIRST:event_servisTablosuMouseClicked
   try {
     db.dbBaglan();
     sil.setEnabled(true);
     String gorevSql = " Select * From SERVIS ";
     PreparedStatement ps =
         con.prepareStatement(
             gorevSql, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
     ps.executeQuery();
     ps.getResultSet().absolute(servisTablosu.getSelectedRow() + 1);
     yeniServiAdi.setText(ps.getResultSet().getString("SERVIS"));
     yeniServisUcret.setText(ps.getResultSet().getString("UCRET"));
     servis_id = ps.getResultSet().getString("SERVIS_ID");
     sifirla.setEnabled(true);
     con.close();
   } catch (SQLException ex) {
     Logger.getLogger(personelİslemleri.class.getName()).log(Level.SEVERE, null, ex);
   }
   guncelle.setEnabled(true);
 } // GEN-LAST:event_servisTablosuMouseClicked
Ejemplo n.º 4
0
 private void servisEkleActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_servisEkleActionPerformed
   String servisAdi = yeniServiAdi.getText();
   String servisUcreti = yeniServisUcret.getText();
   db.dbBaglan();
   try {
     String sql = ("INSERT INTO SERVIS (SERVIS,UCRET) VALUES (?,?)");
     PreparedStatement ps = con.prepareStatement(sql);
     ps.setString(1, servisAdi);
     ps.setString(2, servisUcreti);
     if (sayiMi(servisUcreti)) {
       ps.executeUpdate();
     } else {
       JOptionPane.showMessageDialog(null, "Lütfen Ücrete Sayısal Bir Değer Giriniz!");
     }
     con.close();
   } catch (SQLException ex) {
     Logger.getLogger(hizmetler.class.getName()).log(Level.SEVERE, null, ex);
   }
   sifirlaActionPerformed(evt);
 } // GEN-LAST:event_servisEkleActionPerformed