1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
|
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Presentation;
import DAO.Livres;
import Metier.LivresGestion;
import Metier.LivresGestionImpl;
import java.util.ArrayList;
import java.util.List;
public class Ajouter {
private LivresGestion livGest;
private int cod_liv;
private String auteur;
private String titre;
private int nb_exemp;
public Ajouter() {
livGest=new LivresGestionImpl();
}
public LivresGestion getArtGest() {
return livGest;
}
public void setAuteur(String auteur) {
this.auteur = auteur;
}
public void setCod_liv(int cod_liv) {
this.cod_liv = cod_liv;
}
public void setLivGest(LivresGestion livGest) {
this.livGest = livGest;
}
public void setNb_exemp(int nb_exemp) {
this.nb_exemp = nb_exemp;
}
public void setTitre(String titre) {
this.titre = titre;
}
public String getAuteur() {
return auteur;
}
public int getCod_liv() {
return cod_liv;
}
public LivresGestion getLivGest() {
return livGest;
}
public int getNb_exemp() {
return nb_exemp;
}
public String getTitre() {
return titre;
}
public void setArtGest(LivresGestion artGest) {
this.livGest = artGest;
}
public String Supprimer()throws Exception{
return Delet(this.cod_liv);
}
public String Delet(int cod_liv)throws Exception
{
this.livGest.deleteLivre(cod_liv);
return "succes";
}
public String inserer() throws Exception {
Livres liv=new Livres();
liv.setCod_liv(this.cod_liv);
liv.setAuteur(this.auteur);
liv.setTitre(this.titre);
liv.setNb_exemp(this.nb_exemp);
System.out.println("couche présentation");
this.livGest.insertLivre(liv);
return "succes";
}
public String modifier() throws Exception {
Livres liv=new Livres();
liv.setCod_liv(this.cod_liv);
liv.setAuteur(this.auteur);
liv.setTitre(this.titre);
liv.setNb_exemp(this.nb_exemp);
System.out.println("couche présentation");
this.livGest.updateLivre(liv);
return "succes";
}
public Livres RechercherL() throws Exception {
return (Livres) livGest.Rechercher(cod_liv);
}
} |
Partager