Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/plugins/sql/mymoneystoragesql_p.h
Show First 20 Lines • Show All 2849 Lines • ▼ Show 20 Line(s) | 2848 | case SQLAction::Remove: | |||
---|---|---|---|---|---|
2850 | query.bindValue(0, id); | 2850 | query.bindValue(0, id); | ||
2851 | return query.exec(); | 2851 | return query.exec(); | ||
2852 | } | 2852 | } | ||
2853 | return false; | 2853 | return false; | ||
2854 | } | 2854 | } | ||
2855 | 2855 | | |||
2856 | void actOnPayeeIdentifierObjectInSQL(SQLAction action, const payeeIdentifier& obj) | 2856 | void actOnPayeeIdentifierObjectInSQL(SQLAction action, const payeeIdentifier& obj) | ||
2857 | { | 2857 | { | ||
2858 | Q_Q(MyMoneyStorageSql); | | |||
2859 | | ||||
2860 | setupStoragePlugin(obj->payeeIdentifierId()); | 2858 | setupStoragePlugin(obj->payeeIdentifierId()); | ||
2861 | auto isSuccessfull = false; | 2859 | auto isSuccessfull = false; | ||
2862 | 2860 | | |||
2863 | if (obj->payeeIdentifierId() == payeeIdentifiers::ibanBic::staticPayeeIdentifierIid()) | 2861 | if (obj->payeeIdentifierId() == payeeIdentifiers::ibanBic::staticPayeeIdentifierIid()) | ||
2864 | isSuccessfull = actOnIBANBICObjectInSQL(action, obj); | 2862 | isSuccessfull = actOnIBANBICObjectInSQL(action, obj); | ||
2865 | else if (obj->payeeIdentifierId() == payeeIdentifiers::nationalAccount::staticPayeeIdentifierIid()) | 2863 | else if (obj->payeeIdentifierId() == payeeIdentifiers::nationalAccount::staticPayeeIdentifierIid()) | ||
2866 | isSuccessfull = actOnNationalAccountObjectInSQL(action, obj); | 2864 | isSuccessfull = actOnNationalAccountObjectInSQL(action, obj); | ||
2867 | 2865 | | |||
2868 | if (!isSuccessfull) { | 2866 | if (!isSuccessfull) { | ||
2869 | switch (action) { | 2867 | switch (action) { | ||
2870 | case SQLAction::Save: | 2868 | case SQLAction::Save: | ||
2871 | throw MYMONEYEXCEPTION(QString::fromLatin1("Could not save object with id '%1' in database (plugin failed).").arg(obj.idString())); | 2869 | throw MYMONEYEXCEPTION(QString::fromLatin1("Could not save object with id '%1' in database (plugin failed).").arg(obj.idString())); | ||
2872 | case SQLAction::Modify: | 2870 | case SQLAction::Modify: | ||
2873 | throw MYMONEYEXCEPTION(QString::fromLatin1("Could not modify object with id '%1' in database (plugin failed).").arg(obj.idString())); | 2871 | throw MYMONEYEXCEPTION(QString::fromLatin1("Could not modify object with id '%1' in database (plugin failed).").arg(obj.idString())); | ||
2874 | case SQLAction::Remove: | 2872 | case SQLAction::Remove: | ||
2875 | throw MYMONEYEXCEPTION(QString::fromLatin1("Could not remove object with id '%1' from database (plugin failed).").arg(obj.idString())); | 2873 | throw MYMONEYEXCEPTION(QString::fromLatin1("Could not remove object with id '%1' from database (plugin failed).").arg(obj.idString())); | ||
2876 | } | 2874 | } | ||
2877 | } | 2875 | } | ||
2878 | } | 2876 | } | ||
2879 | 2877 | | |||
2880 | void actOnOnlineJobInSQL(SQLAction action, const onlineTask& obj, const QString& id) | 2878 | void actOnOnlineJobInSQL(SQLAction action, const onlineTask& obj, const QString& id) | ||
2881 | { | 2879 | { | ||
2882 | Q_Q(MyMoneyStorageSql); | | |||
2883 | | ||||
2884 | setupStoragePlugin(obj.taskName()); | 2880 | setupStoragePlugin(obj.taskName()); | ||
2885 | auto isSuccessfull = false; | 2881 | auto isSuccessfull = false; | ||
2886 | 2882 | | |||
2887 | if (obj.taskName() == sepaOnlineTransferImpl::name()) | 2883 | if (obj.taskName() == sepaOnlineTransferImpl::name()) | ||
2888 | isSuccessfull = actOnSepaOnlineTransferObjectInSQL(action, obj, id); | 2884 | isSuccessfull = actOnSepaOnlineTransferObjectInSQL(action, obj, id); | ||
2889 | 2885 | | |||
2890 | if (!isSuccessfull) { | 2886 | if (!isSuccessfull) { | ||
2891 | switch (action) { | 2887 | switch (action) { | ||
▲ Show 20 Lines • Show All 240 Lines • Show Last 20 Lines |