Пример #1
0
  private void jButtonAddRoomActionPerformed(
      java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButtonAddRoomActionPerformed
    // TODO add your handling code here:
    String roomNum = this.jTNumRoom.getText();
    String siteName = (String) this.selectSite.getSelectedItem();
    String roomType = (String) this.selectType.getSelectedItem();

    if (("".equals(roomNum))) {
      this.jLerr.setText("Vous avez oublié de remplir un champs");
      this.jLerr.setVisible(true);
    } else {
      // test nom salle non existant
      boolean exist = DBMana.roomExist(roomNum, siteName);
      if (!exist) {
        this.jLerr.setText("La salle " + roomNum + " existe déjà");
        this.jLerr.setVisible(true);
      } else {
        Room room = new Room(siteName, roomNum, roomType);
        DBMana.AddDBRoom(room);
        this.jLerr.setVisible(false);
        JFAddOk addOk = new JFAddOk("salle", "ajoutée");
        addOk.setVisible(true);
        this.setVisible(false);
      }
    }
  } // GEN-LAST:event_jButtonAddRoomActionPerformed
Пример #2
0
 private void jBOkActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jBOkActionPerformed
   // TODO add your handling code here:
   String devName = jTDevName.getText();
   String typeDev = (String) this.selectTypeDev.getSelectedItem();
   String os = (String) this.selectOs.getSelectedItem();
   String siteName = (String) this.selectSite.getSelectedItem();
   String numRoom = (String) this.selectRoom.getSelectedItem();
   if (("".equals(devName))) {
     this.jLerr.setText("Vous avez oublié de remplir un champs");
     this.jLerr.setVisible(true);
   } else {
     // test nom equipement d'interco non existant
     boolean exist = DBMana.devExist(devName);
     if (!exist) {
       this.jLerr.setText("L'équipement " + devName + " existe déjà");
       this.jLerr.setVisible(true);
     } else {
       Devices dev = new Devices(devName, typeDev, os, siteName, numRoom);
       DBMana.AddDBDev(dev);
       this.jLerr.setVisible(false);
       JFAddNetworkCard1 frameAddNC = new JFAddNetworkCard1(devName);
       frameAddNC.setVisible(true);
       this.setVisible(false);
     }
   }
 } // GEN-LAST:event_jBOkActionPerformed
Пример #3
0
 /** Creates new form JFAddDev */
 public JFAddDev() {
   initComponents();
   this.jLerr.setVisible(false);
   this.jLerr.setForeground(Color.red);
   DefaultComboBoxModel listSite = new DefaultComboBoxModel();
   listSite = DBMana.selectDBSite(listSite);
   selectSite.setModel(listSite);
   String siteName = (String) this.selectSite.getSelectedItem();
   DefaultComboBoxModel listRoom = new DefaultComboBoxModel();
   listRoom = DBMana.selectDBRoom(listRoom, siteName);
   selectRoom.setModel(listRoom);
   String os = (String) this.selectTypeDev.getSelectedItem();
   if ("Ordinateur".equals(os)) {
     DefaultComboBoxModel listOs = new DefaultComboBoxModel();
     listOs.addElement("OS x");
     listOs.addElement("Linux");
     listOs.addElement("Windows");
     selectOs.setModel(listOs);
   } else if ("Tablette".equals(os)) {
     DefaultComboBoxModel listOs = new DefaultComboBoxModel();
     listOs.addElement("iOS");
     listOs.addElement("Androïd");
     listOs.addElement("Windows");
     selectOs.setModel(listOs);
   }
 }
Пример #4
0
 private void selectSiteActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_selectSiteActionPerformed
   // TODO add your handling code here:
   String siteName = (String) this.selectSite.getSelectedItem();
   DefaultComboBoxModel listRoom = new DefaultComboBoxModel();
   listRoom = DBMana.selectDBRoom(listRoom, siteName);
   selectRoom.setModel(listRoom);
 } // GEN-LAST:event_selectSiteActionPerformed
Пример #5
0
 /** Creates new form JFAddSite */
 public JFAddRoom() {
   initComponents();
   this.setResizable(false);
   this.jLerr.setVisible(false);
   this.jLerr.setForeground(Color.red);
   DefaultComboBoxModel listSite = new DefaultComboBoxModel();
   listSite = DBMana.selectDBSite(listSite);
   selectSite.setModel(listSite);
 }