Changeset f09a1b9 for src/sql/sqlengine.cpp
- Timestamp:
- 06/23/11 14:13:09 (12 years ago)
- Branches:
- master, qt5
- Children:
- a0f3e32
- Parents:
- 141a5c2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sql/sqlengine.cpp
r141a5c2 rf09a1b9 154 154 startDateTime.setTimeSpec(Qt::UTC); 155 155 startDateTime = QDateTime(QDate::fromString(aEvent["date"],DATE_FORMAT),QTime::fromString(aEvent["start"],TIME_FORMAT),Qt::UTC); 156 qDebug() << "startDateTime: " << startDateTime.toString();156 // qDebug() << "startDateTime: " << startDateTime.toString(); 157 157 158 158 bool event_exists = false; … … 248 248 if(query.next()) // ROOM record with 'name' already exists: we need to get its 'id' 249 249 { 250 aRoom["id"] = query.value(0).to Int();250 aRoom["id"] = query.value(0).toString(); 251 251 } 252 252 else // ROOM record doesn't exist yet, need to create it … … 258 258 query.bindValue(":xid_picture", aRoom["picture"]); 259 259 if (!query.exec()) qDebug() << "Could not execute 'insert into room ...' query." << query.lastError(); 260 aRoom["id"] = query.lastInsertId().toInt(); // 'id' is assigned automatically260 aRoom["id"]= query.lastInsertId().toString(); // 'id' is assigned automatically 261 261 //LOG_AUTOTEST(query); 262 262 } 263 263 query = QSqlQuery(db); 264 query.prepare("INSERT INTO EVENT_ROOM (xid_conference,xid_event,xid_room) VALUES (:conference_id, :event_id, :room Id)");264 query.prepare("INSERT INTO EVENT_ROOM (xid_conference,xid_event,xid_room) VALUES (:conference_id, :event_id, :room_id)"); 265 265 query.bindValue(":conference_id", aRoom["conference_id"]); 266 266 query.bindValue(":event_id", aRoom["event_id"]); 267 query.bindValue(":room Id", aRoom["id"]);267 query.bindValue(":room_id", aRoom["id"]); 268 268 if (!query.exec()) qDebug() << "Could not 'execute insert into event_room' query:" << query.lastError(); 269 269 //LOG_AUTOTEST(query);
Note: See TracChangeset
for help on using the changeset viewer.