This commit is contained in:
clementine.desrucques 2021-10-21 16:35:09 +02:00
parent a9dec9bae4
commit cd2d0e634f
3 changed files with 111 additions and 70 deletions

View File

@ -186,28 +186,18 @@ public class PompierMySql {
resultQ.getString("nom"), resultQ.getString("nom"),
resultQ.getString("prenom"), resultQ.getString("prenom"),
resultQ.getInt("statut"), resultQ.getInt("statut"),
resultQ.getInt("typePers"),
resultQ.getString("mail"), resultQ.getString("mail"),
resultQ.getString("login"), resultQ.getString("login"),
resultQ.getString("mdp"), resultQ.getString("mdp"),
resultQ.getInt("adrNo"), resultQ.getInt("adrNo"),
resultQ.getString("adrRue"), resultQ.getString("adrRue"),
resultQ.getString("adrCP"), resultQ.getString("cp"),
resultQ.getString("adrVille"), resultQ.getString("ville"),
resultQ.getInt("grade"), resultQ.getInt("grade"),
resultQ.getString("commentaire") resultQ.getString("commentaire")
); );
switch(resultQ.getInt("statut")){
case 1:
setResultat("Pompier");
break;
case 2:
setResultat("Chef");
break;
case 3:
setResultat("Alerte");
break;
}
HttpSession maSession = request.getSession(); HttpSession maSession = request.getSession();
maSession.setAttribute("lePompier", lePompier); maSession.setAttribute("lePompier", lePompier);

View File

