Доделал остальные операции по редактированию

This commit is contained in:
krivoshein
2024-12-12 10:27:18 +03:00
parent 1569df7d94
commit d28453440f
56 changed files with 725 additions and 540 deletions

View File

@@ -46,7 +46,7 @@ bool ConnectorToServer::deAuthorizationInstructorLocal(QString login)
return true;
}
bool ConnectorToServer::sendQueryToDB(TypeQueryToDB typeQuery, int id)
bool ConnectorToServer::sendQueryToDB(TypeQueryToDB typeQuery, int id, void* data)
{
if (!client->getIsConnected())
{
@@ -56,7 +56,7 @@ bool ConnectorToServer::sendQueryToDB(TypeQueryToDB typeQuery, int id)
ClientQueryToDB *queryToDB = new ClientQueryToDB;
queryToDB->typeQuery = typeQuery;
dataParser->createQueryToDBMessage(queryToDB, id);
dataParser->createQueryToDBMessage(queryToDB, id, data);
emit sigSendQueryToDB();
return true;
@@ -128,6 +128,16 @@ bool ConnectorToServer::isLoggedInInstructor(int id)
return false;
}
Instructor ConnectorToServer::getInstructor(int id)
{
for(Instructor instructor : listInstructors)
{
if(instructor.getID() == id)
return instructor;
}
return Instructor();
}
QList<Trainee> ConnectorToServer::getListTraineesInGroup(int id)
{
QList<Trainee> list;
@@ -163,6 +173,26 @@ bool ConnectorToServer::isLoggedInTrainee(int id)
return false;
}
Trainee ConnectorToServer::getTrainee(int id)
{
for(Trainee trainee : listTrainees)
{
if(trainee.getID() == id)
return trainee;
}
return Trainee();
}
Group ConnectorToServer::getGroup(int id)
{
for(Group group : listGroups)
{
if(group.getID() == id)
return group;
}
return Group();
}
void ConnectorToServer::slot_AnswerQueryToDB(QList<Instructor>* listInstructors,
QList<Trainee>* listTrainees,
QList<Group>* listGroups)