just some directory renaming
[toast/confclerk.git] / src / mvc / conference.cpp
1 #include "conference.h"
2
3 QSqlRecord const Conference::sColumns = Conference::toRecord(QList<QSqlField>()
4     << QSqlField("id", QVariant::Int)
5     << QSqlField("title", QVariant::String)
6     << QSqlField("subtitle", QVariant::String)
7     << QSqlField("venue", QVariant::String)
8     << QSqlField("city", QVariant::String)
9     << QSqlField("start", QVariant::DateTime)
10     << QSqlField("end", QVariant::DateTime)
11     << QSqlField("days", QVariant::Int)
12     << QSqlField("day_change", QVariant::Int)
13     << QSqlField("timeslot_duration", QVariant::Int));
14
15 QString const Conference::sTableName = QString("conference");
16
17 Conference Conference::getById(int id)
18 {
19     QSqlQuery query;
20     query.prepare(selectQuery() + "WHERE id = :id");
21     query.bindValue(":id", id);
22     return loadOne(query);
23 }
24
25 QList<Conference> Conference::getAll()
26 {
27     QSqlQuery query;
28     query.prepare(selectQuery());
29     return load(query);
30 }
31