4 Commits

Author SHA1 Message Date
1515f943c8 Merge pull request 'EMILE pascuit' (#21) from Java.medhi2 into main
Reviewed-on: #21
2025-03-13 11:55:37 +01:00
medhi.rodrigues
c8a8aac214 EMILE pascuit 2025-03-13 11:54:26 +01:00
medhi.rodrigues
37842afdeb Test 4 2025-03-13 10:54:08 +01:00
6541e7532d Merge pull request 'PAs de doc 3' (#20) from MedhiJava into main
Reviewed-on: #20
2025-03-13 10:27:24 +01:00
8 changed files with 119 additions and 123 deletions

View File

@@ -17,12 +17,12 @@ public class Medicament {
* contreindication = les contreindications du m<>dicament
* prix = le prix en unit<69> du m<>dicament
*/
private int id;
private String id;
private String nom;
private String composition;
private String effet;
private String contreindication;
private float prix;
private String img;
/** LE CONSTRUCTEUR DEFAULT
@@ -32,24 +32,22 @@ public class Medicament {
* @param composition
* @param effet
* @param contreindication
* @param prix
*/
public Medicament(int id, String nom, String composition, String effet, String contreindication, float prix) {
public Medicament(String id, String nom, String composition, String effet, String contreindication, String img) {
this.id = id;
this.nom = nom;
this.composition = composition;
this.effet = effet;
this.contreindication = contreindication;
this.prix = prix;
this.img = img;
}
/** LES GUETTEUR
* @return the id
*/
public int getId() {
public String getId(){
return id;
}
@@ -81,17 +79,15 @@ public class Medicament {
return contreindication;
}
/**
* @return the prix
*/
public float getPrix() {
return prix;
public String getImg() {
return img;
}
@Override
public String toString() {
return "Medicament{" + "id=" + id + ", nom=" + nom + ", composition=" + composition + ", effet=" + effet + ", contreindication=" + contreindication + ", prix=" + prix + '}';
return "Medicament{" + "id=" + id + ", nom=" + nom + ", composition=" + composition + ", effet=" + effet + ", contreindication=" + contreindication + ",img=" + img + '}';
}
}

View File

@@ -4,11 +4,6 @@
*/
package TEST;
import acces_aux_donnes.ConnexionSQL;
import acces_aux_donnes.PraticienSQL;
import acces_aux_donnes.MedicamentSQL;
import java.sql.Connection;
/**
*
* @author medhi.rodrigues

View File

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

View File

@@ -4,7 +4,7 @@
*/
package presentation;
import acces_aux_donnes.ObservationSQL;
import acces_aux_donnes.observationSQL;
/**
*
@@ -94,7 +94,7 @@ public class jffAjoutObservation extends javax.swing.JFrame {
}// </editor-fold>//GEN-END:initComponents
private void jBsoumettreActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBsoumettreActionPerformed
ObservationSQL observ = new ObservationSQL();
observationSQL observ = new observationSQL();
observ.ajouterObservation(this.idMedoc, this.idPraticien, jTAobservation.getText());
}//GEN-LAST:event_jBsoumettreActionPerformed

View File

@@ -4,7 +4,7 @@
*/
package presentation;
import acces_aux_donnes.PraticienSQL;
import acces_aux_donnes.praticienSQL;
/**
*
@@ -158,7 +158,7 @@ public class jffConnexion extends javax.swing.JFrame {
private void jBValiderActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBValiderActionPerformed
String identifiant = jTFIdentifiant.getText();
String mdp = String.valueOf(jPFmdp.getPassword());
PraticienSQL testPraticien = new PraticienSQL();
praticienSQL testPraticien = new praticienSQL();
String [] lePraticien = testPraticien.rechercherPraticien(identifiant,mdp);
if (lePraticien[0] != null){
System.out.print("TEST REUSSIE");

View File

@@ -102,9 +102,8 @@ public class jffFamilleMedoc extends javax.swing.JFrame {
String compositionTrouve = rechercheMedoc.get(2);
String effetTrouve = rechercheMedoc.get(3);
String contreIndicationTrouve = rechercheMedoc.get(4);
String imgTrouve = "../img/"+ idTrouve +".jpg";
Medicament medocTrouve = new Medicament(idTrouve, nomTrouve , compositionTrouve, effetTrouve
, contreIndicationTrouve,imgTrouve);
String imgTrouve = idTrouve;
Medicament medocTrouve = new Medicament(idTrouve, nomTrouve , compositionTrouve, effetTrouve, contreIndicationTrouve,imgTrouve);
new jffInfoMedoc(medocTrouve).setVisible(true);

View File

@@ -49,31 +49,41 @@
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jSeparator1" alignment="1" max="32767" 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"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="jLContrindication" min="-2" pref="265" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="jLPrix" min="-2" pref="100" max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Component id="jLContrindication" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLEffet" min="-2" pref="166" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Component id="jLComposition" min="-2" pref="265" max="-2" attributes="0"/>
<Component id="jLabel1" alignment="0" min="-2" pref="265" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="140" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="183" max="-2" attributes="0"/>
<Component id="jLNomCo" min="-2" pref="144" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="78" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="jLImage" min="-2" pref="157" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="38" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace min="0" pref="26" max="32767" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="168" max="-2" attributes="0"/>
<Component id="jLNomMedoc" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
<EmptySpace min="0" pref="163" max="32767" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@@ -82,29 +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="39" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Group type="102" attributes="0">
<Component id="jLabel1" min="-2" pref="86" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jLComposition" min="-2" pref="74" max="-2" attributes="0"/>
</Group>
<Component id="jLImage" max="32767" attributes="0"/>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace type="unrelated" pref="18" max="32767" attributes="0"/>
<Component id="jLContrindication" min="-2" pref="70" max="-2" attributes="0"/>
<EmptySpace pref="23" max="32767" 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 pref="60" max="32767" attributes="0"/>
<Group type="103" groupAlignment="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" alignment="0" attributes="0">
<EmptySpace min="-2" pref="35" max="-2" attributes="0"/>
<Component id="jLPrix" min="-2" pref="26" max="-2" attributes="0"/>
<Group type="102" attributes="0">
<Component id="jLEffet" min="-2" pref="131" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
<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="jLImage" min="-2" pref="172" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</Group>
</Group>
</Group>
</DimensionLayout>
@@ -115,35 +127,20 @@
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Segoe UI Black" size="18" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="Nom du M&#xe9;doc"/>
<Property name="text" type="java.lang.String" value="Nom du M&#xe9;dicament :"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="text" type="java.lang.String" value="Les effets du m&#xe9;dicament"/>
</Properties>
<Component class="javax.swing.JLabel" name="jLNomCo">
</Component>
<Component class="javax.swing.JLabel" name="jLComposition">
<Properties>
<Property name="text" type="java.lang.String" value="Composition du m&#xe9;doc"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLContrindication">
<Properties>
<Property name="text" type="java.lang.String" value="Contrindications du m&#xe9;doc"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLImage">
<Properties>
<Property name="text" type="java.lang.String" value="Image"/>
</Properties>
</Component>
<Component class="javax.swing.JSeparator" name="jSeparator1">
</Component>
<Component class="javax.swing.JLabel" name="jLPrix">
<Properties>
<Property name="text" type="java.lang.String" value="Prix :"/>
</Properties>
<Component class="javax.swing.JLabel" name="jLEffet">
</Component>
</SubComponents>
</Container>

View File

@@ -5,6 +5,10 @@
package presentation;
import Metier.Medicament;
import java.awt.Image;
import java.awt.image.BufferedImage;
import javax.swing.Icon;
import javax.swing.ImageIcon;
/**
*
@@ -17,6 +21,15 @@ public class jffInfoMedoc extends javax.swing.JFrame {
*/
public jffInfoMedoc(Medicament medocTrouve) {
initComponents();
jLNomCo.setText(medocTrouve.getNom());
//Icon imgMedoc = new javax.swing.ImageIcon(getClass().getResource("/img/" + medocTrouve.getImg() + ".jpg"));
//jLImage.setIcon(imgMedoc);
BufferedImage imgResize = null;
jLImage.setIcon(new ImageIcon(new javax.swing.ImageIcon(getClass().getResource("/img/" + medocTrouve.getImg() + ".jpg")).getImage().getScaledInstance(200, 50, Image.SCALE_SMOOTH)));
jLComposition.setText(medocTrouve.getComposition());
jLContrindication.setText(medocTrouve.getContreindication());
jLEffet.setText(medocTrouve.getEffet());
}
/**
@@ -30,27 +43,17 @@ public class jffInfoMedoc extends javax.swing.JFrame {
jPFond = new javax.swing.JPanel();
jLNomMedoc = new javax.swing.JLabel();
jLabel1 = new javax.swing.JLabel();
jLNomCo = new javax.swing.JLabel();
jLComposition = new javax.swing.JLabel();
jLContrindication = new javax.swing.JLabel();
jLImage = new javax.swing.JLabel();
jSeparator1 = new javax.swing.JSeparator();
jLPrix = new javax.swing.JLabel();
jLEffet = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jLNomMedoc.setFont(new java.awt.Font("Segoe UI Black", 0, 18)); // NOI18N
jLNomMedoc.setText("Nom du M<>doc");
jLabel1.setText("Les effets du m<>dicament");
jLComposition.setText("Composition du m<>doc");
jLContrindication.setText("Contrindications du m<>doc");
jLImage.setText("Image");
jLPrix.setText("Prix :");
jLNomMedoc.setText("Nom du M<>dicament :");
javax.swing.GroupLayout jPFondLayout = new javax.swing.GroupLayout(jPFond);
jPFond.setLayout(jPFondLayout);
@@ -63,46 +66,52 @@ public class jffInfoMedoc extends javax.swing.JFrame {
.addGroup(jPFondLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPFondLayout.createSequentialGroup()
.addContainerGap()
.addComponent(jLContrindication, javax.swing.GroupLayout.PREFERRED_SIZE, 265, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jLPrix, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPFondLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPFondLayout.createSequentialGroup()
.addComponent(jLContrindication, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLEffet, javax.swing.GroupLayout.PREFERRED_SIZE, 166, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPFondLayout.createSequentialGroup()
.addContainerGap()
.addGroup(jPFondLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPFondLayout.createSequentialGroup()
.addComponent(jLComposition, javax.swing.GroupLayout.PREFERRED_SIZE, 265, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 265, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addComponent(jLImage, javax.swing.GroupLayout.PREFERRED_SIZE, 157, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(0, 26, Short.MAX_VALUE)))
.addContainerGap())
.addGap(140, 140, 140))
.addGroup(jPFondLayout.createSequentialGroup()
.addGap(183, 183, 183)
.addComponent(jLNomCo, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(78, 78, 78)))
.addComponent(jLImage, javax.swing.GroupLayout.PREFERRED_SIZE, 157, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(38, 38, 38))))
.addGroup(jPFondLayout.createSequentialGroup()
.addGap(168, 168, 168)
.addComponent(jLNomMedoc)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addComponent(jLNomMedoc)))
.addGap(0, 163, Short.MAX_VALUE)))
.addContainerGap())
);
jPFondLayout.setVerticalGroup(
jPFondLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPFondLayout.createSequentialGroup()
.addContainerGap()
.addComponent(jLNomMedoc)
.addGap(39, 39, 39)
.addGroup(jPFondLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(jPFondLayout.createSequentialGroup()
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLComposition, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(jLImage, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGap(18, 18, 18)
.addGroup(jPFondLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPFondLayout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, 18, Short.MAX_VALUE)
.addComponent(jLContrindication, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 23, Short.MAX_VALUE))
.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, 60, Short.MAX_VALUE)
.addGroup(jPFondLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPFondLayout.createSequentialGroup()
.addGap(35, 35, 35)
.addComponent(jLPrix, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
.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)
.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))))
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
@@ -161,10 +170,10 @@ public class jffInfoMedoc extends javax.swing.JFrame {
// Variables declaration - do not modify//GEN-BEGIN:variables
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 jLPrix;
private javax.swing.JLabel jLabel1;
private javax.swing.JPanel jPFond;
private javax.swing.JSeparator jSeparator1;
// End of variables declaration//GEN-END:variables