1 Commits

Author SHA1 Message Date
medhi.rodrigues
e39b7469bc EMILE pointeur 2025-03-13 14:03:25 +01:00
12 changed files with 94 additions and 528 deletions

View File

@@ -1,38 +0,0 @@
/*
* 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 + '}';
}
}

View File

@@ -19,7 +19,7 @@ public class MedicamentSQL {
private ResultSet result = null;
public MedicamentSQL() {
connexionTest = connexionSQL.getConnect("10.121.38.69","bdgsb","appliGSB","(Uq1XV0Tr01s2H9Z");
connexionTest = connexionSQL.getConnect("10.121.38.75","bdgsb","adminGSB","mdpGSB");
}
public ArrayList<String> rechercherMedicament (String nomCo){

View File

@@ -21,7 +21,7 @@ public class familleMedocSQL {
private ResultSet result = null;
public familleMedocSQL(){
connexionTest = connexionSQL.getConnect("10.121.38.69","bdgsb","appliGSB","(Uq1XV0Tr01s2H9Z");
connexionTest = connexionSQL.getConnect("10.121.38.75","bdgsb","adminGSB","mdpGSB");
}
public Vector<String> rechercheFamille(){

View File

@@ -4,12 +4,10 @@
*/
package acces_aux_donnes;
import java.lang.reflect.Array;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
/**
*
@@ -21,7 +19,7 @@ public class observationSQL {
private ResultSet result = null;
public observationSQL() {
connexionTest = connexionSQL.getConnect("10.121.38.69","bdgsb","appliGSB","(Uq1XV0Tr01s2H9Z");
connexionTest = connexionSQL.getConnect("10.121.38.75","bdgsb","adminGSB","mdpGSB");
}
public int compterLignes(){
@@ -62,21 +60,4 @@ public class observationSQL {
}
return passer;
}
public ArrayList<String> selectionObservation(String idMedoc){
ArrayList<String> observationMedoc = new ArrayList<String>();
try {
stmt = connexionTest.createStatement();
// Acc<63>s <20> la table
result = stmt.executeQuery("SELECT observation FROM OBSERVATION WHERE idMedoc ='" + idMedoc +"';");
while (result.next()){
observationMedoc.add(result.getString(1));
}
}catch(SQLException ex) {
System.out.println("SQLException : " + ex.getMessage());
System.out.println("SQLState : " + ex.getSQLState());
System.out.println("Code erreur : " + ex.getErrorCode());
}
return observationMedoc;
}
}

View File

@@ -8,7 +8,6 @@ import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
/**
*
@@ -20,19 +19,19 @@ public class praticienSQL {
private ResultSet result = null;
public praticienSQL() {
connexionTest = connexionSQL.getConnect("10.121.38.69","bdgsb","appliGSB","(Uq1XV0Tr01s2H9Z");
connexionTest = connexionSQL.getConnect("10.121.38.75","bdgsb","adminGSB","mdpGSB");
}
public ArrayList<String> rechercherPraticien(String login, String mdp) {
ArrayList<String> praticienCherche = new ArrayList<String>();
public String[] rechercherPraticien(String login, String mdp) {
String[] praticienCherche = new String [2];
try {
stmt = connexionTest.createStatement();
// Acc<63>s <20> la table
result = stmt.executeQuery("SELECT * FROM PRATICIENLOG WHERE id='"+login+
"' AND mdp='"+mdp + "';");
if (result.next()) { // Le praticien a <20>t<EFBFBD> touv<75>
praticienCherche.add(result.getString(1));
praticienCherche.add(result.getString(2));
praticienCherche[0] = result.getString(1);
praticienCherche[1] = result.getString(2);
}
result.close();

View File

@@ -1,51 +0,0 @@
/*
* 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 acces_aux_donnes;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
/**
*
* @author medhi.rodrigues
*/
public class visiteurSQL {
private Connection connexionTest;
private Statement stmt = null;
private ResultSet result = null;
public visiteurSQL() {
connexionTest = connexionSQL.getConnect("10.121.38.69","bdgsb","appliGSB","(Uq1XV0Tr01s2H9Z");
}
public ArrayList<String> rechercherVisiteur(String login, String mdp) {
ArrayList<String> visiteurCherche = new ArrayList<String>();
try {
stmt = connexionTest.createStatement();
// Acc<63>s <20> la table
result = stmt.executeQuery("SELECT * FROM VISITEUR WHERE vNom='"+login+
"' AND vMdp='"+mdp + "';");
if (result.next()) { // Le praticien a <20>t<EFBFBD> touv<75>
visiteurCherche.add(result.getString(1));
visiteurCherche.add(result.getString(2));
System.out.println(visiteurCherche.add(result.getString(1)));
}
result.close();
stmt.close();
} catch (SQLException ex) {
System.out.println("SQLException : " + ex.getMessage());
System.out.println("SQLState : " + ex.getSQLState());
System.out.println("Code erreur : " + ex.getErrorCode());
}
return visiteurCherche;
}
}

