Changeset 395d6d3 for src/mvc/event.cpp


Ignore:
Timestamp:
01/19/10 20:44:23 (12 years ago)
Author:
pavelpa <pavelpa@…>
Branches:
master, qt5
Children:
9208bdb
Parents:
c53a3f4
Message:

event-dialog - displayed persons/presenters names

  • implemented Event::persons() method to get persons names associated with the given event ID
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mvc/event.cpp

    rc53a3f4 r395d6d3  
    7373{
    7474    QSqlQuery query;
     75    // TODO: conference ID isn't used here
    7576    query.prepare("SELECT name FROM room WHERE id = (SELECT xid_room FROM event_room WHERE xid_event = :id)");
    7677    query.bindValue(":id", id());
     
    8485}
    8586
     87QStringList Event::persons() const
     88{
     89    QSqlQuery query;
     90    // TODO: conference ID isn't used here
     91    query.prepare("SELECT person.name FROM person INNER JOIN event_person ON person.id = event_person.xid_person AND event_person.xid_event = :id");
     92    query.bindValue(":id", id());
     93    query.exec();
     94    // TODO: handle qeury error
     95    //qDebug() << query.lastError();
     96
     97    QStringList persons;
     98    while(query.next())
     99        persons.append(query.record().value("name").toString());
     100
     101    return persons;
     102}
     103
    86104void Event::setRoom(const QString &room)
    87105{
     106    Q_UNUSED(room);
     107
    88108    qWarning("WARINING: setRoom() is NOT IMPLEMENTED YET");
    89109    // TODO: implement
    90110}
    91111
     112void Event::setPersons(const QStringList &persons)
     113{
     114    Q_UNUSED(persons);
     115
     116    qWarning("WARINING: setPersons() is NOT IMPLEMENTED YET");
     117    // TODO: implement
     118}
     119
Note: See TracChangeset for help on using the changeset viewer.