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
| void employe::on_pushButton_clicked()
{
if (ui->radioButton->isChecked()){
QString sQuery = "UPDATE Projet.dbo.[Produit] SET Quantité=Quantité+:Q WHERE Nom=':N' ";
QSqlQuery qry;
QString v1=ui->comboBox->currentText();
qint8 v2=ui->spinBox->value();
qry.prepare(sQuery);
qry.bindValue(":N",v1);
qry.bindValue(":Q",v2);
if(qry.exec()){
QMessageBox::information(this,"Information","L'operation d'ajout a été réalisée avec succèss !");}
else {
QMessageBox::warning(this,"Erreur","L'operation d'ajout a rencontré un problème !");
}
} |
Partager