View File

@@ -5,8 +5,6 @@
package presentation;
import acces_aux_donnes.praticienSQL;
import acces_aux_donnes.visiteurSQL;
import java.util.ArrayList;
import javax.swing.JOptionPane;
/**
@@ -159,32 +157,16 @@ public class jffConnexion extends javax.swing.JFrame {
}//GEN-LAST:event_jPFmdpActionPerformed
private void jBValiderActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBValiderActionPerformed
if(this.profession == 0){
String identifiant = jTFIdentifiant.getText();
String mdp = String.valueOf(jPFmdp.getPassword());
praticienSQL testPraticien = new praticienSQL();
ArrayList<String>lePraticien = testPraticien.rechercherPraticien(identifiant,mdp);
if (!lePraticien.isEmpty()){
new jffFamilleMedoc(this.profession).setVisible(true);
}else {
JOptionPane.showMessageDialog(null,"Erreur de connexion, Veuillez recommencer");
}
}else{
String identifiant = jTFIdentifiant.getText();
String mdp = String.valueOf(jPFmdp.getPassword());
visiteurSQL testVisiteur = new visiteurSQL();
ArrayList<String>leVisiteur = testVisiteur.rechercherVisiteur(identifiant,mdp);
System.out.println(leVisiteur.get(0));
if (leVisiteur.get(0) != null){
new jffFamilleMedoc(this.profession).setVisible(true);
}else {
leVisiteur.add("12");
//JOptionPane.showMessageDialog(null,"Erreur de connexion, Veuillez recommencer");
}
}
this.setVisible(false);
String identifiant = jTFIdentifiant.getText();
String mdp = String.valueOf(jPFmdp.getPassword());
praticienSQL testPraticien = new praticienSQL();
String [] lePraticien = testPraticien.rechercherPraticien(identifiant,mdp);
if (lePraticien[0] != null){
System.out.print("TEST REUSSIE");
JOptionPane.showMessageDialog(null,"Bienvenue" + lePraticien[1]);
}else {
JOptionPane.showMessageDialog(null, "Erreur d'authentification, veuillez r<EFBFBD>esayer");
}
}//GEN-LAST:event_jBValiderActionPerformed
/**
@@ -217,6 +199,7 @@ public class jffConnexion extends javax.swing.JFrame {
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new jffConnexion(1).setVisible(true);
}
});
}

View File

@@ -4,48 +4,36 @@
<NonVisualComponents>
<Menu class="javax.swing.JMenuBar" name="jMenuBar1">
<SubComponents>
<Menu class="javax.swing.JMenu" name="jMPage">
<Menu class="javax.swing.JMenu" name="jMenu1">
<Properties>
<Property name="text" type="java.lang.String" value="Page"/>
<Property name="text" type="java.lang.String" value="File"/>
</Properties>
<SubComponents>
<MenuItem class="javax.swing.JMenuItem" name="jMIProfession">
<MenuItem class="javax.swing.JMenuItem" name="jMIAPropos">
<Properties>
<Property name="text" type="java.lang.String" value="Choix M&#xe9;tier"/>
<Property name="text" type="java.lang.String" value="&#xe0; propos"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMIProfessionActionPerformed"/>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMIAProposActionPerformed"/>
</Events>
</MenuItem>
<MenuItem class="javax.swing.JMenuItem" name="jMIFamille">
<MenuItem class="javax.swing.JMenuItem" name="jMIQuitter">
<Properties>
<Property name="text" type="java.lang.String" value="Famille Medicament"/>
<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="jMIFamilleActionPerformed"/>
<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="jMInfo">
<Menu class="javax.swing.JMenu" name="jMenu2">
<Properties>
<Property name="text" type="java.lang.String" value="Info"/>
<Property name="text" type="java.lang.String" value="Edit"/>
</Properties>
<SubComponents>
<MenuItem class="javax.swing.JMenuItem" name="jMIguide">
<Properties>
<Property name="text" type="java.lang.String" value="Guide"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMIguideActionPerformed"/>
</Events>
</MenuItem>
<MenuItem class="javax.swing.JMenuItem" name="jMcredit">
<Properties>
<Property name="text" type="java.lang.String" value="Cr&#xe9;dit"/>
</Properties>
</MenuItem>
</SubComponents>
</Menu>
</SubComponents>
</Menu>

View File

@@ -17,12 +17,11 @@ import javax.swing.JOptionPane;
* @author emile.lalorcey
*/
public class jffFamilleMedoc extends javax.swing.JFrame {
int metier;
/**
* Creates new form jffFamilleMedoc
*/
public jffFamilleMedoc(int metier) {
this.metier = metier;
public jffFamilleMedoc() {
initComponents();
familleMedocSQL famille = new familleMedocSQL();
jCBFamille.setModel(new DefaultComboBoxModel(famille.rechercheFamille()));
@@ -44,12 +43,10 @@ public class jffFamilleMedoc extends javax.swing.JFrame {
jCBFamille = new javax.swing.JComboBox<>();
jCBMedocListe = new javax.swing.JComboBox<>();
jMenuBar1 = new javax.swing.JMenuBar();
jMPage = new javax.swing.JMenu();
jMIProfession = new javax.swing.JMenuItem();
jMIFamille = new javax.swing.JMenuItem();
jMInfo = new javax.swing.JMenu();
jMIguide = new javax.swing.JMenuItem();
jMcredit = new javax.swing.JMenuItem();
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);
@@ -84,40 +81,29 @@ public class jffFamilleMedoc extends javax.swing.JFrame {
}
});
jMPage.setText("Page");
jMenu1.setText("File");
jMIProfession.setText("Choix M<>tier");
jMIProfession.addActionListener(new java.awt.event.ActionListener() {
jMIAPropos.setText("<EFBFBD> propos");
jMIAPropos.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMIProfessionActionPerformed(evt);
jMIAProposActionPerformed(evt);
}
});
jMPage.add(jMIProfession);
jMenu1.add(jMIAPropos);
jMIFamille.setText("Famille Medicament");
jMIFamille.addActionListener(new java.awt.event.ActionListener() {
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) {
jMIFamilleActionPerformed(evt);
jMIQuitterActionPerformed(evt);
}
});
jMPage.add(jMIFamille);
jMenu1.add(jMIQuitter);
jMenuBar1.add(jMPage);
jMenuBar1.add(jMenu1);
jMInfo.setText("Info");
jMIguide.setText("Guide");
jMIguide.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMIguideActionPerformed(evt);
}
});
jMInfo.add(jMIguide);
jMcredit.setText("Cr<EFBFBD>dit");
jMInfo.add(jMcredit);
jMenuBar1.add(jMInfo);
jMenu2.setText("Edit");
jMenuBar1.add(jMenu2);
setJMenuBar(jMenuBar1);
@@ -188,12 +174,11 @@ public class jffFamilleMedoc extends javax.swing.JFrame {
String contreIndicationTrouve = rechercheMedoc.get(4);
String imgTrouve = idTrouve;
Medicament medocTrouve = new Medicament(idTrouve, nomTrouve , compositionTrouve, effetTrouve, contreIndicationTrouve,imgTrouve);
new jffInfoMedoc(medocTrouve, this.metier).setVisible(true);
new jffInfoMedoc(medocTrouve).setVisible(true);
}else {
JOptionPane.showMessageDialog(null,"Veuillez choisir un m<>dicament valide");
}
JOptionPane.showMessageDialog(null,"Erreur, Veuillez r<EFBFBD>esayer"); }
}//GEN-LAST:event_jBRechercheValideActionPerformed
private void jCBFamilleActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCBFamilleActionPerformed
@@ -223,23 +208,17 @@ public class jffFamilleMedoc extends javax.swing.JFrame {
String contreIndicationTrouve = rechercheMedoc.get(4);
String imgTrouve = idTrouve;
Medicament medocTrouve = new Medicament(idTrouve, nomTrouve , compositionTrouve, effetTrouve, contreIndicationTrouve,imgTrouve);
new jffInfoMedoc(medocTrouve, this.metier).setVisible(true);
new jffInfoMedoc(medocTrouve).setVisible(true);
}
}//GEN-LAST:event_jCBMedocListeActionPerformed
private void jMIProfessionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIProfessionActionPerformed
new jffProfession().setVisible(true);
this.setVisible(false);
}//GEN-LAST:event_jMIProfessionActionPerformed
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 jMIguideActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIguideActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jMIguideActionPerformed
private void jMIFamilleActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIFamilleActionPerformed
new jffFamilleMedoc(this.metier).setVisible(true);
this.setVisible(false);
}//GEN-LAST:event_jMIFamilleActionPerformed
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
@@ -271,6 +250,7 @@ public class jffFamilleMedoc extends javax.swing.JFrame {
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new jffFamilleMedoc().setVisible(true);
}
});
}
@@ -281,12 +261,10 @@ public class jffFamilleMedoc extends javax.swing.JFrame {
private javax.swing.JComboBox<String> jCBMedocListe;
private javax.swing.JLabel jLRecherche;
private javax.swing.JLabel jLabel1;
private javax.swing.JMenuItem jMIFamille;
private javax.swing.JMenuItem jMIProfession;
private javax.swing.JMenuItem jMIguide;
private javax.swing.JMenu jMInfo;
private javax.swing.JMenu jMPage;
private javax.swing.JMenuItem jMcredit;
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;
// End of variables declaration//GEN-END:variables

View File

@@ -1,78 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<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="jMPage">
<Properties>
<Property name="text" type="java.lang.String" value="Page"/>
</Properties>
<SubComponents>
<MenuItem class="javax.swing.JMenuItem" name="jMIProfession">
<Properties>
<Property name="text" type="java.lang.String" value="Choix M&#xe9;tier"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMIProfessionActionPerformed"/>
</Events>
</MenuItem>
<MenuItem class="javax.swing.JMenuItem" name="jMIFamille">
<Properties>
<Property name="text" type="java.lang.String" value="Famille Medicament"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMIFamilleActionPerformed"/>
</Events>
</MenuItem>
</SubComponents>
</Menu>
<Menu class="javax.swing.JMenu" name="jMObservation">
<Properties>
<Property name="text" type="java.lang.String" value="Observation"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMObservationActionPerformed"/>
</Events>
<SubComponents>
<MenuItem class="javax.swing.JMenuItem" name="jMIObservation">
<Properties>
<Property name="text" type="java.lang.String" value="jMenuItem3"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMIObservationActionPerformed"/>
</Events>
</MenuItem>
</SubComponents>
</Menu>
<Menu class="javax.swing.JMenu" name="jMInfo">
<Properties>
<Property name="text" type="java.lang.String" value="Info"/>
</Properties>
<SubComponents>
<MenuItem class="javax.swing.JMenuItem" name="jMIguide">
<Properties>
<Property name="text" type="java.lang.String" value="Guide"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMIguideActionPerformed"/>
</Events>
</MenuItem>
<MenuItem class="javax.swing.JMenuItem" name="jMcredit">
<Properties>
<Property name="text" type="java.lang.String" value="Cr&#xe9;dit"/>
</Properties>
</MenuItem>
</SubComponents>
</Menu>
</SubComponents>
</Menu>
</NonVisualComponents>
<Properties>
<Property name="defaultCloseOperation" type="int" value="3"/>
</Properties>
<SyntheticProperties>
<SyntheticProperty name="menuBar" type="java.lang.String" value="jMenuBar1"/>
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
<SyntheticProperty name="generateCenter" type="boolean" value="false"/>
</SyntheticProperties>
@@ -101,9 +33,8 @@
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jPFond" max="32767" attributes="0"/>
<EmptySpace min="-2" pref="10" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="16" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@@ -117,7 +48,7 @@
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jSeparator1" alignment="1" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
@@ -154,11 +85,6 @@
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
@@ -166,27 +92,31 @@
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jLNomMedoc" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="35" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Group type="102" attributes="0">
<Component id="jLNomCo" min="-2" pref="37" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="28" max="-2" attributes="0"/>
<Component id="jLComposition" min="-2" pref="74" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<EmptySpace pref="60" max="32767" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Group type="102" attributes="0">
<Component id="jLContrindication" min="-2" pref="141" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="jSeparator1" min="-2" pref="10" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="169" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Component id="jLEffet" min="-2" pref="131" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
<Component id="jLEffet" alignment="0" min="-2" pref="131" max="-2" attributes="0"/>
</Group>
</Group>
<Component id="jLImage" alignment="0" min="-2" pref="172" max="-2" attributes="0"/>
<Group type="102" attributes="0">
<Component id="jLImage" min="-2" pref="172" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@@ -212,58 +142,6 @@
</Component>
<Component class="javax.swing.JLabel" name="jLEffet">
</Component>
<Container class="javax.swing.JPanel" name="jPanel1">
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="32767" attributes="0"/>
<Component id="jBprecedent" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jBsuivant" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="24" max="-2" attributes="0"/>
<Component id="jLObservation" min="-2" pref="431" max="-2" attributes="0"/>
<EmptySpace pref="169" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jBsuivant" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jBprecedent" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jLObservation" min="-2" pref="113" max="-2" attributes="0"/>
<EmptySpace pref="19" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JButton" name="jBsuivant">
<Properties>
<Property name="text" type="java.lang.String" value="Suivant"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="jBprecedent">
<Properties>
<Property name="text" type="java.lang.String" value="Pr&#xe9;c&#xe9;dent"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLObservation">
<Properties>
<Property name="text" type="java.lang.String" value="Text"/>
</Properties>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Container>
</SubComponents>

View File

@@ -5,10 +5,9 @@
package presentation;
import Metier.Medicament;
import acces_aux_donnes.observationSQL;
import java.awt.Image;
import java.awt.image.BufferedImage;
import java.util.ArrayList;
import javax.swing.Icon;
import javax.swing.ImageIcon;
/**
@@ -16,15 +15,11 @@ import javax.swing.ImageIcon;
* @author emile.lalorcey
*/
public class jffInfoMedoc extends javax.swing.JFrame {
private ArrayList<String> observation = new ArrayList<String>();
observationSQL observ = new observationSQL();
int metier;
/**
* Creates new form jffInfoMedoc
*/
public jffInfoMedoc(Medicament medocTrouve, int metier) {
this.metier = metier;
public jffInfoMedoc(Medicament medocTrouve) {
initComponents();
jLNomCo.setText(medocTrouve.getNom());
//Icon imgMedoc = new javax.swing.ImageIcon(getClass().getResource("/img/" + medocTrouve.getImg() + ".jpg"));
@@ -34,13 +29,6 @@ public class jffInfoMedoc extends javax.swing.JFrame {
jLComposition.setText(medocTrouve.getComposition());
jLContrindication.setText(medocTrouve.getContreindication());
jLEffet.setText(medocTrouve.getEffet());
observation = observ.selectionObservation(medocTrouve.getNom());
if (observation.size()!= 0){
jLObservation.setText(observation.get(0));
}
if(this.metier != 0){
jMObservation.setVisible(false);
}
}
@@ -61,58 +49,12 @@ public class jffInfoMedoc extends javax.swing.JFrame {
jLImage = new javax.swing.JLabel();
jSeparator1 = new javax.swing.JSeparator();
jLEffet = new javax.swing.JLabel();
jPanel1 = new javax.swing.JPanel();
jBsuivant = new javax.swing.JButton();
jBprecedent = new javax.swing.JButton();
jLObservation = new javax.swing.JLabel();
jMenuBar1 = new javax.swing.JMenuBar();
jMPage = new javax.swing.JMenu();
jMIProfession = new javax.swing.JMenuItem();
jMIFamille = new javax.swing.JMenuItem();
jMObservation = new javax.swing.JMenu();
jMIObservation = new javax.swing.JMenuItem();
jMInfo = new javax.swing.JMenu();
jMIguide = new javax.swing.JMenuItem();
jMcredit = new javax.swing.JMenuItem();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jLNomMedoc.setFont(new java.awt.Font("Segoe UI Black", 0, 18)); // NOI18N
jLNomMedoc.setText("Nom du M<>dicament :");
jBsuivant.setText("Suivant");
jBprecedent.setText("Pr<EFBFBD>c<EFBFBD>dent");
jLObservation.setText("Text");
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jBprecedent)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jBsuivant)
.addContainerGap())
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(24, 24, 24)
.addComponent(jLObservation, javax.swing.GroupLayout.PREFERRED_SIZE, 431, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(169, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jBsuivant)
.addComponent(jBprecedent))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLObservation, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(19, Short.MAX_VALUE))
);
javax.swing.GroupLayout jPFondLayout = new javax.swing.GroupLayout(jPFond);
jPFond.setLayout(jPFondLayout);
jPFondLayout.setHorizontalGroup(
@@ -145,89 +87,33 @@ public class jffInfoMedoc extends javax.swing.JFrame {
.addComponent(jLNomMedoc)))
.addGap(0, 163, Short.MAX_VALUE)))
.addContainerGap())
.addGroup(jPFondLayout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPFondLayout.setVerticalGroup(
jPFondLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPFondLayout.createSequentialGroup()
.addContainerGap()
.addComponent(jLNomMedoc)
.addGap(35, 35, 35)
.addGap(18, 18, 18)
.addGroup(jPFondLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPFondLayout.createSequentialGroup()
.addComponent(jLNomCo, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(28, 28, 28)
.addComponent(jLComposition, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 60, Short.MAX_VALUE)
.addGroup(jPFondLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPFondLayout.createSequentialGroup()
.addComponent(jLContrindication, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(jLEffet, javax.swing.GroupLayout.PREFERRED_SIZE, 131, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addComponent(jLImage, javax.swing.GroupLayout.PREFERRED_SIZE, 172, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
.addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(169, 169, 169))
.addGroup(jPFondLayout.createSequentialGroup()
.addComponent(jLEffet, javax.swing.GroupLayout.PREFERRED_SIZE, 131, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
.addGroup(jPFondLayout.createSequentialGroup()
.addComponent(jLImage, javax.swing.GroupLayout.PREFERRED_SIZE, 172, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE))))
);
jMPage.setText("Page");
jMIProfession.setText("Choix M<>tier");
jMIProfession.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMIProfessionActionPerformed(evt);
}
});
jMPage.add(jMIProfession);
jMIFamille.setText("Famille Medicament");
jMIFamille.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMIFamilleActionPerformed(evt);
}
});
jMPage.add(jMIFamille);
jMenuBar1.add(jMPage);
jMObservation.setText("Observation");
jMObservation.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMObservationActionPerformed(evt);
}
});
jMIObservation.setText("jMenuItem3");
jMIObservation.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMIObservationActionPerformed(evt);
}
});
jMObservation.add(jMIObservation);
jMenuBar1.add(jMObservation);
jMInfo.setText("Info");
jMIguide.setText("Guide");
jMIguide.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMIguideActionPerformed(evt);
}
});
jMInfo.add(jMIguide);
jMcredit.setText("Cr<EFBFBD>dit");
jMInfo.add(jMcredit);
jMenuBar1.add(jMInfo);
setJMenuBar(jMenuBar1);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
@@ -240,37 +126,13 @@ public class jffInfoMedoc extends javax.swing.JFrame {
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPFond, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGap(10, 10, 10))
.addGap(16, 16, 16))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void jMIProfessionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIProfessionActionPerformed
new jffProfession().setVisible(true);
this.setVisible(false);
}//GEN-LAST:event_jMIProfessionActionPerformed
private void jMIFamilleActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIFamilleActionPerformed
new jffFamilleMedoc(this.metier).setVisible(true);
this.setVisible(false);
}//GEN-LAST:event_jMIFamilleActionPerformed
private void jMObservationActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMObservationActionPerformed
}//GEN-LAST:event_jMObservationActionPerformed
private void jMIguideActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIguideActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jMIguideActionPerformed
private void jMIObservationActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIObservationActionPerformed
new jffAjoutObservation(this.observation.get(0), 1).setVisible(true);
}//GEN-LAST:event_jMIObservationActionPerformed
/**
* @param args the command line arguments
*/
@@ -306,26 +168,13 @@ public class jffInfoMedoc extends javax.swing.JFrame {
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jBprecedent;
private javax.swing.JButton jBsuivant;
private javax.swing.JLabel jLComposition;
private javax.swing.JLabel jLContrindication;
private javax.swing.JLabel jLEffet;
private javax.swing.JLabel jLImage;
private javax.swing.JLabel jLNomCo;
private javax.swing.JLabel jLNomMedoc;
private javax.swing.JLabel jLObservation;
private javax.swing.JMenuItem jMIFamille;
private javax.swing.JMenuItem jMIObservation;
private javax.swing.JMenuItem jMIProfession;
private javax.swing.JMenuItem jMIguide;
private javax.swing.JMenu jMInfo;
private javax.swing.JMenu jMObservation;
private javax.swing.JMenu jMPage;
private javax.swing.JMenuItem jMcredit;
private javax.swing.JMenuBar jMenuBar1;
private javax.swing.JPanel jPFond;
private javax.swing.JPanel jPanel1;
private javax.swing.JSeparator jSeparator1;
// End of variables declaration//GEN-END:variables
}

View File

@@ -15,7 +15,6 @@ public class jffProfession extends javax.swing.JFrame {
*/
public jffProfession() {
initComponents();
}
/**