} else {
    if ($action == "update") {
        $idCommande = htmlentities($_POST['idCommande']);
        $codeCommande = htmlentities($_POST['codeCommande']);
        $mois = $_POST['mois'];
        $annee = $_POST['annee'];
        if (!empty($_POST['idFournisseur'])) {
            $idFournisseur = htmlentities($_POST['idFournisseur']);
            $idProjet = htmlentities($_POST['idProjet']);
            $dateCommande = htmlentities($_POST['dateCommande']);
            $numeroCommande = htmlentities($_POST['numeroCommande']);
            $designation = htmlentities($_POST['designation']);
            $updatedBy = $_SESSION['userMerlaTrav']->login();
            $updated = date('Y-m-d h:i:s');
            $commande = new Commande(array('id' => $idCommande, 'idFournisseur' => $idFournisseur, 'idProjet' => $idProjet, 'dateCommande' => $dateCommande, 'numeroCommande' => $numeroCommande, 'designation' => $designation, 'updated' => $updated, 'updatedBy' => $updatedBy));
            $commandeManager->update($commande);
            $actionMessage = "Opération Valide : Commande Modifié(e) avec succès.";
            $typeMessage = "success";
        } else {
            $actionMessage = "Erreur Modification Commande : Vous devez remplir le champ 'idFournisseur'.";
            $typeMessage = "error";
        }
        if (isset($_POST['source']) and $_POST['source'] == "commande-mois-annee-iaaza") {
            $redirectLink = "Location:../commande-mois-annee-iaaza.php?mois=" . $mois . "&annee=" . $annee;
        } else {
            if (isset($_POST['source']) and $_POST['source'] == "commande-details-iaaza") {
                $redirectLink = "Location:../commande-details-iaaza.php?codeCommande=" . $codeCommande . "&mois=" . $mois . "&annee=" . $annee;
            }
        }
    } else {
        if ($action == "delete") {
 /**
  * @name setCloturer($IdMarche)
  * @param integer
  * @desc Cloture le marche
  */
 public function setCloturer($IdMarche)
 {
     $lMarche = CommandeManager::select($IdMarche);
     $lMarche->setArchive(2);
     $lOperationService = new OperationService();
     // On Passe les opérations réservées non récupérées en statut cloturé
     $lListeOperation = $lOperationService->getReservationCommande($IdMarche);
     foreach ($lListeOperation as $lOperation) {
         if ($lOperation->getId() != null) {
             $lOperation->setTypePaiement(15);
             $lOperationService->set($lOperation);
         }
     }
     return CommandeManager::update($lMarche);
 }