1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| QSqlQuery query11;
query11.prepare("SELECT Seuil_Min FROM Projet.dbo.Produit WHERE Nom=:nom");
query11.bindValue(":nom", ui->comboBox->currentText());
if (query11.exec() && query11.next()) {
ui->textBrowser->setText(query11.value(0).toString());
qint8 min=query11.value(0).toInt();
QSqlQuery query12;
query12.prepare("SELECT Quantité FROM Projet.dbo.Produit WHERE Nom=:nom");
query12.bindValue(":nom", ui->comboBox->currentText());
if (query12.exec() && query12.next()) {
qint8 qt = query12.value(0).toInt();
qDebug()<< qt;
qDebug()<< min;
}
if(qt <= min){
QMessageBox::warning(this,"Information","Vous avez atteint le seuil minimal de ce produit. Un message d'alerte sera envoyé au système centrale !");
} |
Partager