PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2025 → Problème enregistrement des modifications
Problème enregistrement des modifications
Iniciado por Laurent, 30,dic. 2019 14:33 - 3 respuestas
Miembro registrado
72 mensajes
Publicado el 30,diciembre 2019 - 14:33
Bonjour,

J'ai un problème d'enregistrement des modifications au niveau du premier Hmodifie() situé après le HLitRecherche().
Pourtant au niveau des critères et sous-critères, les modifications sont bien enregistrées.

Je fais appelle à vous parce que je ne trouve pas le pb surtout que les hModifie() suivant fonctionnent. Je troune en boucle, est ce que quelqu'un pourrait me sortir de là.

Merci à vous tous et bonnes fêtes !!!

i, c, s sont des entiers

//ENREGISTREMENT DES NOTES

POUR i = 1 À 7 //CANDIDATS
SI {"LIB_Candidat" + i,indChamp} <> "Candidature " + i ALORS
NotesMarchés.NomCandidat = {"LIB_Candidat" + i,indChamp}
NotesMarchés.ID_Projets = pIdProjet
NotesMarchés.NoteFinaleCandidat = {"LIB_NoteTOTALE"+i,indChamp}

HExécuteRequête(REQ_NotesCandidat,hAvecFiltre,{"LIB_Candidat" + i,indChamp},pIdProjet)
SI PAS HLitPremier(REQ_NotesCandidat) ALORS
HAjoute(NotesMarchés)
SINON
HLitRecherche(NotesMarchés,IDNotesMarchés,REQ_NotesCandidat.IDNotesMarchés)
SI PAS HTrouve(NotesMarchés)ALORS
Info("Données non trouvé")
SINON
HModifie(NotesMarchés)
FIN
FIN

POUR c = 1 À 4 //CRITERES
//ENREGISTREMENT DES CRITERES
SI {"SAI_Critere" + c + "Candidat" + i,indChamp} <> "" ALORS
{"NotesMarchés.NoteCritere" + c,indRubrique} = {"SAI_Critere" + c + "Candidat" + i,indChamp}
{"NotesMarchés.NoteFinaleCritere" + c,indRubrique} = {"LIB_NoteFinale"+i+c,indChamp}
HModifie(NotesMarchés,hNumEnrEnCours)
FIN
//ENREGISTREMENT DES SOUS CRITERES
POUR s = 1 À 4
SI {"SAI_SCritere"+ c + s + "Candidat" + i,indChamp} <> "" ALORS
{"NotesMarchés.NoteSousCritere"+ c + s,indRubrique} = {"SAI_SCritere"+ c + s + "Candidat" + i,indChamp}
{"NotesMarchés.NoteFinaleSousCritere"+c+s,indRubrique} = {"LIB_NoteFinale"+i+c+s,indChamp}
HModifie(NotesMarchés,hNumEnrEnCours)
FIN
FIN
FIN
FIN
FIN

EcranVersFichier()
Ferme()
Miembro registrado
72 mensajes
Publicado el 30,diciembre 2019 - 15:03
Le Hajoute() fonctionne lui
Publicado el 30,diciembre 2019 - 15:03
tu l'as dans le désordre...

il faut faire, dans l'ordre

1. lecture enreg
2. modif des champs d l'enreg
3. hmodifie

tu fais 2 d'abord, puis tu lis l'enreg (et efface donc ce que ty as fais avant). Donc, le hmodifie enregistre un enreg identique a celui lu.
Miembro registrado
72 mensajes
Publicado el 31,diciembre 2019 - 17:25
Effectivement, c'était ça.

Je ne savais pas que les données à modifier devaient être écrite seulement après la lecture.
Merci à toi.
Mensaje modificado, 31,diciembre 2019 - 17:31