mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
Начал реализовывать обмен запросами к БД
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user