Thanks for your reply again, I have already posted that code it's a soft delete meaning it UPDATES and hides the record instead of complete delete.
query.prepare("UPDATE employee SET is_hidden = '1' WHERE emp_id = (:emp_id)");
query.bindValue(":emp_id", emp_id);
success = query.exec();
if(!success)
{
qDebug() << "removeEmployee error: "
<< query.lastError();
}
else
{
if( tableRow >= 0 )
emit employeeDeleted(tableRow);
this->close();
}
query.prepare("UPDATE employee SET is_hidden = '1' WHERE emp_id = (:emp_id)");
query.bindValue(":emp_id", emp_id);
success = query.exec();
if(!success)
{
qDebug() << "removeEmployee error: "
<< query.lastError();
}
else
{
if( tableRow >= 0 )
emit employeeDeleted(tableRow);
this->close();
}
To copy to clipboard, switch view to plain text mode
Bookmarks