Allow adding sellers during sale phase
This commit is contained in:
parent
a10ba7d7f6
commit
964c926fb0
2 changed files with 5 additions and 2 deletions
|
@ -186,6 +186,8 @@ void Database::beginTransaction() { exec("BEGIN TRANSACTION"); }
|
|||
|
||||
void Database::endTransaction() { exec("END TRANSACTION"); }
|
||||
|
||||
void Database::rollbackTransaction() { exec("ROLLBACK TRANSACTION"); }
|
||||
|
||||
unsigned int Database::storeSellers(std::vector<std::unique_ptr<Seller>>& sellers, bool onlyDelete)
|
||||
{
|
||||
int retCode{};
|
||||
|
@ -221,10 +223,10 @@ unsigned int Database::storeSellers(std::vector<std::unique_ptr<Seller>>& seller
|
|||
retCode = sqlite3_step(stmt);
|
||||
|
||||
if (retCode != SQLITE_DONE) {
|
||||
|
||||
rollbackTransaction();
|
||||
std::string errMsg(sqlite3_errmsg(db_));
|
||||
sqlite3_finalize(stmt);
|
||||
throw std::runtime_error(errMsg);
|
||||
sqlite3_ throw std::runtime_error(errMsg);
|
||||
}
|
||||
++count;
|
||||
sqlite3_finalize(stmt);
|
||||
|
|
|
@ -31,6 +31,7 @@ class Database
|
|||
void init();
|
||||
void beginTransaction();
|
||||
void endTransaction();
|
||||
void rollbackTransaction();
|
||||
void createNew();
|
||||
int getVersion();
|
||||
unsigned int storeArticles(std::vector<Article*> articles);
|
||||
|
|
Loading…
Reference in a new issue