void LoginWindow::on_pushButton_clicked() { QString username; QString password; //Testing accounts bool enter = false; bool enterVoter = false; bool enterDBAdmin = false; username = ui->username->text(); password = ui->password->text(); enter = db.checkAdminInfo(username,password); enterDBAdmin = db.checkDBAdministratorInfo(username,password); enterVoter = db.checkVoterInfo(username,password); AdminWindow aWin; VoteWindow vWin; DBAdministratorWindow dWin; if(enter){ this->close(); aWin.exec(); } else if(enterDBAdmin){ this->close(); dWin.exec(); } else if(enterVoter){ this->close(); vWin.exec(); } else{ QMessageBox::information(this,tr("Error message "),tr("Incorrect Username or Password")); } }
void RemoveCandidate::on_pushButton_clicked() { AdminWindow aWin; this->close(); aWin.exec(); }