1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
| QList<QString> OpenFiche::recupValuePropriByCode()
{
QList<QString> list;
QSqlQuery q;
q.prepare("SELECT codeP, civilite, nomPropri, prenomPropri, dateNaissancePropri, "
"lieuxNaissancePropri, nationalite, adressePropri, CPPropri, "
"villePropri, TelDomPropri, telBurPropri, telPorPropri, mailPropri, tauxHonoraireHT, "
"assiette, periodeReglement, numMandat, entreLe, sortiLe, dernierRapportArreteLe, reglement, montantAcompte, "
"perioAcompte, dateDernierAcompte, montantDernierAcompte, banque, villeBanque, "
"codeBanque, codeGuichet, numCompte, cleRIB "
"FROM Proprietaire "
"WHERE codeP=:codeP");
q.bindValue(":codeP", ligne->text());
qDebug() <<ligne->text();
if(!q.exec())
qDebug(qPrintable(q.lastError().text()));
else
{
qDebug() <<"requete passée correctement";
qDebug() <<q.executedQuery();
if(!q.next())
{
QMessageBox::warning(this, "Erreur",
"Ce numéro de proprietaire n'existe pas.");
}
else
{
qDebug() <<"On est bien dans le else!";
int i=0;
while(q.next())
{
qDebug() <<"on est bien entré dans la boucle while!";
qDebug() <<q.value(i).toString();
list.append(q.value(i).toString());
i++;
}
}
}
return list;
} |