menuvue = new Menuvueutilisateur(); $this->menuvue->getMenuTbajout('typeaffection'); $this->typeaffection = new typeaffection(); } public function index() { $this->genererVue(); } public function ajouter() { $codeSociete = $this->requete->getSession()->getAttribut('codeSociete'); $codeType = $this->requete->getParametre("codeType"); // Début contrôle doublon if (!$this->typeaffection->existeligne($codeType)) { $libelle = $this->requete->getParametre("libelle"); $codeTitre = strtoupper($codeType); $libelle = ucfirst($libelle); $this->typeaffection->ajouter($codeSociete, $codeType, $libelle); $this->executerAction("index"); } else $this->genererVue(array('msgErreur' => 'Ce code existe déjà!'), "index"); // Fin doublon } }