void All::on_pushButton_2_clicked() { close(); Admin ad; ad.setModal(true); ad.exec(); }
void MainWindow::on_pushButton_clicked() { QSqlQuery q; q.exec("SELECT user.id, usertype.typeuser FROM user, usertype\ WHERE usertype.id = user.type_user AND user.id = '"\ + ui->user->currentData().toString() + "' AND user.pass = '******'"); q.next(); int userID = q.value("id").toInt(); QString typeUser = q.value(1).toString(); qDebug()<<userID<<" "<<typeUser; qDebug()<<q.lastError(); /*db.close(); db = QSqlDatabase::addDatabase("QMYSQL"); db.setHostName("127.0.0.1"); db.setPort(3306); db.setDatabaseName("gkhdb");*/ this->hide(); if(typeUser == "администратор") { /*db.setUserName("root"); db.setPassword("qwer"); db.open();*/ Admin* a = new Admin; a->showMaximized(); connect(this,SIGNAL(sendUser(int)),a,SLOT(recieveUserID(int))); emit sendUser(userID); a->exec(); a->deleteLater(); }
void Deluser::on_pushButton_back_deluser_clicked() { close(); Admin admback; admback.setModal(true); admback.exec(); }