Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool AppControler::setUser(QString _Login, QString _Password){
- QSqlDatabase* db=DataBaseSingle::GetDB();
- if(db){
- QSqlQuery q(*db);
- QString log=_Login;
- QString pas=_Password;
- q.prepare("SELECT * FROM users WHERE login=? and password=? ");
- q.bindValue(0,log);
- q.bindValue(1,pas);
- if(q.exec()){
- if(q.size()>0){
- q.next();
- if(activeUser){
- delete activeUser;
- }
- activeUser=new user(q.value(0).toInt(),q.value(1).toString(),q.value(2).toString(),q.value(3).toString(),q.value(4).toString(),q.value(5).toString(),q.value(6).toString(), q.value(7).toInt());
- if(GetModuleData()){
- if(UpdateUserModuleData()){
- return true;
- }
- }
- }
- }
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement