mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
Refact 1
This commit is contained in:
@@ -8,36 +8,44 @@ QByteArray ConnectorToServer::getListTaskFimArray()
|
||||
|
||||
QByteArray ConnectorToServer::getListTaskAmmArray()
|
||||
{
|
||||
QMutexLocker locker(&mtxAccess);
|
||||
return listTaskAmmArray;
|
||||
}
|
||||
|
||||
QList<Instructor> ConnectorToServer::getListInstructors()
|
||||
{
|
||||
QMutexLocker locker(&mtxAccess);
|
||||
return listInstructors;
|
||||
}
|
||||
|
||||
QList<Trainee> ConnectorToServer::getListTrainees()
|
||||
{
|
||||
QMutexLocker locker(&mtxAccess);
|
||||
return listTrainees;
|
||||
}
|
||||
|
||||
QList<Group> ConnectorToServer::getListGroups()
|
||||
{
|
||||
QMutexLocker locker(&mtxAccess);
|
||||
return listGroups;
|
||||
}
|
||||
|
||||
QList<Computer> ConnectorToServer::getListComputers()
|
||||
{
|
||||
QMutexLocker locker(&mtxAccess);
|
||||
return listComputers;
|
||||
}
|
||||
|
||||
QList<Classroom> ConnectorToServer::getListClassrooms()
|
||||
{
|
||||
QMutexLocker locker(&mtxAccess);
|
||||
return listClassrooms;
|
||||
}
|
||||
|
||||
QList<TaskAmmFim> ConnectorToServer::getListTasksAMMforTrainee(int trainee_id)
|
||||
{
|
||||
QMutexLocker locker(&mtxAccess);
|
||||
|
||||
if(mapTasksAMM.contains(trainee_id))
|
||||
return mapTasksAMM.value(trainee_id);
|
||||
else
|
||||
@@ -46,6 +54,8 @@ QList<TaskAmmFim> ConnectorToServer::getListTasksAMMforTrainee(int trainee_id)
|
||||
|
||||
QList<TaskAmmFim> ConnectorToServer::getListTasksFIMforTrainee(int trainee_id)
|
||||
{
|
||||
QMutexLocker locker(&mtxAccess);
|
||||
|
||||
if(mapTasksFIM.contains(trainee_id))
|
||||
return mapTasksFIM.value(trainee_id);
|
||||
else
|
||||
@@ -54,6 +64,8 @@ QList<TaskAmmFim> ConnectorToServer::getListTasksFIMforTrainee(int trainee_id)
|
||||
|
||||
int ConnectorToServer::getCountTasksAMMforTrainee(int trainee_id)
|
||||
{
|
||||
QMutexLocker locker(&mtxAccess);
|
||||
|
||||
if(mapTasksAMM.contains(trainee_id))
|
||||
return mapTasksAMM.value(trainee_id).count();
|
||||
else
|
||||
@@ -62,6 +74,8 @@ int ConnectorToServer::getCountTasksAMMforTrainee(int trainee_id)
|
||||
|
||||
int ConnectorToServer::getCountTasksFIMforTrainee(int trainee_id)
|
||||
{
|
||||
QMutexLocker locker(&mtxAccess);
|
||||
|
||||
if(mapTasksFIM.contains(trainee_id))
|
||||
return mapTasksFIM.value(trainee_id).count();
|
||||
else
|
||||
@@ -70,6 +84,8 @@ int ConnectorToServer::getCountTasksFIMforTrainee(int trainee_id)
|
||||
|
||||
bool ConnectorToServer::isArchivedInstructor(int id)
|
||||
{
|
||||
QMutexLocker locker(&mtxAccess);
|
||||
|
||||
for(Instructor instructor : listInstructors)
|
||||
{
|
||||
if(instructor.getID() == id)
|
||||
@@ -83,6 +99,8 @@ bool ConnectorToServer::isArchivedInstructor(int id)
|
||||
|
||||
bool ConnectorToServer::isAdminInstructor(int id)
|
||||
{
|
||||
QMutexLocker locker(&mtxAccess);
|
||||
|
||||
for(Instructor instructor : listInstructors)
|
||||
{
|
||||
if(instructor.getID() == id)
|
||||
@@ -96,6 +114,8 @@ bool ConnectorToServer::isAdminInstructor(int id)
|
||||
|
||||
bool ConnectorToServer::isLoggedInInstructor(int id)
|
||||
{
|
||||
QMutexLocker locker(&mtxAccess);
|
||||
|
||||
for(Instructor instructor : listInstructors)
|
||||
{
|
||||
if(instructor.getID() == id)
|
||||
@@ -109,6 +129,8 @@ bool ConnectorToServer::isLoggedInInstructor(int id)
|
||||
|
||||
Instructor ConnectorToServer::getInstructor(int id)
|
||||
{
|
||||
QMutexLocker locker(&mtxAccess);
|
||||
|
||||
for(Instructor instructor : listInstructors)
|
||||
{
|
||||
if(instructor.getID() == id)
|
||||
@@ -119,6 +141,8 @@ Instructor ConnectorToServer::getInstructor(int id)
|
||||
|
||||
QList<Trainee> ConnectorToServer::getListTraineesInGroup(int id)
|
||||
{
|
||||
QMutexLocker locker(&mtxAccess);
|
||||
|
||||
QList<Trainee> list;
|
||||
for(Trainee trainee : listTrainees)
|
||||
{
|
||||
@@ -130,6 +154,8 @@ QList<Trainee> ConnectorToServer::getListTraineesInGroup(int id)
|
||||
|
||||
bool ConnectorToServer::isArchivedTrainee(int id)
|
||||
{
|
||||
QMutexLocker locker(&mtxAccess);
|
||||
|
||||
for(Trainee trainee : listTrainees)
|
||||
{
|
||||
if(trainee.getID() == id)
|
||||
@@ -143,6 +169,8 @@ bool ConnectorToServer::isArchivedTrainee(int id)
|
||||
|
||||
bool ConnectorToServer::isLoggedInTrainee(int id)
|
||||
{
|
||||
QMutexLocker locker(&mtxAccess);
|
||||
|
||||
for(Trainee trainee : listTrainees)
|
||||
{
|
||||
if(trainee.getID() == id)
|
||||
@@ -156,6 +184,8 @@ bool ConnectorToServer::isLoggedInTrainee(int id)
|
||||
|
||||
Trainee ConnectorToServer::getTrainee(int id)
|
||||
{
|
||||
QMutexLocker locker(&mtxAccess);
|
||||
|
||||
for(Trainee trainee : listTrainees)
|
||||
{
|
||||
if(trainee.getID() == id)
|
||||
@@ -166,6 +196,8 @@ Trainee ConnectorToServer::getTrainee(int id)
|
||||
|
||||
Group ConnectorToServer::getGroup(int id)
|
||||
{
|
||||
QMutexLocker locker(&mtxAccess);
|
||||
|
||||
for(Group group : listGroups)
|
||||
{
|
||||
if(group.getID() == id)
|
||||
@@ -176,6 +208,8 @@ Group ConnectorToServer::getGroup(int id)
|
||||
|
||||
int ConnectorToServer::getIdTraineeByLogin(QString login)
|
||||
{
|
||||
QMutexLocker locker(&mtxAccess);
|
||||
|
||||
for(Trainee trainee : listTrainees)
|
||||
{
|
||||
if(trainee.getLogin() == login)
|
||||
@@ -186,6 +220,8 @@ int ConnectorToServer::getIdTraineeByLogin(QString login)
|
||||
|
||||
int ConnectorToServer::getIdInstructorByLogin(QString login)
|
||||
{
|
||||
QMutexLocker locker(&mtxAccess);
|
||||
|
||||
for(Instructor instructor : listInstructors)
|
||||
{
|
||||
if(instructor.getLogin() == login)
|
||||
@@ -196,6 +232,8 @@ int ConnectorToServer::getIdInstructorByLogin(QString login)
|
||||
|
||||
void ConnectorToServer::clearListModelDB()
|
||||
{
|
||||
QMutexLocker locker(&mtxAccess);
|
||||
|
||||
listInstructors.clear();
|
||||
listGroups.clear();
|
||||
listTrainees.clear();
|
||||
|
||||
Reference in New Issue
Block a user