Compare commits
2 Commits
Java.medhi
...
35043c5d54
Author | SHA1 | Date | |
---|---|---|---|
35043c5d54 | |||
3eca7c4d6a |
38
GSBapplication/src/Metier/famille.java
Normal file
38
GSBapplication/src/Metier/famille.java
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
/*
|
||||||
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||||
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
|
||||||
|
*/
|
||||||
|
package Metier;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author medhi.rodrigues
|
||||||
|
*/
|
||||||
|
public class famille {
|
||||||
|
/**
|
||||||
|
* l'identifiant permettant de connaitre la famille du m<>dicament
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/** LE CONSTRUCTEUR DEFAULT
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
public famille(String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
// LES SETTEUR
|
||||||
|
/**
|
||||||
|
* @return the id
|
||||||
|
*/
|
||||||
|
public String getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "famille{" + "id=" + id + '}';
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -8,6 +8,7 @@ import java.sql.Connection;
|
|||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.sql.Statement;
|
import java.sql.Statement;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -22,16 +23,16 @@ public class praticienSQL {
|
|||||||
connexionTest = connexionSQL.getConnect("10.121.38.75","bdgsb","adminGSB","mdpGSB");
|
connexionTest = connexionSQL.getConnect("10.121.38.75","bdgsb","adminGSB","mdpGSB");
|
||||||
}
|
}
|
||||||
|
|
||||||
public String[] rechercherPraticien(String login, String mdp) {
|
public ArrayList<String> rechercherPraticien(String login, String mdp) {
|
||||||
String[] praticienCherche = new String [2];
|
ArrayList<String> praticienCherche = new ArrayList<String>();
|
||||||
try {
|
try {
|
||||||
stmt = connexionTest.createStatement();
|
stmt = connexionTest.createStatement();
|
||||||
// Acc<63>s <20> la table
|
// Acc<63>s <20> la table
|
||||||
result = stmt.executeQuery("SELECT * FROM PRATICIENLOG WHERE id='"+login+
|
result = stmt.executeQuery("SELECT * FROM PRATICIENLOG WHERE id='"+login+
|
||||||
"' AND mdp='"+mdp + "';");
|
"' AND mdp='"+mdp + "';");
|
||||||
if (result.next()) { // Le praticien a <20>t<EFBFBD> touv<75>
|
if (result.next()) { // Le praticien a <20>t<EFBFBD> touv<75>
|
||||||
praticienCherche[0] = result.getString(1);
|
praticienCherche.add(result.getString(1));
|
||||||
praticienCherche[1] = result.getString(2);
|
praticienCherche.add(result.getString(2));
|
||||||
|
|
||||||
}
|
}
|
||||||
result.close();
|
result.close();
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
package presentation;
|
package presentation;
|
||||||
|
|
||||||
import acces_aux_donnes.praticienSQL;
|
import acces_aux_donnes.praticienSQL;
|
||||||
import javax.swing.JOptionPane;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -160,12 +160,12 @@ public class jffConnexion extends javax.swing.JFrame {
|
|||||||
String identifiant = jTFIdentifiant.getText();
|
String identifiant = jTFIdentifiant.getText();
|
||||||
String mdp = String.valueOf(jPFmdp.getPassword());
|
String mdp = String.valueOf(jPFmdp.getPassword());
|
||||||
praticienSQL testPraticien = new praticienSQL();
|
praticienSQL testPraticien = new praticienSQL();
|
||||||
String [] lePraticien = testPraticien.rechercherPraticien(identifiant,mdp);
|
ArrayList<String>lePraticien = testPraticien.rechercherPraticien(identifiant,mdp);
|
||||||
if (lePraticien[0] != null){
|
if (lePraticien.get(0) != null){
|
||||||
System.out.print("TEST REUSSIE");
|
System.out.print("TEST REUSSIE");
|
||||||
JOptionPane.showMessageDialog(null,"Bienvenue" + lePraticien[1]);
|
new jffFamilleMedoc().setVisible(true);
|
||||||
}else {
|
}else {
|
||||||
JOptionPane.showMessageDialog(null, "Erreur d'authentification, veuillez r<>esayer");
|
System.out.print("TEST EMILE RACISTE");
|
||||||
}
|
}
|
||||||
}//GEN-LAST:event_jBValiderActionPerformed
|
}//GEN-LAST:event_jBValiderActionPerformed
|
||||||
|
|
||||||
|
@@ -1,48 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
|
||||||
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
|
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
|
||||||
<NonVisualComponents>
|
|
||||||
<Menu class="javax.swing.JMenuBar" name="jMenuBar1">
|
|
||||||
<SubComponents>
|
|
||||||
<Menu class="javax.swing.JMenu" name="jMenu1">
|
|
||||||
<Properties>
|
|
||||||
<Property name="text" type="java.lang.String" value="File"/>
|
|
||||||
</Properties>
|
|
||||||
<SubComponents>
|
|
||||||
<MenuItem class="javax.swing.JMenuItem" name="jMIAPropos">
|
|
||||||
<Properties>
|
|
||||||
<Property name="text" type="java.lang.String" value="à propos"/>
|
|
||||||
</Properties>
|
|
||||||
<Events>
|
|
||||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMIAProposActionPerformed"/>
|
|
||||||
</Events>
|
|
||||||
</MenuItem>
|
|
||||||
<MenuItem class="javax.swing.JMenuItem" name="jMIQuitter">
|
|
||||||
<Properties>
|
|
||||||
<Property name="accelerator" type="javax.swing.KeyStroke" editor="org.netbeans.modules.form.editors.KeyStrokeEditor">
|
|
||||||
<KeyStroke key="Alt+F4"/>
|
|
||||||
</Property>
|
|
||||||
<Property name="text" type="java.lang.String" value="Quitter"/>
|
|
||||||
</Properties>
|
|
||||||
<Events>
|
|
||||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMIQuitterActionPerformed"/>
|
|
||||||
</Events>
|
|
||||||
</MenuItem>
|
|
||||||
</SubComponents>
|
|
||||||
</Menu>
|
|
||||||
<Menu class="javax.swing.JMenu" name="jMenu2">
|
|
||||||
<Properties>
|
|
||||||
<Property name="text" type="java.lang.String" value="Edit"/>
|
|
||||||
</Properties>
|
|
||||||
</Menu>
|
|
||||||
</SubComponents>
|
|
||||||
</Menu>
|
|
||||||
</NonVisualComponents>
|
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="defaultCloseOperation" type="int" value="3"/>
|
<Property name="defaultCloseOperation" type="int" value="3"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
<SyntheticProperties>
|
<SyntheticProperties>
|
||||||
<SyntheticProperty name="menuBar" type="java.lang.String" value="jMenuBar1"/>
|
|
||||||
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
||||||
<SyntheticProperty name="generateCenter" type="boolean" value="false"/>
|
<SyntheticProperty name="generateCenter" type="boolean" value="false"/>
|
||||||
</SyntheticProperties>
|
</SyntheticProperties>
|
||||||
@@ -113,7 +75,7 @@
|
|||||||
<Component id="jCBFamille" alignment="3" min="-2" max="-2" attributes="0"/>
|
<Component id="jCBFamille" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
<Component id="jCBMedocListe" alignment="3" min="-2" max="-2" attributes="0"/>
|
<Component id="jCBMedocListe" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
<EmptySpace pref="264" max="32767" attributes="0"/>
|
<EmptySpace pref="287" max="32767" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
|
@@ -10,7 +10,6 @@ import acces_aux_donnes.familleMedocSQL;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
import javax.swing.DefaultComboBoxModel;
|
import javax.swing.DefaultComboBoxModel;
|
||||||
import javax.swing.JOptionPane;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -42,11 +41,6 @@ public class jffFamilleMedoc extends javax.swing.JFrame {
|
|||||||
jBRechercheValide = new javax.swing.JButton();
|
jBRechercheValide = new javax.swing.JButton();
|
||||||
jCBFamille = new javax.swing.JComboBox<>();
|
jCBFamille = new javax.swing.JComboBox<>();
|
||||||
jCBMedocListe = new javax.swing.JComboBox<>();
|
jCBMedocListe = new javax.swing.JComboBox<>();
|
||||||
jMenuBar1 = new javax.swing.JMenuBar();
|
|
||||||
jMenu1 = new javax.swing.JMenu();
|
|
||||||
jMIAPropos = new javax.swing.JMenuItem();
|
|
||||||
jMIQuitter = new javax.swing.JMenuItem();
|
|
||||||
jMenu2 = new javax.swing.JMenu();
|
|
||||||
|
|
||||||
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
|
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
|
||||||
|
|
||||||
@@ -81,32 +75,6 @@ public class jffFamilleMedoc extends javax.swing.JFrame {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
jMenu1.setText("File");
|
|
||||||
|
|
||||||
jMIAPropos.setText("<EFBFBD> propos");
|
|
||||||
jMIAPropos.addActionListener(new java.awt.event.ActionListener() {
|
|
||||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
||||||
jMIAProposActionPerformed(evt);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
jMenu1.add(jMIAPropos);
|
|
||||||
|
|
||||||
jMIQuitter.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F4, java.awt.event.InputEvent.ALT_DOWN_MASK));
|
|
||||||
jMIQuitter.setText("Quitter");
|
|
||||||
jMIQuitter.addActionListener(new java.awt.event.ActionListener() {
|
|
||||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
||||||
jMIQuitterActionPerformed(evt);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
jMenu1.add(jMIQuitter);
|
|
||||||
|
|
||||||
jMenuBar1.add(jMenu1);
|
|
||||||
|
|
||||||
jMenu2.setText("Edit");
|
|
||||||
jMenuBar1.add(jMenu2);
|
|
||||||
|
|
||||||
setJMenuBar(jMenuBar1);
|
|
||||||
|
|
||||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
|
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
|
||||||
getContentPane().setLayout(layout);
|
getContentPane().setLayout(layout);
|
||||||
layout.setHorizontalGroup(
|
layout.setHorizontalGroup(
|
||||||
@@ -150,7 +118,7 @@ public class jffFamilleMedoc extends javax.swing.JFrame {
|
|||||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
.addComponent(jCBFamille, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
.addComponent(jCBFamille, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
.addComponent(jCBMedocListe, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
.addComponent(jCBMedocListe, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||||
.addContainerGap(264, Short.MAX_VALUE))
|
.addContainerGap(287, Short.MAX_VALUE))
|
||||||
);
|
);
|
||||||
|
|
||||||
pack();
|
pack();
|
||||||
@@ -178,7 +146,8 @@ public class jffFamilleMedoc extends javax.swing.JFrame {
|
|||||||
|
|
||||||
|
|
||||||
}else {
|
}else {
|
||||||
JOptionPane.showMessageDialog(null,"Erreur, Veuillez r<>esayer"); }
|
//ajout d'un JoptionPane
|
||||||
|
}
|
||||||
}//GEN-LAST:event_jBRechercheValideActionPerformed
|
}//GEN-LAST:event_jBRechercheValideActionPerformed
|
||||||
|
|
||||||
private void jCBFamilleActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCBFamilleActionPerformed
|
private void jCBFamilleActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCBFamilleActionPerformed
|
||||||
@@ -212,14 +181,6 @@ public class jffFamilleMedoc extends javax.swing.JFrame {
|
|||||||
}
|
}
|
||||||
}//GEN-LAST:event_jCBMedocListeActionPerformed
|
}//GEN-LAST:event_jCBMedocListeActionPerformed
|
||||||
|
|
||||||
private void jMIAProposActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIAProposActionPerformed
|
|
||||||
JOptionPane.showMessageDialog(null,"Fait par Medhi et un Raciste");
|
|
||||||
}//GEN-LAST:event_jMIAProposActionPerformed
|
|
||||||
|
|
||||||
private void jMIQuitterActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIQuitterActionPerformed
|
|
||||||
System.exit(0);
|
|
||||||
}//GEN-LAST:event_jMIQuitterActionPerformed
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param args the command line arguments
|
* @param args the command line arguments
|
||||||
*/
|
*/
|
||||||
@@ -261,11 +222,6 @@ public class jffFamilleMedoc extends javax.swing.JFrame {
|
|||||||
private javax.swing.JComboBox<String> jCBMedocListe;
|
private javax.swing.JComboBox<String> jCBMedocListe;
|
||||||
private javax.swing.JLabel jLRecherche;
|
private javax.swing.JLabel jLRecherche;
|
||||||
private javax.swing.JLabel jLabel1;
|
private javax.swing.JLabel jLabel1;
|
||||||
private javax.swing.JMenuItem jMIAPropos;
|
|
||||||
private javax.swing.JMenuItem jMIQuitter;
|
|
||||||
private javax.swing.JMenu jMenu1;
|
|
||||||
private javax.swing.JMenu jMenu2;
|
|
||||||
private javax.swing.JMenuBar jMenuBar1;
|
|
||||||
private javax.swing.JTextField jTFRecherche;
|
private javax.swing.JTextField jTFRecherche;
|
||||||
// End of variables declaration//GEN-END:variables
|
// End of variables declaration//GEN-END:variables
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user