From: <gua...@us...> - 2013-10-06 10:27:39
|
Revision: 4749 http://sourceforge.net/p/moneymanagerex/code/4749 Author: guanlisheng Date: 2013-10-06 10:27:35 +0000 (Sun, 06 Oct 2013) Log Message: ----------- prevent create entity record from outside of model xxx Modified Paths: -------------- trunk/src/db/DB_Table.h trunk/src/db/DB_Table_Accountlist_V1.h trunk/src/db/DB_Table_Assets_V1.h trunk/src/db/DB_Table_Billsdeposits_V1.h trunk/src/db/DB_Table_Budgetsplittransactions_V1.h trunk/src/db/DB_Table_Budgettable_V1.h trunk/src/db/DB_Table_Budgetyear_V1.h trunk/src/db/DB_Table_Category_V1.h trunk/src/db/DB_Table_Checkingaccount_V1.h trunk/src/db/DB_Table_Currencyformats_V1.h trunk/src/db/DB_Table_Infotable_V1.h trunk/src/db/DB_Table_Payee_V1.h trunk/src/db/DB_Table_Setting_V1.h trunk/src/db/DB_Table_Splittransactions_V1.h trunk/src/db/DB_Table_Stock_V1.h trunk/src/db/DB_Table_Subcategory_V1.h trunk/src/splitdetailsdialog.cpp trunk/src/splitdetailsdialog.h trunk/src/splittransactionsdialog.cpp trunk/util/sqlite2cpp.py Modified: trunk/src/db/DB_Table.h =================================================================== --- trunk/src/db/DB_Table.h 2013-10-06 08:54:15 UTC (rev 4748) +++ trunk/src/db/DB_Table.h 2013-10-06 10:27:35 UTC (rev 4749) @@ -10,7 +10,7 @@ * @brief * * Revision History: - * AUTO GENERATED at 2013-10-06 15:18:30.953207. + * AUTO GENERATED at 2013-10-06 18:16:25.682721. * DO NOT EDIT! */ //============================================================================= Modified: trunk/src/db/DB_Table_Accountlist_V1.h =================================================================== --- trunk/src/db/DB_Table_Accountlist_V1.h 2013-10-06 08:54:15 UTC (rev 4748) +++ trunk/src/db/DB_Table_Accountlist_V1.h 2013-10-06 10:27:35 UTC (rev 4749) @@ -10,7 +10,7 @@ * @brief * * Revision History: - * AUTO GENERATED at 2013-10-06 15:18:30.953207. + * AUTO GENERATED at 2013-10-06 18:16:25.682721. * DO NOT EDIT! */ //============================================================================= @@ -143,6 +143,7 @@ struct Data { + friend class DB_Table_ACCOUNTLIST_V1; Self* view_; int ACCOUNTID;// primay key @@ -169,6 +170,7 @@ return this->id() < r->id(); } + private: Data(Self* view = 0) { view_ = view; @@ -196,6 +198,7 @@ FAVORITEACCT = q.GetString("FAVORITEACCT"); CURRENCYID = q.GetInt("CURRENCYID"); } + public: wxString to_string(COLUMN col) const { Modified: trunk/src/db/DB_Table_Assets_V1.h =================================================================== --- trunk/src/db/DB_Table_Assets_V1.h 2013-10-06 08:54:15 UTC (rev 4748) +++ trunk/src/db/DB_Table_Assets_V1.h 2013-10-06 10:27:35 UTC (rev 4749) @@ -10,7 +10,7 @@ * @brief * * Revision History: - * AUTO GENERATED at 2013-10-06 15:18:30.953207. + * AUTO GENERATED at 2013-10-06 18:16:25.682721. * DO NOT EDIT! */ //============================================================================= @@ -118,6 +118,7 @@ struct Data { + friend class DB_Table_ASSETS_V1; Self* view_; int ASSETID;// primay key @@ -139,6 +140,7 @@ return this->id() < r->id(); } + private: Data(Self* view = 0) { view_ = view; @@ -161,6 +163,7 @@ VALUECHANGERATE = q.GetDouble("VALUECHANGERATE"); ASSETTYPE = q.GetString("ASSETTYPE"); } + public: wxString to_string(COLUMN col) const { Modified: trunk/src/db/DB_Table_Billsdeposits_V1.h =================================================================== --- trunk/src/db/DB_Table_Billsdeposits_V1.h 2013-10-06 08:54:15 UTC (rev 4748) +++ trunk/src/db/DB_Table_Billsdeposits_V1.h 2013-10-06 10:27:35 UTC (rev 4749) @@ -10,7 +10,7 @@ * @brief * * Revision History: - * AUTO GENERATED at 2013-10-06 15:18:30.953207. + * AUTO GENERATED at 2013-10-06 18:16:25.682721. * DO NOT EDIT! */ //============================================================================= @@ -163,6 +163,7 @@ struct Data { + friend class DB_Table_BILLSDEPOSITS_V1; Self* view_; int BDID;// primay key @@ -193,6 +194,7 @@ return this->id() < r->id(); } + private: Data(Self* view = 0) { view_ = view; @@ -232,6 +234,7 @@ NEXTOCCURRENCEDATE = q.GetString("NEXTOCCURRENCEDATE"); NUMOCCURRENCES = q.GetInt("NUMOCCURRENCES"); } + public: wxString to_string(COLUMN col) const { Modified: trunk/src/db/DB_Table_Budgetsplittransactions_V1.h =================================================================== --- trunk/src/db/DB_Table_Budgetsplittransactions_V1.h 2013-10-06 08:54:15 UTC (rev 4748) +++ trunk/src/db/DB_Table_Budgetsplittransactions_V1.h 2013-10-06 10:27:35 UTC (rev 4749) @@ -10,7 +10,7 @@ * @brief * * Revision History: - * AUTO GENERATED at 2013-10-06 15:18:30.953207. + * AUTO GENERATED at 2013-10-06 18:16:25.682721. * DO NOT EDIT! */ //============================================================================= @@ -103,6 +103,7 @@ struct Data { + friend class DB_Table_BUDGETSPLITTRANSACTIONS_V1; Self* view_; int SPLITTRANSID;// primay key @@ -121,6 +122,7 @@ return this->id() < r->id(); } + private: Data(Self* view = 0) { view_ = view; @@ -142,6 +144,7 @@ SUBCATEGID = q.GetInt("SUBCATEGID"); SPLITTRANSAMOUNT = q.GetDouble("SPLITTRANSAMOUNT"); } + public: wxString to_string(COLUMN col) const { Modified: trunk/src/db/DB_Table_Budgettable_V1.h =================================================================== --- trunk/src/db/DB_Table_Budgettable_V1.h 2013-10-06 08:54:15 UTC (rev 4748) +++ trunk/src/db/DB_Table_Budgettable_V1.h 2013-10-06 10:27:35 UTC (rev 4749) @@ -10,7 +10,7 @@ * @brief * * Revision History: - * AUTO GENERATED at 2013-10-06 15:18:30.953207. + * AUTO GENERATED at 2013-10-06 18:16:25.682721. * DO NOT EDIT! */ //============================================================================= @@ -108,6 +108,7 @@ struct Data { + friend class DB_Table_BUDGETTABLE_V1; Self* view_; int BUDGETENTRYID;// primay key @@ -127,6 +128,7 @@ return this->id() < r->id(); } + private: Data(Self* view = 0) { view_ = view; @@ -149,6 +151,7 @@ PERIOD = q.GetString("PERIOD"); AMOUNT = q.GetDouble("AMOUNT"); } + public: wxString to_string(COLUMN col) const { Modified: trunk/src/db/DB_Table_Budgetyear_V1.h =================================================================== --- trunk/src/db/DB_Table_Budgetyear_V1.h 2013-10-06 08:54:15 UTC (rev 4748) +++ trunk/src/db/DB_Table_Budgetyear_V1.h 2013-10-06 10:27:35 UTC (rev 4749) @@ -10,7 +10,7 @@ * @brief * * Revision History: - * AUTO GENERATED at 2013-10-06 15:18:30.953207. + * AUTO GENERATED at 2013-10-06 18:16:25.682721. * DO NOT EDIT! */ //============================================================================= @@ -88,6 +88,7 @@ struct Data { + friend class DB_Table_BUDGETYEAR_V1; Self* view_; int BUDGETYEARID;// primay key @@ -103,6 +104,7 @@ return this->id() < r->id(); } + private: Data(Self* view = 0) { view_ = view; @@ -117,6 +119,7 @@ BUDGETYEARID = q.GetInt("BUDGETYEARID"); BUDGETYEARNAME = q.GetString("BUDGETYEARNAME"); } + public: wxString to_string(COLUMN col) const { Modified: trunk/src/db/DB_Table_Category_V1.h =================================================================== --- trunk/src/db/DB_Table_Category_V1.h 2013-10-06 08:54:15 UTC (rev 4748) +++ trunk/src/db/DB_Table_Category_V1.h 2013-10-06 10:27:35 UTC (rev 4749) @@ -10,7 +10,7 @@ * @brief * * Revision History: - * AUTO GENERATED at 2013-10-06 15:18:30.953207. + * AUTO GENERATED at 2013-10-06 18:16:25.682721. * DO NOT EDIT! */ //============================================================================= @@ -88,6 +88,7 @@ struct Data { + friend class DB_Table_CATEGORY_V1; Self* view_; int CATEGID;// primay key @@ -103,6 +104,7 @@ return this->id() < r->id(); } + private: Data(Self* view = 0) { view_ = view; @@ -117,6 +119,7 @@ CATEGID = q.GetInt("CATEGID"); CATEGNAME = q.GetString("CATEGNAME"); } + public: wxString to_string(COLUMN col) const { Modified: trunk/src/db/DB_Table_Checkingaccount_V1.h =================================================================== --- trunk/src/db/DB_Table_Checkingaccount_V1.h 2013-10-06 08:54:15 UTC (rev 4748) +++ trunk/src/db/DB_Table_Checkingaccount_V1.h 2013-10-06 10:27:35 UTC (rev 4749) @@ -10,7 +10,7 @@ * @brief * * Revision History: - * AUTO GENERATED at 2013-10-06 15:18:30.953207. + * AUTO GENERATED at 2013-10-06 18:16:25.682721. * DO NOT EDIT! */ //============================================================================= @@ -148,6 +148,7 @@ struct Data { + friend class DB_Table_CHECKINGACCOUNT_V1; Self* view_; int TRANSID;// primay key @@ -175,6 +176,7 @@ return this->id() < r->id(); } + private: Data(Self* view = 0) { view_ = view; @@ -209,6 +211,7 @@ FOLLOWUPID = q.GetInt("FOLLOWUPID"); TOTRANSAMOUNT = q.GetDouble("TOTRANSAMOUNT"); } + public: wxString to_string(COLUMN col) const { Modified: trunk/src/db/DB_Table_Currencyformats_V1.h =================================================================== --- trunk/src/db/DB_Table_Currencyformats_V1.h 2013-10-06 08:54:15 UTC (rev 4748) +++ trunk/src/db/DB_Table_Currencyformats_V1.h 2013-10-06 10:27:35 UTC (rev 4749) @@ -10,7 +10,7 @@ * @brief * * Revision History: - * AUTO GENERATED at 2013-10-06 15:18:30.953207. + * AUTO GENERATED at 2013-10-06 18:16:25.682721. * DO NOT EDIT! */ //============================================================================= @@ -133,6 +133,7 @@ struct Data { + friend class DB_Table_CURRENCYFORMATS_V1; Self* view_; int CURRENCYID;// primay key @@ -157,6 +158,7 @@ return this->id() < r->id(); } + private: Data(Self* view = 0) { view_ = view; @@ -182,6 +184,7 @@ BASECONVRATE = q.GetDouble("BASECONVRATE"); CURRENCY_SYMBOL = q.GetString("CURRENCY_SYMBOL"); } + public: wxString to_string(COLUMN col) const { Modified: trunk/src/db/DB_Table_Infotable_V1.h =================================================================== --- trunk/src/db/DB_Table_Infotable_V1.h 2013-10-06 08:54:15 UTC (rev 4748) +++ trunk/src/db/DB_Table_Infotable_V1.h 2013-10-06 10:27:35 UTC (rev 4749) @@ -10,7 +10,7 @@ * @brief * * Revision History: - * AUTO GENERATED at 2013-10-06 15:18:30.953207. + * AUTO GENERATED at 2013-10-06 18:16:25.682721. * DO NOT EDIT! */ //============================================================================= @@ -93,6 +93,7 @@ struct Data { + friend class DB_Table_INFOTABLE_V1; Self* view_; int INFOID;// primay key @@ -109,6 +110,7 @@ return this->id() < r->id(); } + private: Data(Self* view = 0) { view_ = view; @@ -124,6 +126,7 @@ INFONAME = q.GetString("INFONAME"); INFOVALUE = q.GetString("INFOVALUE"); } + public: wxString to_string(COLUMN col) const { Modified: trunk/src/db/DB_Table_Payee_V1.h =================================================================== --- trunk/src/db/DB_Table_Payee_V1.h 2013-10-06 08:54:15 UTC (rev 4748) +++ trunk/src/db/DB_Table_Payee_V1.h 2013-10-06 10:27:35 UTC (rev 4749) @@ -10,7 +10,7 @@ * @brief * * Revision History: - * AUTO GENERATED at 2013-10-06 15:18:30.953207. + * AUTO GENERATED at 2013-10-06 18:16:25.682721. * DO NOT EDIT! */ //============================================================================= @@ -98,6 +98,7 @@ struct Data { + friend class DB_Table_PAYEE_V1; Self* view_; int PAYEEID;// primay key @@ -115,6 +116,7 @@ return this->id() < r->id(); } + private: Data(Self* view = 0) { view_ = view; @@ -133,6 +135,7 @@ CATEGID = q.GetInt("CATEGID"); SUBCATEGID = q.GetInt("SUBCATEGID"); } + public: wxString to_string(COLUMN col) const { Modified: trunk/src/db/DB_Table_Setting_V1.h =================================================================== --- trunk/src/db/DB_Table_Setting_V1.h 2013-10-06 08:54:15 UTC (rev 4748) +++ trunk/src/db/DB_Table_Setting_V1.h 2013-10-06 10:27:35 UTC (rev 4749) @@ -10,7 +10,7 @@ * @brief * * Revision History: - * AUTO GENERATED at 2013-10-06 15:18:30.953207. + * AUTO GENERATED at 2013-10-06 18:16:25.682721. * DO NOT EDIT! */ //============================================================================= @@ -93,6 +93,7 @@ struct Data { + friend class DB_Table_SETTING_V1; Self* view_; int SETTINGID;// primay key @@ -109,6 +110,7 @@ return this->id() < r->id(); } + private: Data(Self* view = 0) { view_ = view; @@ -124,6 +126,7 @@ SETTINGNAME = q.GetString("SETTINGNAME"); SETTINGVALUE = q.GetString("SETTINGVALUE"); } + public: wxString to_string(COLUMN col) const { Modified: trunk/src/db/DB_Table_Splittransactions_V1.h =================================================================== --- trunk/src/db/DB_Table_Splittransactions_V1.h 2013-10-06 08:54:15 UTC (rev 4748) +++ trunk/src/db/DB_Table_Splittransactions_V1.h 2013-10-06 10:27:35 UTC (rev 4749) @@ -10,7 +10,7 @@ * @brief * * Revision History: - * AUTO GENERATED at 2013-10-06 15:18:30.953207. + * AUTO GENERATED at 2013-10-06 18:16:25.682721. * DO NOT EDIT! */ //============================================================================= @@ -103,6 +103,7 @@ struct Data { + friend class DB_Table_SPLITTRANSACTIONS_V1; Self* view_; int SPLITTRANSID;// primay key @@ -121,6 +122,7 @@ return this->id() < r->id(); } + private: Data(Self* view = 0) { view_ = view; @@ -142,6 +144,7 @@ SUBCATEGID = q.GetInt("SUBCATEGID"); SPLITTRANSAMOUNT = q.GetDouble("SPLITTRANSAMOUNT"); } + public: wxString to_string(COLUMN col) const { Modified: trunk/src/db/DB_Table_Stock_V1.h =================================================================== --- trunk/src/db/DB_Table_Stock_V1.h 2013-10-06 08:54:15 UTC (rev 4748) +++ trunk/src/db/DB_Table_Stock_V1.h 2013-10-06 10:27:35 UTC (rev 4749) @@ -10,7 +10,7 @@ * @brief * * Revision History: - * AUTO GENERATED at 2013-10-06 15:18:30.953207. + * AUTO GENERATED at 2013-10-06 18:16:25.682721. * DO NOT EDIT! */ //============================================================================= @@ -133,6 +133,7 @@ struct Data { + friend class DB_Table_STOCK_V1; Self* view_; int STOCKID;// primay key @@ -157,6 +158,7 @@ return this->id() < r->id(); } + private: Data(Self* view = 0) { view_ = view; @@ -186,6 +188,7 @@ VALUE = q.GetDouble("VALUE"); COMMISSION = q.GetDouble("COMMISSION"); } + public: wxString to_string(COLUMN col) const { Modified: trunk/src/db/DB_Table_Subcategory_V1.h =================================================================== --- trunk/src/db/DB_Table_Subcategory_V1.h 2013-10-06 08:54:15 UTC (rev 4748) +++ trunk/src/db/DB_Table_Subcategory_V1.h 2013-10-06 10:27:35 UTC (rev 4749) @@ -10,7 +10,7 @@ * @brief * * Revision History: - * AUTO GENERATED at 2013-10-06 15:18:30.953207. + * AUTO GENERATED at 2013-10-06 18:16:25.682721. * DO NOT EDIT! */ //============================================================================= @@ -93,6 +93,7 @@ struct Data { + friend class DB_Table_SUBCATEGORY_V1; Self* view_; int SUBCATEGID;// primay key @@ -109,6 +110,7 @@ return this->id() < r->id(); } + private: Data(Self* view = 0) { view_ = view; @@ -125,6 +127,7 @@ SUBCATEGNAME = q.GetString("SUBCATEGNAME"); CATEGID = q.GetInt("CATEGID"); } + public: wxString to_string(COLUMN col) const { Modified: trunk/src/splitdetailsdialog.cpp =================================================================== --- trunk/src/splitdetailsdialog.cpp 2013-10-06 08:54:15 UTC (rev 4748) +++ trunk/src/splitdetailsdialog.cpp 2013-10-06 10:27:35 UTC (rev 4749) @@ -40,7 +40,7 @@ } SplitDetailDialog::SplitDetailDialog( - Model_Splittransaction::Data split + Model_Splittransaction::Data* split , mmCoreDB* core , const wxString categString , int* categID @@ -53,8 +53,8 @@ , const wxPoint& pos , const wxSize& size , long style ) + : split_(split) { - split_ = split; core_ = core; m_categID_ = categID; m_subcategID_ = subcategID; Modified: trunk/src/splitdetailsdialog.h =================================================================== --- trunk/src/splitdetailsdialog.h 2013-10-06 08:54:15 UTC (rev 4748) +++ trunk/src/splitdetailsdialog.h 2013-10-06 10:27:35 UTC (rev 4749) @@ -63,7 +63,7 @@ /// Constructors SplitDetailDialog( ); SplitDetailDialog( - Model_Splittransaction::Data split + Model_Splittransaction::Data* split , mmCoreDB* core, const wxString categString, int* categID, @@ -114,7 +114,7 @@ static bool ShowToolTips(); ////@begin SplitDetailDialog member variables - Model_Splittransaction::Data split_; + Model_Splittransaction::Data* split_; mmCoreDB* core_; int transType_; int localTransType_; Modified: trunk/src/splittransactionsdialog.cpp =================================================================== --- trunk/src/splittransactionsdialog.cpp 2013-10-06 08:54:15 UTC (rev 4748) +++ trunk/src/splittransactionsdialog.cpp 2013-10-06 10:27:35 UTC (rev 4749) @@ -179,7 +179,7 @@ double amount = 0.0; Model_Splittransaction::Data *split = Model_Splittransaction::instance().create(); - SplitDetailDialog sdd(*split, core_, _("&Select Category"), &categID, &subcategID, &amount, transType_, this); + SplitDetailDialog sdd(split, core_, _("&Select Category"), &categID, &subcategID, &amount, transType_, this); if (sdd.ShowModal() == wxID_OK) { int numToInsert = lcSplit_->GetItemCount(); @@ -264,7 +264,7 @@ wxString category_name = Model_Category::full_name(category, sub_category); - SplitDetailDialog sdd(split_[item], core_, category_name, &categID, &subCategID, &amount, transType_, this); + SplitDetailDialog sdd(&split_[item], core_, category_name, &categID, &subCategID, &amount, transType_, this); if (sdd.ShowModal() == wxID_OK) { splt_->entries_[item]->categID_ = categID; Modified: trunk/util/sqlite2cpp.py =================================================================== --- trunk/util/sqlite2cpp.py 2013-10-06 08:54:15 UTC (rev 4748) +++ trunk/util/sqlite2cpp.py 2013-10-06 10:27:35 UTC (rev 4749) @@ -163,8 +163,9 @@ s += ''' struct Data { + friend class DB_Table_%s; Self* view_; - ''' + ''' % self._table.upper() for field in self._fields: s += ''' %s %s;%s''' % (base_data_types_reverse[field['type']], field['name'], field['pk'] and '// primay key' or '') @@ -183,6 +184,7 @@ ''' % (self._primay_key, self._primay_key) s += ''' + private: Data(Self* view = 0) { view_ = view; @@ -214,6 +216,7 @@ s += ''' } + public: ''' s +=''' wxString to_string(COLUMN col) const This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |