- Timestamp:
- 10/17/11 22:50:54 (11 years ago)
- Branches:
- master, qt5
- Children:
- 11d7ec5
- Parents:
- 1ca13ef
- Location:
- src/mvc
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mvc/event.cpp
r1ca13ef r066b41f 78 78 } 79 79 80 QList<Event> Event::nowEvents(int conferenceId, QString orderBy) 81 { 82 uint curTime_t = QDateTime(QDate::currentDate(),QTime::currentTime(),Qt::UTC).toTime_t(); 83 //uint curTime_t = 1265457610; // for testing 84 85 QSqlQuery query; 86 query.prepare(selectQuery() + QString("WHERE xid_conference = :conf AND start <= :now1 AND ( start + duration ) > :now2 ORDER BY %1").arg(orderBy)); 87 query.bindValue(":conf", conferenceId); 88 query.bindValue(":now1", convertToDb(curTime_t, QVariant::DateTime)); 89 query.bindValue(":now2", convertToDb(curTime_t, QVariant::DateTime)); 90 91 return load(query); 92 } 93 94 QList<Event> Event::conflictEvents(int aEventId, int conferenceId) 95 { 80 81 QList<Event> Event::conflictEvents(int aEventId, int conferenceId) { 96 82 QSqlQuery query; 97 83 Event event = Event::getById(aEventId,conferenceId); … … 109 95 return load(query); 110 96 } 97 111 98 112 99 QList<Event> Event::getFavByDate(const QDate& date, int conferenceId) -
src/mvc/event.h
r1ca13ef r066b41f 47 47 static QList<Event> getFavByDate(const QDate & date, int conferenceId); // get Favourities by Date 48 48 static QList<Event> getSearchResultByDate(const QDate& date, int conferenceId, QString orderBy); 49 static QList<Event> nowEvents(int conferenceId, QString orderBy); // get events scheduled NOW50 49 static QList<Event> getByTrack(int id); 51 50 static QList<Event> getByDateAndRoom(const QDate& date, int conferenceId); -
src/mvc/eventmodel.cpp
r1ca13ef r066b41f 301 301 } 302 302 303 void EventModel::loadNowEvents(int aConferenceId) 304 { 305 clearModel(); 306 // check for existence of the conference in the DB 307 if(Conference::getAll().count()) 308 { 309 mEvents = Event::nowEvents(aConferenceId, "start"); 310 } 311 createTimeGroups(); 312 } 313 314 void EventModel::loadConflictEvents(int aEventId, int aConferenceId) 315 { 303 304 void EventModel::loadConflictEvents(int aEventId, int aConferenceId) { 316 305 clearModel(); 317 306 // check for existence of the conference in the DB -
src/mvc/eventmodel.h
r1ca13ef r066b41f 40 40 void loadEventsByTrack(const QDate &aDate, int aConferenceId); // loads Events sorted by Track id and Event start from the DB 41 41 int loadSearchResultEvents(const QDate &aDate, int aConferenceId); 42 void loadNowEvents(int aConferenceId); // loads Now events from the DB43 42 void loadEventsByRoom(const QDate &aDate, int aConferenceId); 44 43 void loadConflictEvents(int aEventId, int aConferenceId); // loads events in conflict
Note: See TracChangeset
for help on using the changeset viewer.