/**
  * @brief Affiche dans chaque champ de la boite de dialogue les informations de l'iPad passe en
  *     arametre
  * @param iPad {@link Ipad} dont les onformations sont recuperees
  */
 private void afficheChampsIpad(Ipad iPad) {
   this.txtSN.setText(iPad.getNumSerie());
   this.txtUdid.setText(iPad.getUdid());
   this.txtEtiquette.setText(iPad.getEtiquette());
   this.dtAchat.setDate(iPad.getDateAchat());
   this.txtDureeGarantie.setText(iPad.getDureeGarantie());
 }
  private void txtRfidKeyReleased(
      java.awt.event.KeyEvent evt) { // GEN-FIRST:event_txtRfidKeyReleased
    boolean rfidTrouve = false;
    int i = 0;
    if (this.txtRfid.getText().equals("")) {
      this.txtDureeGarantie.setText(null);
      this.txtUdid.setText(null);
      this.txtSN.setText(null);
      this.txtEtiquette.setText(null);
      this.dtAchat.setDate(null);
    } else if (evt.getKeyChar() == '\n') {
      // Recuperation de l'iPad avec ce champ RFID dans la BDD s'il existe
      // A activer seulement si un iPad a bien ete trouve
      // recherche dans la base de l'ipad
      this.rbFonctionnel.grabFocus();
      // Charger la liste d'Ipad depuis la BDD
      connexion_bdd bdd = new connexion_bdd();
      List<Ipad> listIpad = SQL_function.getListIpadsBDD(bdd.getserver().getstatement());

      if (!listIpad.isEmpty()) {
        // On recherche dans la liste l'iPad avec le code RFID entre dans la fenetre (normalemnt: 1
        // seul)
        while (i < listIpad.size() && !rfidTrouve) {
          Ipad iPadBDD = listIpad.get(i);
          if (iPadBDD.getRfid().equalsIgnoreCase(this.txtRfid.getText())) {
            this.iPad = iPadBDD;
            rfidTrouve = true;
          }
          i++;
        }
        if (rfidTrouve) {
          afficheChampsIpad(this.iPad);
          this.btnOK.setEnabled(true);

          // Recupere l'etat de l'iPad scanne dans la BDD
          this.etatIpad =
              SQL_function.getEtatIpad(bdd.getserver().getstatement(), this.iPad.getDbNum());
          if (this.etatIpad.equalsIgnoreCase("casse")) {
            this.rbCasse.setSelected(true);
          } else if (this.etatIpad.equalsIgnoreCase("manquant")) {
            this.rbManquant.setVisible(true);
            this.rbManquant.setSelected(true);
          } else {
            this.rbFonctionnel.setSelected(true);
          }
        } else {
          DialogueAvertissement warning =
              new DialogueAvertissement(this, true, "Le code RFID entré N'existe pas");
          warning.setVisible(true);
        }
      }

      // Fermes la connexon
      bdd.closeall();
    } else {
      this.btnOK.setEnabled(false);
    }
  } // GEN-LAST:event_txtRfidKeyReleased