|
|
|
@@ -21,7 +21,7 @@ void InterfaceDataBaseLMS::slot_LanguageChanged(QString language)
|
|
|
|
|
|
|
|
|
|
|
|
bool InterfaceDataBaseLMS::connectionToDB()
|
|
|
|
bool InterfaceDataBaseLMS::connectionToDB()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
//QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
if(!createConnection())
|
|
|
|
if(!createConnection())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMessageBox::critical(ownerWidget, dbSettings.dbName, tr("Connection error: ") + db->lastError().text());
|
|
|
|
QMessageBox::critical(ownerWidget, dbSettings.dbName, tr("Connection error: ") + db->lastError().text());
|
|
|
|
@@ -36,7 +36,7 @@ bool InterfaceDataBaseLMS::connectionToDB()
|
|
|
|
|
|
|
|
|
|
|
|
bool InterfaceDataBaseLMS::disConnectionFromDB()
|
|
|
|
bool InterfaceDataBaseLMS::disConnectionFromDB()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
//QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
deleteConnection();
|
|
|
|
deleteConnection();
|
|
|
|
//QMessageBox::information(ownerWidget, dbName, tr("Disconnection is successful!"));
|
|
|
|
//QMessageBox::information(ownerWidget, dbName, tr("Disconnection is successful!"));
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
@@ -44,7 +44,7 @@ bool InterfaceDataBaseLMS::disConnectionFromDB()
|
|
|
|
|
|
|
|
|
|
|
|
bool InterfaceDataBaseLMS::DBisConnected()
|
|
|
|
bool InterfaceDataBaseLMS::DBisConnected()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
//QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
return isConnected();
|
|
|
|
return isConnected();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -53,7 +53,7 @@ bool InterfaceDataBaseLMS::DBisConnected()
|
|
|
|
|
|
|
|
|
|
|
|
bool InterfaceDataBaseLMS::authorizationInstructor(QString login, QString password)
|
|
|
|
bool InterfaceDataBaseLMS::authorizationInstructor(QString login, QString password)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
//QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
|
|
|
|
|
|
|
|
if(int id = selectUserID(DataBaseLMS::TypeUserDBInstructor, login, password))
|
|
|
|
if(int id = selectUserID(DataBaseLMS::TypeUserDBInstructor, login, password))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@@ -68,7 +68,7 @@ bool InterfaceDataBaseLMS::authorizationInstructor(QString login, QString passwo
|
|
|
|
|
|
|
|
|
|
|
|
bool InterfaceDataBaseLMS::deAuthorizationInstructor(QString login)
|
|
|
|
bool InterfaceDataBaseLMS::deAuthorizationInstructor(QString login)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
//QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
|
|
|
|
|
|
|
|
if(int id = selectUserID(DataBaseLMS::TypeUserDBInstructor, login))
|
|
|
|
if(int id = selectUserID(DataBaseLMS::TypeUserDBInstructor, login))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@@ -80,49 +80,49 @@ bool InterfaceDataBaseLMS::deAuthorizationInstructor(QString login)
|
|
|
|
|
|
|
|
|
|
|
|
bool InterfaceDataBaseLMS::deAuthorizationAllInstructors()
|
|
|
|
bool InterfaceDataBaseLMS::deAuthorizationAllInstructors()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
//QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
return updateAllUsersLoggedIn(DataBaseLMS::TypeUserDBInstructor, false);
|
|
|
|
return updateAllUsersLoggedIn(DataBaseLMS::TypeUserDBInstructor, false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QString InterfaceDataBaseLMS::getNameInstructorByLogin(QString login)
|
|
|
|
QString InterfaceDataBaseLMS::getNameInstructorByLogin(QString login)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
//QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
return selectUserNameByLogin(DataBaseLMS::TypeUserDBInstructor, login);
|
|
|
|
return selectUserNameByLogin(DataBaseLMS::TypeUserDBInstructor, login);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int InterfaceDataBaseLMS::getIdInstructorByLogin(QString login)
|
|
|
|
int InterfaceDataBaseLMS::getIdInstructorByLogin(QString login)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
//QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
return selectUserID(DataBaseLMS::TypeUserDBInstructor, login);
|
|
|
|
return selectUserID(DataBaseLMS::TypeUserDBInstructor, login);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QList<Instructor> InterfaceDataBaseLMS::getListInstructors()
|
|
|
|
QList<Instructor> InterfaceDataBaseLMS::getListInstructors()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
//QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
return selectAllInstructors();
|
|
|
|
return selectAllInstructors();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Instructor InterfaceDataBaseLMS::getInstructor(int id)
|
|
|
|
Instructor InterfaceDataBaseLMS::getInstructor(int id)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
//QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
return selectInstructor(id);
|
|
|
|
return selectInstructor(id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int InterfaceDataBaseLMS::newInstructor()
|
|
|
|
int InterfaceDataBaseLMS::newInstructor()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
//QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
return insertInstructor();
|
|
|
|
return insertInstructor();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int InterfaceDataBaseLMS::delInstructor(int id)
|
|
|
|
int InterfaceDataBaseLMS::delInstructor(int id)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
//QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
return deleteInstructor(id);
|
|
|
|
return deleteInstructor(id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int InterfaceDataBaseLMS::editInstructor(Instructor instructor)
|
|
|
|
int InterfaceDataBaseLMS::editInstructor(Instructor instructor)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
//QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
|
|
|
|
|
|
|
|
//Проверка корректности логина, имени, пароля
|
|
|
|
//Проверка корректности логина, имени, пароля
|
|
|
|
|
|
|
|
|
|
|
|
@@ -159,19 +159,19 @@ int InterfaceDataBaseLMS::editInstructor(Instructor instructor)
|
|
|
|
|
|
|
|
|
|
|
|
bool InterfaceDataBaseLMS::isAdminInstructor(int id)
|
|
|
|
bool InterfaceDataBaseLMS::isAdminInstructor(int id)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
//QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
return selectInstructorIsAdmin(id);
|
|
|
|
return selectInstructorIsAdmin(id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool InterfaceDataBaseLMS::isArchivedInstructor(int id)
|
|
|
|
bool InterfaceDataBaseLMS::isArchivedInstructor(int id)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
//QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
return selectUserArchived(DataBaseLMS::TypeUserDBInstructor, id);
|
|
|
|
return selectUserArchived(DataBaseLMS::TypeUserDBInstructor, id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool InterfaceDataBaseLMS::isLoggedInInstructor(int id)
|
|
|
|
bool InterfaceDataBaseLMS::isLoggedInInstructor(int id)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
//QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
return selectUserLoggedIn(DataBaseLMS::TypeUserDBInstructor, id);
|
|
|
|
return selectUserLoggedIn(DataBaseLMS::TypeUserDBInstructor, id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -180,7 +180,7 @@ bool InterfaceDataBaseLMS::isLoggedInInstructor(int id)
|
|
|
|
|
|
|
|
|
|
|
|
bool InterfaceDataBaseLMS::authorizationTrainee(QString login, QString password, QString classroom_name, QString computer_name)
|
|
|
|
bool InterfaceDataBaseLMS::authorizationTrainee(QString login, QString password, QString classroom_name, QString computer_name)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
//QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
|
|
|
|
|
|
|
|
if(int id = selectUserID(DataBaseLMS::TypeUserDBTrainee, login, password))
|
|
|
|
if(int id = selectUserID(DataBaseLMS::TypeUserDBTrainee, login, password))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@@ -195,7 +195,7 @@ bool InterfaceDataBaseLMS::authorizationTrainee(QString login, QString password,
|
|
|
|
|
|
|
|
|
|
|
|
bool InterfaceDataBaseLMS::deAuthorizationTrainee(QString login)
|
|
|
|
bool InterfaceDataBaseLMS::deAuthorizationTrainee(QString login)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
//QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
|
|
|
|
|
|
|
|
if(int id = selectUserID(DataBaseLMS::TypeUserDBTrainee, login))
|
|
|
|
if(int id = selectUserID(DataBaseLMS::TypeUserDBTrainee, login))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@@ -207,13 +207,13 @@ bool InterfaceDataBaseLMS::deAuthorizationTrainee(QString login)
|
|
|
|
|
|
|
|
|
|
|
|
bool InterfaceDataBaseLMS::deAuthorizationAllTrainees()
|
|
|
|
bool InterfaceDataBaseLMS::deAuthorizationAllTrainees()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
//QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
return updateAllUsersLoggedIn(DataBaseLMS::TypeUserDBTrainee, false);
|
|
|
|
return updateAllUsersLoggedIn(DataBaseLMS::TypeUserDBTrainee, false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int InterfaceDataBaseLMS::entryTraineeOnSimulator(int id_trainee)
|
|
|
|
int InterfaceDataBaseLMS::entryTraineeOnSimulator(int id_trainee)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
//QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
|
|
|
|
|
|
|
|
TimingOfTrainee timing(id_trainee);
|
|
|
|
TimingOfTrainee timing(id_trainee);
|
|
|
|
|
|
|
|
|
|
|
|
@@ -235,7 +235,7 @@ int InterfaceDataBaseLMS::entryTraineeOnSimulator(int id_trainee)
|
|
|
|
|
|
|
|
|
|
|
|
int InterfaceDataBaseLMS::exitTraineeFromSimulator(int id_trainee)
|
|
|
|
int InterfaceDataBaseLMS::exitTraineeFromSimulator(int id_trainee)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
//QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
|
|
|
|
|
|
|
|
TimingOfTrainee timing(id_trainee);
|
|
|
|
TimingOfTrainee timing(id_trainee);
|
|
|
|
|
|
|
|
|
|
|
|
@@ -257,73 +257,73 @@ int InterfaceDataBaseLMS::exitTraineeFromSimulator(int id_trainee)
|
|
|
|
|
|
|
|
|
|
|
|
QString InterfaceDataBaseLMS::getNameTraineeOnComputer(QString computer_name)
|
|
|
|
QString InterfaceDataBaseLMS::getNameTraineeOnComputer(QString computer_name)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
//QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
return selectTraineeNameOnComputer(computer_name);
|
|
|
|
return selectTraineeNameOnComputer(computer_name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Trainee InterfaceDataBaseLMS::getTraineeOnComputer(QString computer_name)
|
|
|
|
Trainee InterfaceDataBaseLMS::getTraineeOnComputer(QString computer_name)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
//QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
return selectTraineeOnComputer(computer_name);
|
|
|
|
return selectTraineeOnComputer(computer_name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QString InterfaceDataBaseLMS::getNameTraineeByLogin(QString login)
|
|
|
|
QString InterfaceDataBaseLMS::getNameTraineeByLogin(QString login)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
//QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
return selectUserNameByLogin(DataBaseLMS::TypeUserDBTrainee, login);
|
|
|
|
return selectUserNameByLogin(DataBaseLMS::TypeUserDBTrainee, login);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int InterfaceDataBaseLMS::getIdTraineeByLogin(QString login)
|
|
|
|
int InterfaceDataBaseLMS::getIdTraineeByLogin(QString login)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
//QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
return selectUserID(DataBaseLMS::TypeUserDBTrainee, login);
|
|
|
|
return selectUserID(DataBaseLMS::TypeUserDBTrainee, login);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QList<Trainee> InterfaceDataBaseLMS::getListTraineesInGroup(int id)
|
|
|
|
QList<Trainee> InterfaceDataBaseLMS::getListTraineesInGroup(int id)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
//QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
return selectAllTraineesInGroup(id);
|
|
|
|
return selectAllTraineesInGroup(id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QList<Group> InterfaceDataBaseLMS::getListGroups()
|
|
|
|
QList<Group> InterfaceDataBaseLMS::getListGroups()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
//QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
return selectAllGroups();
|
|
|
|
return selectAllGroups();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QList<Trainee> InterfaceDataBaseLMS::getListTrainees()
|
|
|
|
QList<Trainee> InterfaceDataBaseLMS::getListTrainees()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
//QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
return selectAllTrainees();
|
|
|
|
return selectAllTrainees();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Trainee InterfaceDataBaseLMS::getTrainee(int id)
|
|
|
|
Trainee InterfaceDataBaseLMS::getTrainee(int id)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
//QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
return selectTrainee(id);
|
|
|
|
return selectTrainee(id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Group InterfaceDataBaseLMS::getGroup(int id)
|
|
|
|
Group InterfaceDataBaseLMS::getGroup(int id)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
//QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
return selectGroup(id);
|
|
|
|
return selectGroup(id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int InterfaceDataBaseLMS::newGroup()
|
|
|
|
int InterfaceDataBaseLMS::newGroup()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
//QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
return insertGroup();
|
|
|
|
return insertGroup();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int InterfaceDataBaseLMS::delGroup(int id)
|
|
|
|
int InterfaceDataBaseLMS::delGroup(int id)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
//QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
return deleteGroup(id);
|
|
|
|
return deleteGroup(id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int InterfaceDataBaseLMS::editGroup(Group group)
|
|
|
|
int InterfaceDataBaseLMS::editGroup(Group group)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
//QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
|
|
|
|
|
|
|
|
//Проверка корректности имени
|
|
|
|
//Проверка корректности имени
|
|
|
|
QList<Group> listGroups = selectAllGroups();
|
|
|
|
QList<Group> listGroups = selectAllGroups();
|
|
|
|
@@ -349,97 +349,97 @@ int InterfaceDataBaseLMS::editGroup(Group group)
|
|
|
|
|
|
|
|
|
|
|
|
int InterfaceDataBaseLMS::newTaskAMM(TaskAmmFim task, int id_trainee)
|
|
|
|
int InterfaceDataBaseLMS::newTaskAMM(TaskAmmFim task, int id_trainee)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
//QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
return insertTaskAMM(task, id_trainee);
|
|
|
|
return insertTaskAMM(task, id_trainee);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int InterfaceDataBaseLMS::delTaskAMM(int id)
|
|
|
|
int InterfaceDataBaseLMS::delTaskAMM(int id)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
//QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
return deleteTaskAMM(id);
|
|
|
|
return deleteTaskAMM(id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int InterfaceDataBaseLMS::editTaskAMM(TaskAmmFim task)
|
|
|
|
int InterfaceDataBaseLMS::editTaskAMM(TaskAmmFim task)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
//QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
return updateTaskAMM(task);
|
|
|
|
return updateTaskAMM(task);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QList<TaskAmmFim> InterfaceDataBaseLMS::getListTasksAMMofTrainee(int id_trainee)
|
|
|
|
QList<TaskAmmFim> InterfaceDataBaseLMS::getListTasksAMMofTrainee(int id_trainee)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
//QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
return selectTasksAMMofTrainee(id_trainee);
|
|
|
|
return selectTasksAMMofTrainee(id_trainee);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QList<TaskAmmFim> InterfaceDataBaseLMS::getListTasksFIMofTrainee(int id_trainee)
|
|
|
|
QList<TaskAmmFim> InterfaceDataBaseLMS::getListTasksFIMofTrainee(int id_trainee)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
//QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
return selectTasksFIMofTrainee(id_trainee);
|
|
|
|
return selectTasksFIMofTrainee(id_trainee);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TaskAmmFim InterfaceDataBaseLMS::getTaskAMMbyID(int id_task)
|
|
|
|
TaskAmmFim InterfaceDataBaseLMS::getTaskAMMbyID(int id_task)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
//QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
return selectTaskAMMbyID(id_task);
|
|
|
|
return selectTaskAMMbyID(id_task);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TaskAmmFim InterfaceDataBaseLMS::getTaskFIMbyID(int id_task)
|
|
|
|
TaskAmmFim InterfaceDataBaseLMS::getTaskFIMbyID(int id_task)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
//QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
return selectTaskFIMbyID(id_task);
|
|
|
|
return selectTaskFIMbyID(id_task);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int InterfaceDataBaseLMS::newTaskFIM(TaskAmmFim task, int id_trainee)
|
|
|
|
int InterfaceDataBaseLMS::newTaskFIM(TaskAmmFim task, int id_trainee)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
//QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
return insertTaskFIM(task, id_trainee);
|
|
|
|
return insertTaskFIM(task, id_trainee);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int InterfaceDataBaseLMS::delTaskFIM(int id)
|
|
|
|
int InterfaceDataBaseLMS::delTaskFIM(int id)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
//QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
return deleteTaskFIM(id);
|
|
|
|
return deleteTaskFIM(id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int InterfaceDataBaseLMS::editTaskFIM(TaskAmmFim task)
|
|
|
|
int InterfaceDataBaseLMS::editTaskFIM(TaskAmmFim task)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
//QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
return updateTaskFIM(task);
|
|
|
|
return updateTaskFIM(task);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int InterfaceDataBaseLMS::replaceReportFIM(TaskAmmFim task)
|
|
|
|
int InterfaceDataBaseLMS::replaceReportFIM(TaskAmmFim task)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
//QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
return updateReportFIMforTask(task);
|
|
|
|
return updateReportFIMforTask(task);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int InterfaceDataBaseLMS::changeStatusTaskFIM(int id_task, QString status)
|
|
|
|
int InterfaceDataBaseLMS::changeStatusTaskFIM(int id_task, QString status)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
//QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
return updateStatusTaskFIM(id_task, status);
|
|
|
|
return updateStatusTaskFIM(id_task, status);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int InterfaceDataBaseLMS::changeStatusTaskAMM(int id_task, QString status)
|
|
|
|
int InterfaceDataBaseLMS::changeStatusTaskAMM(int id_task, QString status)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
//QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
return updateStatusTaskAMM(id_task, status);
|
|
|
|
return updateStatusTaskAMM(id_task, status);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int InterfaceDataBaseLMS::newTrainee(int id_group)
|
|
|
|
int InterfaceDataBaseLMS::newTrainee(int id_group)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
//QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
return insertTrainee(id_group);
|
|
|
|
return insertTrainee(id_group);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int InterfaceDataBaseLMS::delTrainee(int id)
|
|
|
|
int InterfaceDataBaseLMS::delTrainee(int id)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
//QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
return deleteTrainee(id);
|
|
|
|
return deleteTrainee(id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int InterfaceDataBaseLMS::editTrainee(Trainee trainee)
|
|
|
|
int InterfaceDataBaseLMS::editTrainee(Trainee trainee)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
//QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
|
|
|
|
|
|
|
|
//Проверка корректности логина, имени, пароля
|
|
|
|
//Проверка корректности логина, имени, пароля
|
|
|
|
|
|
|
|
|
|
|
|
@@ -476,12 +476,12 @@ int InterfaceDataBaseLMS::editTrainee(Trainee trainee)
|
|
|
|
|
|
|
|
|
|
|
|
bool InterfaceDataBaseLMS::isArchivedTrainee(int id)
|
|
|
|
bool InterfaceDataBaseLMS::isArchivedTrainee(int id)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
//QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
return selectUserArchived(DataBaseLMS::TypeUserDBTrainee, id);
|
|
|
|
return selectUserArchived(DataBaseLMS::TypeUserDBTrainee, id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool InterfaceDataBaseLMS::isLoggedInTrainee(int id)
|
|
|
|
bool InterfaceDataBaseLMS::isLoggedInTrainee(int id)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
//QMutexLocker mtxLocker(&mtxAccess);
|
|
|
|
return selectUserLoggedIn(DataBaseLMS::TypeUserDBTrainee, id);
|
|
|
|
return selectUserLoggedIn(DataBaseLMS::TypeUserDBTrainee, id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|