Начал реализовывать обмен запросами к БД

This commit is contained in:
krivoshein
2024-12-06 11:15:02 +03:00
parent 53b37240eb
commit 2f48cf3921
107 changed files with 938 additions and 1189 deletions

View File

@@ -22,6 +22,7 @@ bool ConnectorToServer::authorizationInstructorLocal(QString login, QString pass
ClientAutorization *autorization = new ClientAutorization;
autorization->Login = login;
autorization->Password = password;
autorization->TypeClient = TypeClientAutorization::TYPE_GUI;
dataParser->createAuthMessage(autorization);
emit sigSendAutorization();
@@ -45,6 +46,31 @@ bool ConnectorToServer::deAuthorizationInstructorLocal(QString login)
return true;
}
bool ConnectorToServer::queryGetListInstructors()
{
if (!client->getIsConnected())
{
return false;
}
ClientQueryToDB *queryToDB = new ClientQueryToDB;
queryToDB->typeQuery = TypeQueryToDB::TYPE_QUERY_GET_LIST_INSTRUCTORS;
dataParser->createQueryToDBMessage(queryToDB);
emit sigSendQueryToDB();
}
QList<Instructor> ConnectorToServer::getListInstructors()
{
return listInstructors;
}
void ConnectorToServer::slot_AnswerQueryToDB(QList<Instructor>* listInstructors)
{
this->listInstructors = *listInstructors;
emit signal_UpdateDB(true, false);
}
void ConnectorToServer::initialize()
{
createObjects();
@@ -63,8 +89,11 @@ void ConnectorToServer::bindConnection()
connect(this,&ConnectorToServer::sigSendAutorization,sendSystem,&SendSystem::sendClientAutorization);
connect(this,&ConnectorToServer::sigSendDeAutorization,sendSystem,&SendSystem::sendClientAutorization);
connect(recognizeSystem,&RecognizeSystem::sigSaveLoginData,this,&ConnectorToServer::sigLoginResult);
connect(this,&ConnectorToServer::sigSendQueryToDB,sendSystem,&SendSystem::sendClientQueryToDB);
connect(recognizeSystem,&RecognizeSystem::sigAuth,this,&ConnectorToServer::sigLoginResult);
connect(recognizeSystem,&RecognizeSystem::sigDeAuth,this,&ConnectorToServer::sigDeLoginResult);
connect(recognizeSystem,&RecognizeSystem::sigAnswerQueryToDB,this,&ConnectorToServer::slot_AnswerQueryToDB);
}
void ConnectorToServer::createObjects()