Guest User

Untitled

a guest
Oct 18th, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.89 KB | None | 0 0
  1. void MainWindow::Entra(){
  2.     QString us=login->text();
  3.     QString pwd=password->text();
  4.     Account* acclog=0;
  5.     acclog=gestore->Login(us, pwd);
  6.     QMessageBox msg2;
  7.     if(!acclog){
  8.         msg2.warning(this, "Attenzione!", "Dati incorretti");
  9.         msg2.show();
  10.     }
  11.     else{
  12.         //redirect pagina utente
  13.         cout << "yeee";
  14.  
  15.     }
  16. }
  17.  
  18.  
  19. Account* Legami::Login(QString us, QString pwd){//QUANDO CHIAMERÒ LOGIN AVRÒ CARICATO GIÀ TT IL DATABASE?
  20.     Account* acc=0;
  21.     bool trovato=false;
  22.     for(QVector<Account*>::iterator it=utenti->begin(); trovato==false && it!=utenti->end(); it++){
  23.         QString username=(*it)->GetUsername();
  24.         QString password=(*it)->GetPwd();
  25.         if(username==us && password==pwd){
  26.             acc=(*it);
  27.             (*it)->SetGestore(this);
  28.             trovato=true;
  29.         }
  30.     }
  31.     cout << "Login";
  32.     return acc;
  33. }
Add Comment
Please, Sign In to add comment