void haal::authenticate()
{
remoteDB();
int ttwo = query.record().indexOf("two");
int tthree = query.record().indexOf("three");
int ffour = query.record().indexOf("four");
int ffive = query.record().indexOf("five");
int ssix = query.record().indexOf("six");
int sseven = query.record().indexOf("seven");
int eeight = query.record().indexOf("eight");
while (query.next()) {
QString aa
= query.
value(ttwo
).
toString();
QString bb
= query.
value(tthree
).
toString();
QString cc
= query.
value(ffour
).
toString();
QString dd
= query.
value(ffive
).
toString();
QString ee
= query.
value(ssix
).
toString();
QString ff
= query.
value(sseven
).
toString();
QString gg
= query.
value(eeight
).
toString();
if(aa != ui.validator->text())
{
msgBox.setText("That Key Is Not Valid.");
msgBox.exec();
if (msgBox.clickedButton() == connectButton)
{
//close();//exit the application
//qApp->exit(0);...stop further processing;exit the application
//how should it be done..
}
}
if(aa == ui.validator->text())
{
if (msgBox.clickedButton() == connectButton)
{
msgBox.setText("That Key Is Valid.");
}
query.prepare("INSERT INTO princess (one,two,three,four,five,six,seven) "
"VALUES (:one, :two, :three,:four,:five,:six,:seven)");
query.bindValue(":one", 78);
query.bindValue(":two", 7843251);
query.bindValue(":three",79);
query.bindValue(":four",80);
query.bindValue(":five",81);
query.bindValue(":six", 82);
query.bindValue(":seven",kaad);
query.exec();
}
}
}
void haal::authenticate()
{
remoteDB();
QSqlQuery query("SELECT * FROM princess");
int ttwo = query.record().indexOf("two");
int tthree = query.record().indexOf("three");
int ffour = query.record().indexOf("four");
int ffive = query.record().indexOf("five");
int ssix = query.record().indexOf("six");
int sseven = query.record().indexOf("seven");
int eeight = query.record().indexOf("eight");
while (query.next()) {
QString aa = query.value(ttwo).toString();
QString bb = query.value(tthree).toString();
QString cc = query.value(ffour).toString();
QString dd = query.value(ffive).toString();
QString ee = query.value(ssix).toString();
QString ff = query.value(sseven).toString();
QString gg = query.value(eeight).toString();
if(aa != ui.validator->text())
{
QMessageBox msgBox;
msgBox.setText("That Key Is Not Valid.");
QPushButton *connectButton = msgBox.addButton(tr("Ok"), QMessageBox::AcceptRole);
msgBox.exec();
if (msgBox.clickedButton() == connectButton)
{
//close();//exit the application
//qApp->exit(0);...stop further processing;exit the application
//how should it be done..
}
}
if(aa == ui.validator->text())
{
if (msgBox.clickedButton() == connectButton)
{
QMessageBox msgBox;
msgBox.setText("That Key Is Valid.");
}
QString kaad = getID();
QSqlQuery query;
query.prepare("INSERT INTO princess (one,two,three,four,five,six,seven) "
"VALUES (:one, :two, :three,:four,:five,:six,:seven)");
query.bindValue(":one", 78);
query.bindValue(":two", 7843251);
query.bindValue(":three",79);
query.bindValue(":four",80);
query.bindValue(":five",81);
query.bindValue(":six", 82);
query.bindValue(":seven",kaad);
query.exec();
}
}
}
To copy to clipboard, switch view to plain text mode
if (msgBox.clickedButton() == connectButton)
{
//close();//exit the application
//qApp->exit(0);...stop further processing;exit the application
//nothing to be executed below this line
}
if (msgBox.clickedButton() == connectButton)
{
//close();//exit the application
//qApp->exit(0);...stop further processing;exit the application
//nothing to be executed below this line
}
To copy to clipboard, switch view to plain text mode
Bookmarks