void homestead::UpdateProperty() {
QString propQryPrep
= "UPDATE property_";
propQryPrep.append(this->dbYear);
propQryPrep.append(" SET \
county = :county, \
cntyname = :cntyname, \
txdistrict = :txdistrict, \
legal = :legal, \
parcel_id = :parcel_id, \
pvalue = :pvalue, \
entry_id = :entry_id, \
entry_date = :entry_date, \
notes = :notes \
WHERE proprty_id = :proprty_id");
propQry.prepare(propQryPrep);
propQry.bindValue(":county",ui.leCountyNumber->text().toInt());
propQry.bindValue(":cntyname",ui.cboCountyName->currentText());
propQry.bindValue(":txdistrict",ui.leTaxDistrict->text());
propQry.bindValue(":legal",ui.txtLegal->toPlainText());
propQry.bindValue(":parcel_id",ui.leParcelID->text());
propQry.bindValue(":pvalue",ui.leHomeValue->text().toInt());
propQry.bindValue(":entry_id",homestead::RevID);
propQry.bindValue(":entry_date",dtNow);
propQry.bindValue(":notes",ui.teNotes->toPlainText());
propQry.bindValue(":proprty_id",ui.leProprtyID->text().toInt());
if (propQry.exec()) {
ui.leStatus->setText("Property record: "+ui.leProprtyID->text()+" updated!");
} else {
ui.leStatus->setText("Cannot updated property record: "+ui.leProprtyID->text());
}
}
void homestead::UpdateProperty() {
QDateTime dtNow = QDateTime::currentDateTime();
QString propQryPrep = "UPDATE property_";
propQryPrep.append(this->dbYear);
propQryPrep.append(" SET \
county = :county, \
cntyname = :cntyname, \
txdistrict = :txdistrict, \
legal = :legal, \
parcel_id = :parcel_id, \
pvalue = :pvalue, \
entry_id = :entry_id, \
entry_date = :entry_date, \
notes = :notes \
WHERE proprty_id = :proprty_id");
propQry.prepare(propQryPrep);
propQry.bindValue(":county",ui.leCountyNumber->text().toInt());
propQry.bindValue(":cntyname",ui.cboCountyName->currentText());
propQry.bindValue(":txdistrict",ui.leTaxDistrict->text());
propQry.bindValue(":legal",ui.txtLegal->toPlainText());
propQry.bindValue(":parcel_id",ui.leParcelID->text());
propQry.bindValue(":pvalue",ui.leHomeValue->text().toInt());
propQry.bindValue(":entry_id",homestead::RevID);
propQry.bindValue(":entry_date",dtNow);
propQry.bindValue(":notes",ui.teNotes->toPlainText());
propQry.bindValue(":proprty_id",ui.leProprtyID->text().toInt());
if (propQry.exec()) {
ui.leStatus->setText("Property record: "+ui.leProprtyID->text()+" updated!");
} else {
ui.leStatus->setText("Cannot updated property record: "+ui.leProprtyID->text());
}
}
To copy to clipboard, switch view to plain text mode
BTW, this code works on Oracle and on PostgreSQL before 8.1.0. On PostgreSQL after 8.0 they've added 3 millisecond positions to the QDateTime return.
Bookmarks