source: src/mvc/conference.cpp @ b6cd05c

qt5
Last change on this file since b6cd05c was 92995da, checked in by pavelpa <pavelpa@…>, 13 years ago

just some directory renaming

  • renamed 'model' to 'mvc' (Model-View-Controller), since it contains also 'delegate' and 'view'
  • Property mode set to 100644
File size: 916 bytes
Line 
1#include "conference.h"
2
3QSqlRecord 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
15QString const Conference::sTableName = QString("conference");
16
17Conference 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
25QList<Conference> Conference::getAll()
26{
27    QSqlQuery query;
28    query.prepare(selectQuery());
29    return load(query);
30}
31
Note: See TracBrowser for help on using the repository browser.