0
bool Payment::checkUniqueIdentifier(const QString &invoice)
{
qDebug() << "entering Payment: check if the invoice has an associated unique identifier or not for the invoice=" + invoice;
QSqlQuery query(m_storageUserManager->database());
query.prepare("SELECT invoice FROM " + m_invoiceInfoTable + "WHERE invoice=:invoice");
query.bindValue(": invoice", invoice);
query.exec();
query.first();
bool tmp;
tmp = query.isValid();
return tmp;
}
이 부울 변수는 항상 false로 반환됩니다 안녕, 당신이 감사부울 변수는 항상 false
if(payment->checkUniqueIdentifier("invoice1"))
qDebug() << "It has a unique Identifier";
else
qDebug() << "It dont have a unique Identifier";
을 다음과 같이 나는이 기능을 사용하던 가능한 문제 수 무엇을 말해 줄 수 당신 감사를 반환 , 푸네 집합
덕분에 많이 :) 그것은 바보 같은 실수 하고 자신의 코드를 디버깅하는 것이 어려운입니다 – Puneet
: 같은 빠른 답장을 보내 주셔서 감사했다 읽는다! – Ben