Ignore:
Timestamp:
01/27/10 16:31:10 (12 years ago)
Author:
pavelpa <pavelpa@…>
Branches:
master, qt5
Children:
a790a90
Parents:
07ae23a
Message:

removed appsettings

  • created 'active' column in 'conference' table
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mvc/conference.cpp

    r07ae23a r0bb39f5  
    1111    << QSqlField("days", QVariant::Int)
    1212    << QSqlField("day_change", QVariant::Int)
    13     << QSqlField("timeslot_duration", QVariant::Int));
     13    << QSqlField("timeslot_duration", QVariant::Int)
     14    << QSqlField("active", QVariant::Bool));
    1415
    1516QString const Conference::sTableName = QString("conference");
     
    3031}
    3132
     33int Conference::activeConference()
     34{
     35    QSqlQuery query("SELECT id FROM conference WHERE active = 1");
     36    query.exec();
     37
     38    QList<int> activeConfs;
     39    while(query.next())
     40        activeConfs.append(query.record().value("id").toInt());
     41
     42    if(activeConfs.count()==0) // no active DB
     43        return 1;
     44    else // even if there are more active confs, the first from the list is confidered active
     45        return activeConfs[0];
     46}
     47
Note: See TracChangeset for help on using the changeset viewer.