From: <gua...@us...> - 2013-10-07 11:47:28
|
Revision: 4784 http://sourceforge.net/p/moneymanagerex/code/4784 Author: guanlisheng Date: 2013-10-07 11:47:23 +0000 (Mon, 07 Oct 2013) Log Message: ----------- batch save for Model_Billsdeposits and Model_Splittransaction Modified Paths: -------------- trunk/src/model/Model_Billsdeposits.h trunk/src/model/Model_Splittransaction.h Modified: trunk/src/model/Model_Billsdeposits.h =================================================================== --- trunk/src/model/Model_Billsdeposits.h 2013-10-07 11:04:32 UTC (rev 4783) +++ trunk/src/model/Model_Billsdeposits.h 2013-10-07 11:47:23 UTC (rev 4784) @@ -59,6 +59,15 @@ r->save(this->db_); return r->id(); } + int save(Data_Set& rows) + { + this->Begin(); + for (auto& r : rows) this->save(&r); + this->Commit(); + + return rows.size(); + } + }; #endif // Modified: trunk/src/model/Model_Splittransaction.h =================================================================== --- trunk/src/model/Model_Splittransaction.h 2013-10-07 11:04:32 UTC (rev 4783) +++ trunk/src/model/Model_Splittransaction.h 2013-10-07 11:47:23 UTC (rev 4784) @@ -50,6 +50,14 @@ r->save(this->db_); return r->id(); } + int save(Data_Set& rows) + { + this->Begin(); + for (auto& r : rows) this->save(&r); + this->Commit(); + + return rows.size(); + } }; #endif // This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |