- Timestamp:
- 01/21/10 10:49:41 (13 years ago)
- Branches:
- master, qt5
- Children:
- 72cd3af
- Parents:
- 842f5f9
- Location:
- src/mvc
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mvc/event.cpp
r842f5f9 re662750 114 114 } 115 115 116 QList<Event> Event::getSearchResultByDate(const QDate& date, int conferenceId, QString orderBy) 117 { 118 119 QString strQuery = QString("SELECT %1 FROM EVENT INNER JOIN VIRTUAL_EVENT USING (xid_conference, id) " 120 "INNER JOIN SEARCH_EVENT USING (xid_conference, id) ").arg( columnsForSelectJoin2T() ); 121 strQuery += QString( 122 "WHERE %1.xid_conference = :conf AND %1.start >= :start AND %1.start < :end ORDER BY %1.%2").arg(sTable1Name, orderBy); 123 qDebug() << strQuery; 124 QSqlQuery query; 125 query.prepare( strQuery ); 126 query.bindValue(":conf", conferenceId); 127 query.bindValue(":start", convertToDb(date, QVariant::DateTime)); 128 query.bindValue(":end", convertToDb(date.addDays(1), QVariant::DateTime)); 129 130 return load(query); 131 } 132 -
src/mvc/event.h
r842f5f9 re662750 28 28 static QList<Event> getByDate(const QDate & date, int conferenceId, QString orderBy); 29 29 static QList<Event> getFavByDate(const QDate & date, int conferenceId); // get Favourities by Date 30 static QList<Event> getSearchResultByDate(const QDate& date, int conferenceId, QString orderBy); 30 31 public: 31 32 // Table 1 -
src/mvc/eventmodel.cpp
r842f5f9 re662750 183 183 } 184 184 185 void EventModel::loadSearchResultEvents(const QDate &aDate, int aConferenceId) 186 { 187 clearModel(); 188 // check for existence of the conference in the DB 189 if(Conference::getAll().count()) 190 { 191 qDebug() << "Loading search result Data: [" << Conference::getById(aConferenceId).title() << "] " << aDate; 192 mEvents = Event::getSearchResultByDate(QDate(aDate.year(), aDate.month(), aDate.day()), aConferenceId, "start"); 193 } 194 createTimeGroups(); 195 } 196 185 197 void EventModel::loadEventsByTrack(const QDate &aDate, int aConferenceId) 186 198 { -
src/mvc/eventmodel.h
r842f5f9 re662750 20 20 void loadFavEvents(const QDate &aDate, int aConferenceId); // loads Favourite events from the DB 21 21 void loadEventsByTrack(const QDate &aDate, int aConferenceId); // loads Events grouped by Track from the DB 22 void loadSearchResultEvents(const QDate &aDate, int aConferenceId); 22 23 // a method to force 'EventModel' emit signal 'dataChanged()' 23 24 // a 'view', eg. 'TreeView' listens for this signal and redraws changed items(indexes)
Note: See TracChangeset
for help on using the changeset viewer.