return load(query);
}
-QList<Event> Event::nowEvents(int conferenceId, QString orderBy)
-{
- uint curTime_t = QDateTime(QDate::currentDate(),QTime::currentTime(),Qt::UTC).toTime_t();
- //uint curTime_t = 1265457610; // for testing
- QSqlQuery query;
- query.prepare(selectQuery() + QString("WHERE xid_conference = :conf AND start <= :now1 AND ( start + duration ) > :now2 ORDER BY %1").arg(orderBy));
- query.bindValue(":conf", conferenceId);
- query.bindValue(":now1", convertToDb(curTime_t, QVariant::DateTime));
- query.bindValue(":now2", convertToDb(curTime_t, QVariant::DateTime));
-
- return load(query);
-}
-
-QList<Event> Event::conflictEvents(int aEventId, int conferenceId)
-{
+QList<Event> Event::conflictEvents(int aEventId, int conferenceId) {
QSqlQuery query;
Event event = Event::getById(aEventId,conferenceId);
query.prepare(selectQuery() + "WHERE xid_conference = :conf AND ( \
return load(query);
}
+
QList<Event> Event::getFavByDate(const QDate& date, int conferenceId)
{
QSqlQuery query;
static QList<Event> getByDate(const QDate & date, int conferenceId, QString orderBy);
static QList<Event> getFavByDate(const QDate & date, int conferenceId); // get Favourities by Date
static QList<Event> getSearchResultByDate(const QDate& date, int conferenceId, QString orderBy);
- static QList<Event> nowEvents(int conferenceId, QString orderBy); // get events scheduled NOW
static QList<Event> getByTrack(int id);
static QList<Event> getByDateAndRoom(const QDate& date, int conferenceId);
static QList<Event> conflictEvents(int aEventId, int conferenceId);
createRoomGroups();
}
-void EventModel::loadNowEvents(int aConferenceId)
-{
- clearModel();
- // check for existence of the conference in the DB
- if(Conference::getAll().count())
- {
- mEvents = Event::nowEvents(aConferenceId, "start");
- }
- createTimeGroups();
-}
-void EventModel::loadConflictEvents(int aEventId, int aConferenceId)
-{
+void EventModel::loadConflictEvents(int aEventId, int aConferenceId) {
clearModel();
// check for existence of the conference in the DB
if(Conference::getAll().count())
void loadFavEvents(const QDate &aDate, int aConferenceId); // loads Favourite events from the DB
void loadEventsByTrack(const QDate &aDate, int aConferenceId); // loads Events sorted by Track id and Event start from the DB
int loadSearchResultEvents(const QDate &aDate, int aConferenceId);
- void loadNowEvents(int aConferenceId); // loads Now events from the DB
void loadEventsByRoom(const QDate &aDate, int aConferenceId);
void loadConflictEvents(int aEventId, int aConferenceId); // loads events in conflict
void clearModel();