BankAccountModelPrivate(BankAccountModel *parent) : q(parent) { _sql = new QSqlTableModel(q, accountBase()->database()); _sql->setTable(accountBase()->table(Constants::Table_BankDetails)); _sql->setEditStrategy(QSqlTableModel::OnManualSubmit); }
void refreshFeesFromDatabase(const BasicFilter &filter) { AccountBaseQuery query(filter); query.setRetrieveObjects(AccountBaseQuery::Fee); AccountBaseResult result = accountBase()->query(query); _fees = result.fees(); }
void refreshFilter(const QString &userUid) { QHash<int, QString> where; if (userUid.isEmpty()) { where.insert(Constants::BANKDETAILS_USER_UID, QString("='%1'").arg(user()->uuid())); } else { if (userUid == "%") where.insert(Constants::BANKDETAILS_USER_UID, QString("LIKE '%'")); else where.insert(Constants::BANKDETAILS_USER_UID, QString("='%1'").arg(userUid)); } _sql->setFilter(accountBase()->getWhereClause(Constants::Table_BankDetails, where)); _sql->select(); }