menuvue = new Menuvueutilisateur(); $this->menuvue->getMenuTbajout('affection'); $this->affection = new Affection(); $this->typeaffection = new Typeaffection(); } public function index() { $id = $this->requete->getParametre("id"); $affection = $this->affection->getaffection($id); $typeaffection = $this->typeaffection->getListe(); $this->genererVue(array('affection' => $affection, 'typeaffection' => $typeaffection)); } public function reafficher() { $this->genererVue(); } public function modifier() { $id = $this->requete->getParametre("idaffection"); $oldcodeAffection = $this->requete->getParametre("oldcodeAffection"); $codeAffection = $this->requete->getParametre("codeAffection"); $libelle = $this->requete->getParametre("libelle"); $codeType = $this->requete->getParametre("codeType"); // Début contrôle doublon $doublon = false; $doublon = (($codeAffection!=$oldcodeAffection) && ($this->affection->existeligne($codeAffection))); if (!$doublon) { $codeAffection = strtoupper($codeAffection); $libelle = ucfirst($libelle); $this->affection->modifier($id, $codeAffection, $libelle, $codeType); } $this->rediriger("Tblisteaffection"); // Fin contrôle doublon } }