This commit is contained in:
2017-02-27 10:26:00 +01:00
parent e2ab2c4378
commit f1bb5bdcbd
13 changed files with 312 additions and 16 deletions
+22
View File
@@ -252,6 +252,28 @@ qint32 cMySQLPlugin::createGroup(const QString& szGroup)
return(existsGroup(szGroup));
}
bool cMySQLPlugin::deleteIngredient(qint32 id)
{
if(!m_bConnected)
return(false);
QSqlQuery query(m_db);
if(!query.exec(QString("DELETE FROM ingredient_values WHERE ingredient_id=%1").arg(id)))
{
m_szLastError = query.lastError().text();
return(false);
}
if(!query.exec(QString("DELETE FROM ingredient WHERE id=%1").arg(id)))
{
m_szLastError = query.lastError().text();
return(false);
}
return(true);
}
bool cMySQLPlugin::set(qint32 id, qint16 ingredientNumber, qreal value)
{
if(!m_bConnected)