menuvue = new Menuvueutilisateur(); $this->menuvue->getMenuTbajout('naturepiece'); $this->naturepiece = new naturepiece(); } public function index() { $id = $this->requete->getParametre("id"); $naturepiece = $this->naturepiece->getnaturepiece($id); $this->genererVue(array('naturepiece' => $naturepiece)); } public function reafficher() { $this->genererVue(); } public function modifier() { $id = $this->requete->getParametre("idnaturepiece"); $oldcodeNaturePiece = $this->requete->getParametre("oldcodeNaturePiece"); $codeNaturePiece = $this->requete->getParametre("codeNaturePiece"); $libelle = $this->requete->getParametre("libelle"); // Début contrôle doublon $doublon = false; $doublon = (($codeNaturePiece!=$oldcodeNaturePiece) && ($this->naturepiece->existeligne($codeNaturePiece))); if (!$doublon) { $codeNaturePiece = strtoupper($codeNaturePiece); $libelle = ucfirst($libelle); $this->naturepiece->modifier($id, $codeNaturePiece, $libelle); } $this->rediriger("Tblistenaturepiece"); } }