@ -17,35 +17,56 @@ public class Pompier {
private String nom; private String nom;
private String prenom; private String prenom;
private int statut; private int statut;
private int typePers;
private String mail; private String mail;
private String login; private String login;
private String mdp; private String mdp;
private int adrNo; private String adresse;
private String adrRue; private String cp;
private String adrCP; private String ville;
private String adrVille; private int bip;
private int nbGrade;
private int grade; private int grade;
private String commentaire; private String commentaire;
private int idEmployeur;
public Pompier(int id, int idCaserne, String nom, String prenom, int statut, String mail, String login, String mdp, int adrNo, String adrRue, String adrCP, String adrVille, int grade, String commentaire) { public Pompier(int id, int idCaserne, String nom, String prenom, int statut, int typePers, String mail, String login, String mdp, String adresse, String cp, String ville, int bip, int nbGrade, int grade, String commentaire, int idEmployeur) {
this(idCaserne, nom, prenom, statut, mail, login, mdp, adrNo, adrRue, adrCP, adrVille, grade, commentaire);
this.id = id; this.id = id;
}
public Pompier(int idCaserne, String nom, String prenom, int statut, String mail, String login, String mdp, int adrNo, String adrRue, String adrCP, String adrVille, int grade, String commentaire) {
this.idCaserne = idCaserne; this.idCaserne = idCaserne;
this.nom = nom; this.nom = nom;
this.prenom = prenom; this.prenom = prenom;
this.statut = statut; this.statut = statut;
this.typePers = typePers;
this.mail = mail; this.mail = mail;
this.login = login; this.login = login;
this.mdp = mdp; this.mdp = mdp;
this.adrNo = adrNo; this.adresse = adresse;
this.adrRue = adrRue; this.cp = cp;
this.adrCP = adrCP; this.ville = ville;
this.adrVille = adrVille; this.bip = bip;
this.nbGrade = nbGrade;
this.grade = grade; this.grade = grade;
this.commentaire = commentaire; this.commentaire = commentaire;
this.idEmployeur = idEmployeur;
}
public Pompier(int idCaserne, String nom, String prenom, int statut, int typePers, String mail, String login, String mdp, String adresse, String cp, String ville, int bip, int nbGrade, int grade, String commentaire, int idEmployeur) {
this.idCaserne = idCaserne;
this.nom = nom;
this.prenom = prenom;
this.statut = statut;
this.typePers = typePers;
this.mail = mail;
this.login = login;
this.mdp = mdp;
this.adresse = adresse;
this.cp = cp;
this.ville = ville;
this.bip = bip;
this.nbGrade = nbGrade;
this.grade = grade;
this.commentaire = commentaire;
this.idEmployeur = idEmployeur;
} }
public int getId() { public int getId() {
@ -88,6 +109,14 @@ public class Pompier {
this.statut = statut; this.statut = statut;
} }
public int getTypePers() {
return typePers;
}
public void setTypePers(int typePers) {
this.typePers = typePers;
}
public String getMail() { public String getMail() {
return mail; return mail;
} }
@ -112,36 +141,44 @@ public class Pompier {
this.mdp = mdp; this.mdp = mdp;
} }
public int getAdrNo() { public String getAdresse() {
return adrNo; return adresse;
} }
public void setAdrNo(int adrNo) { public void setAdresse(String adresse) {
this.adrNo = adrNo; this.adresse = adresse;
} }
public String getAdrRue() { public String getCp() {
return adrRue; return cp;
} }
public void setAdrRue(String adrRue) { public void setCp(String cp) {
this.adrRue = adrRue; this.cp = cp;
} }
public String getAdrCP() { public String getVille() {
return adrCP; return ville;
} }
public void setAdrCP(String adrCP) { public void setVille(String ville) {
this.adrCP = adrCP; this.ville = ville;
} }
public String getAdrVille() { public int getBip() {
return adrVille; return bip;
} }
public void setAdrVille(String adrVille) { public void setBip(int bip) {
this.adrVille = adrVille; this.bip = bip;
}
public int getNbGrade() {
return nbGrade;
}
public void setNbGrade(int nbGrade) {
this.nbGrade = nbGrade;
} }
public int getGrade() { public int getGrade() {
@ -160,23 +197,34 @@ public class Pompier {
this.commentaire = commentaire; this.commentaire = commentaire;
} }
public int getIdEmployeur() {
return idEmployeur;
}
public void setIdEmployeur(int idEmployeur) {
this.idEmployeur = idEmployeur;
}
@Override @Override
public int hashCode() { public int hashCode() {
int hash = 3; int hash = 3;
hash = 29 * hash + this.id; hash = 67 * hash + this.id;
hash = 29 * hash + this.idCaserne; hash = 67 * hash + this.idCaserne;
hash = 29 * hash + Objects.hashCode(this.nom); hash = 67 * hash + Objects.hashCode(this.nom);
hash = 29 * hash + Objects.hashCode(this.prenom); hash = 67 * hash + Objects.hashCode(this.prenom);
hash = 29 * hash + this.statut; hash = 67 * hash + this.statut;
hash = 29 * hash + Objects.hashCode(this.mail); hash = 67 * hash + this.typePers;
hash = 29 * hash + Objects.hashCode(this.login); hash = 67 * hash + Objects.hashCode(this.mail);
hash = 29 * hash + Objects.hashCode(this.mdp); hash = 67 * hash + Objects.hashCode(this.login);
hash = 29 * hash + this.adrNo; hash = 67 * hash + Objects.hashCode(this.mdp);
hash = 29 * hash + Objects.hashCode(this.adrRue); hash = 67 * hash + Objects.hashCode(this.adresse);
hash = 29 * hash + Objects.hashCode(this.adrCP); hash = 67 * hash + Objects.hashCode(this.cp);
hash = 29 * hash + Objects.hashCode(this.adrVille); hash = 67 * hash + Objects.hashCode(this.ville);
hash = 29 * hash + this.grade; hash = 67 * hash + this.bip;
hash = 29 * hash + Objects.hashCode(this.commentaire); hash = 67 * hash + this.nbGrade;
hash = 67 * hash + this.grade;
hash = 67 * hash + Objects.hashCode(this.commentaire);
hash = 67 * hash + this.idEmployeur;
return hash; return hash;
} }
@ -201,12 +249,21 @@ public class Pompier {
if (this.statut != other.statut) { if (this.statut != other.statut) {
return false; return false;
} }
if (this.adrNo != other.adrNo) { if (this.typePers != other.typePers) {
return false;
}
if (this.bip != other.bip) {
return false;
}
if (this.nbGrade != other.nbGrade) {
return false; return false;
} }
if (this.grade != other.grade) { if (this.grade != other.grade) {
return false; return false;
} }
if (this.idEmployeur != other.idEmployeur) {
return false;
}
if (!Objects.equals(this.nom, other.nom)) { if (!Objects.equals(this.nom, other.nom)) {
return false; return false;
} }
@ -222,13 +279,13 @@ public class Pompier {
if (!Objects.equals(this.mdp, other.mdp)) { if (!Objects.equals(this.mdp, other.mdp)) {
return false; return false;
} }
if (!Objects.equals(this.adrRue, other.adrRue)) { if (!Objects.equals(this.adresse, other.adresse)) {
return false; return false;
} }
if (!Objects.equals(this.adrCP, other.adrCP)) { if (!Objects.equals(this.cp, other.cp)) {
return false; return false;
} }
if (!Objects.equals(this.adrVille, other.adrVille)) { if (!Objects.equals(this.ville, other.ville)) {
return false; return false;
} }
if (!Objects.equals(this.commentaire, other.commentaire)) { if (!Objects.equals(this.commentaire, other.commentaire)) {
@ -239,9 +296,8 @@ public class Pompier {
@Override @Override
public String toString() { public String toString() {
return "Pompier{" + "id=" + id + ", idCaserne=" + idCaserne + ", nom=" + nom + ", prenom=" + prenom + ", statut=" + statut + ", mail=" + mail + ", login=" + login + ", mdp=" + mdp + ", adrNo=" + adrNo + ", adrRue=" + adrRue + ", adrCP=" + adrCP + ", adrVille=" + adrVille + ", grade=" + grade + ", commentaire=" + commentaire + '}'; return "Pompier{" + "id=" + id + ", idCaserne=" + idCaserne + ", nom=" + nom + ", prenom=" + prenom + ", statut=" + statut + ", typePers=" + typePers + ", mail=" + mail + ", login=" + login + ", mdp=" + mdp + ", adresse=" + adresse + ", cp=" + cp + ", ville=" + ville + ", bip=" + bip + ", nbGrade=" + nbGrade + ", grade=" + grade + ", commentaire=" + commentaire + ", idEmployeur=" + idEmployeur + '}';
} }
}
}

View File

@ -22,9 +22,4 @@
Affichage du message contenu dans l'objet controlForm de type AuthentifForm --> Affichage du message contenu dans l'objet controlForm de type AuthentifForm -->
<p>${controlForm.getResultat()}</p> <p>${controlForm.getResultat()}</p>
<br /> <br />
<c:when test="${controlForm.getResultat()=='Chef'}">
<c:redirect url="ChefCaserne"></c:redirect>
</c:when>
<c:when test="${controlForm.getResultat()=='Pompier'}">
<c:redirect url="Pompier"></c:redirect>
</c:when>