сделал delInstructor

This commit is contained in:
krivoshein
2024-12-11 14:24:50 +03:00
parent 0cb03e49b1
commit 1569df7d94
43 changed files with 302 additions and 320 deletions

View File

@@ -74,6 +74,7 @@ void DataParser::xmlParser(ClientHandler *client, QByteArray array)
{//Запрос к базе данных от клиента
ClientQueryToDB queryToDB;
int id = 0;
/*Перебираем все атрибуты тега*/
foreach(const QXmlStreamAttribute &attr, xmlReader.attributes())
@@ -84,9 +85,11 @@ void DataParser::xmlParser(ClientHandler *client, QByteArray array)
if(name == "TypeQuery")
queryToDB.typeQuery = (TypeQueryToDB)value.toInt();
else if(name == "id")
id = value.toInt();
}
processingSystem->processingClientQueryToDB(client, queryToDB);
processingSystem->processingClientQueryToDB(client, queryToDB, id);
}
else if(xmlReader.name() == "ClientMessage")
{//Сообщение от клиента

View File

@@ -113,7 +113,7 @@ void ProcessingSystem::processingClientDeAutorization(ClientHandler *client, Cli
emit sigAuthChanged();
}
void ProcessingSystem::processingClientQueryToDB(ClientHandler *client, ClientQueryToDB clientQueryToDB)
void ProcessingSystem::processingClientQueryToDB(ClientHandler *client, ClientQueryToDB clientQueryToDB, int id)
{
QByteArray arrayAnswer;
@@ -147,6 +147,12 @@ void ProcessingSystem::processingClientQueryToDB(ClientHandler *client, ClientQu
emit sigAuthChanged();
break;
}
case TypeQueryToDB::TYPE_QUERY_DEL_INSTRUCTOR:
{
providerDBLMS->delInstructor(id);
emit sigAuthChanged();
break;
}
}
//client->sendXmlAnswer(arrayAnswer, PacketType::TYPE_XMLANSWER_QUERY_DB_LIST_INSTRUCTORS);

View File

@@ -25,7 +25,7 @@ public:
void initialize(DataParser* dataParser,ServerLMSWidget *server);
void processingClientAutorization(ClientHandler *client, ClientAutorization clientAutorization);
void processingClientDeAutorization(ClientHandler *client, ClientDeAutorization clientDeAutorization);
void processingClientQueryToDB(ClientHandler *client, ClientQueryToDB clientQueryToDB);
void processingClientQueryToDB(ClientHandler *client, ClientQueryToDB clientQueryToDB, int id = 0);
void processingClientMessage(ClientHandler *client, ClientMessage clientMessage);
void processingClientNotify(ClientHandler *client, ClientNotify clientNotify);

View File

@@ -257,3 +257,8 @@ int ProviderDBLMS::newInstructor()
{
return dbLMS->newInstructor();
}
int ProviderDBLMS::delInstructor(int id)
{
return dbLMS->delInstructor(id);
}

View File

@@ -29,6 +29,7 @@ public:
QList<Group> GetListAllGroups();
int newInstructor();
int delInstructor(int id);
Q_SIGNALS:
//сигнал о блокировке авторизации

View File

@@ -59,7 +59,8 @@ public:
enum TypeQueryToDB{
TYPE_QUERY_GET_LIST_INSTRUCTORS,
TYPE_QUERY_GET_ALL_LISTS,
TYPE_QUERY_NEW_INSTRUCTOR
TYPE_QUERY_NEW_INSTRUCTOR,
TYPE_QUERY_DEL_INSTRUCTOR
};
class ClientQueryToDB{