verify в EditInstructor

This commit is contained in:
krivoshein
2024-12-13 16:41:00 +03:00
parent f58baa7ab9
commit c53e69d75a
30 changed files with 553 additions and 497 deletions

View File

@@ -112,6 +112,7 @@ void DataParser::xmlParser(ClientHandler *client, QByteArray array)
else if(name == "logged_in")
instructor.setLoggedIn(value.toInt());
break;
case TypeQueryToDB::TYPE_QUERY_NEW_TRAINEE:
case TypeQueryToDB::TYPE_QUERY_EDIT_TRAINEE:
if(name == "trainee_id")
trainee.setID(value.toInt());
@@ -136,6 +137,7 @@ void DataParser::xmlParser(ClientHandler *client, QByteArray array)
trainee.setComputer(computer);
}
break;
case TypeQueryToDB::TYPE_QUERY_NEW_GROUP:
case TypeQueryToDB::TYPE_QUERY_EDIT_GROUP:
if(name == "group_id")
group.setID(value.toInt());
@@ -152,9 +154,11 @@ void DataParser::xmlParser(ClientHandler *client, QByteArray array)
case TypeQueryToDB::TYPE_QUERY_EDIT_INSTRUCTOR:
data = &instructor;
break;
case TypeQueryToDB::TYPE_QUERY_NEW_TRAINEE:
case TypeQueryToDB::TYPE_QUERY_EDIT_TRAINEE:
data = &trainee;
break;
case TypeQueryToDB::TYPE_QUERY_NEW_GROUP:
case TypeQueryToDB::TYPE_QUERY_EDIT_GROUP:
data = &group;
break;

View File

@@ -143,11 +143,11 @@ void ProcessingSystem::processingClientQueryToDB(ClientHandler *client, ClientQu
}
case TypeQueryToDB::TYPE_QUERY_NEW_INSTRUCTOR:
{
int id;
id = providerDBLMS->newInstructor();
if(id)
int id_new;
id_new = providerDBLMS->newInstructor();
if(id_new)
{
(*(Instructor*)data).setID(id);
(*(Instructor*)data).setID(id_new);
providerDBLMS->editInstructor(*(Instructor*)data);
}
emit sigAuthChanged();
@@ -168,7 +168,13 @@ void ProcessingSystem::processingClientQueryToDB(ClientHandler *client, ClientQu
case TypeQueryToDB::TYPE_QUERY_NEW_TRAINEE:
{
providerDBLMS->newTrainee(id);
int id_new;
id_new = providerDBLMS->newTrainee(id);
if(id_new)
{
(*(Trainee*)data).setID(id_new);
providerDBLMS->editTrainee(*(Trainee*)data);
}
emit sigAuthChanged();
break;
}
@@ -187,7 +193,13 @@ void ProcessingSystem::processingClientQueryToDB(ClientHandler *client, ClientQu
case TypeQueryToDB::TYPE_QUERY_NEW_GROUP:
{
providerDBLMS->newGroup();
int id_new;
id_new = providerDBLMS->newGroup();
if(id_new)
{
(*(Group*)data).setID(id_new);
providerDBLMS->editGroup(*(Group*)data);
}
emit sigAuthChanged();
break;
}