mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
до убирания mtxAccess из ProviderDBLMS
This commit is contained in:
@@ -95,8 +95,9 @@ protected:
|
||||
int deleteTaskFIM(int id_task);
|
||||
QList<TaskAmmFim> selectTasksFIMofTrainee(int id_trainee);
|
||||
TaskAmmFim selectTaskFIMbyID(int id_task);
|
||||
int deleteReportFIM(int task_id);
|
||||
int insertReportFIM(TaskAmmFim task);
|
||||
//int deleteReportFIMforTask(int task_id);
|
||||
//int insertReportFIMforTask(TaskAmmFim task);
|
||||
int updateReportFIMforTask(TaskAmmFim task);
|
||||
|
||||
private:
|
||||
DataBaseSettings getDataBaseSettings();
|
||||
|
||||
@@ -182,6 +182,7 @@ TaskAmmFim DataBaseLMS::selectTaskAMMbyID(int id_task)
|
||||
return task;
|
||||
}
|
||||
|
||||
|
||||
int DataBaseLMS::insertTaskFIM(TaskAmmFim task, int id_trainee)
|
||||
{
|
||||
QString queryStr;
|
||||
@@ -228,9 +229,9 @@ int DataBaseLMS::insertTaskFIM(TaskAmmFim task, int id_trainee)
|
||||
{
|
||||
sign.description = sign.description.replace("'", "''"); //Задваиваем одинарные кавычки
|
||||
|
||||
queryStr = QString("INSERT INTO public.malf_sign (type, description, fk_malfunction_id) "
|
||||
queryStr = QString("INSERT INTO public.malf_signs (type, description, fk_malfunction_id) "
|
||||
"VALUES ('%1', '%2', %3) "
|
||||
"RETURNING malf_sign.sign_id").arg(
|
||||
"RETURNING malf_signs.sign_id").arg(
|
||||
QString::number(sign.type),
|
||||
sign.description,
|
||||
QString::number(malfunction_id));
|
||||
@@ -321,13 +322,13 @@ int DataBaseLMS::deleteTaskFIM(int id_task)
|
||||
"ORDER BY users.user_id ASC").arg(
|
||||
QString::number(id_task));
|
||||
|
||||
QSqlQuery query = QSqlQuery(*db);
|
||||
QSqlQuery queryUserSEL = QSqlQuery(*db);
|
||||
|
||||
if(queryExec(queryStr, &query))
|
||||
if(queryExec(queryStr, &queryUserSEL))
|
||||
{
|
||||
if (query.first())
|
||||
if (queryUserSEL.first())
|
||||
{//Обучаемый
|
||||
id_trainee = query.value(0).toInt();
|
||||
id_trainee = queryUserSEL.value(0).toInt();
|
||||
}
|
||||
}
|
||||
if(!id_trainee)
|
||||
@@ -342,24 +343,24 @@ int DataBaseLMS::deleteTaskFIM(int id_task)
|
||||
"WHERE malfunctions.fk_task_fim_id = %1 "
|
||||
"ORDER BY malfunctions.malfunction_id ASC").arg(
|
||||
id_task);
|
||||
QSqlQuery queryMalf = QSqlQuery(*db);
|
||||
QSqlQuery queryMalfSEL = QSqlQuery(*db);
|
||||
|
||||
if(queryExec(queryStr, &queryMalf))
|
||||
if(queryExec(queryStr, &queryMalfSEL))
|
||||
{
|
||||
while (queryMalf.next())
|
||||
while (queryMalfSEL.next())
|
||||
{//Неисправность
|
||||
int malfunction_id = 0;
|
||||
|
||||
malfunction_id = queryMalf.value(0).toString().toInt();
|
||||
malfunction_id = queryMalfSEL.value(0).toString().toInt();
|
||||
|
||||
if(malfunction_id)
|
||||
{
|
||||
queryStr = QString("DELETE FROM public.malf_sign "
|
||||
queryStr = QString("DELETE FROM public.malf_signs "
|
||||
"WHERE fk_malfunction_id = %1 ").arg(
|
||||
malfunction_id);
|
||||
|
||||
QSqlQuery querySign = QSqlQuery(*db);
|
||||
if(!queryExec(queryStr, &querySign))
|
||||
QSqlQuery querySignDEL = QSqlQuery(*db);
|
||||
if(!queryExec(queryStr, &querySignDEL))
|
||||
{
|
||||
resBool = db->rollback();
|
||||
return 0;
|
||||
@@ -378,13 +379,62 @@ int DataBaseLMS::deleteTaskFIM(int id_task)
|
||||
"WHERE fk_task_fim_id = %1 ").arg(
|
||||
QString::number(id_task));
|
||||
|
||||
QSqlQuery query1 = QSqlQuery(*db);
|
||||
if(!queryExec(queryStr, &query1))
|
||||
QSqlQuery queryMulfDEL = QSqlQuery(*db);
|
||||
if(!queryExec(queryStr, &queryMulfDEL))
|
||||
{
|
||||
resBool = db->rollback();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
queryStr = QString("SELECT reports.report_id "
|
||||
"FROM public.reports "
|
||||
"WHERE fk_task_fim_id = %1 "
|
||||
"ORDER BY reports.report_id ASC").arg(
|
||||
QString::number(id_task));
|
||||
|
||||
int report_id = 0;
|
||||
|
||||
QSqlQuery queryReportsSEL = QSqlQuery(*db);
|
||||
if(queryExec(queryStr, &queryReportsSEL))
|
||||
{
|
||||
if (queryReportsSEL.first())
|
||||
{//Отчет
|
||||
report_id = queryReportsSEL.value(0).toInt();
|
||||
}
|
||||
}
|
||||
if(!report_id)
|
||||
{
|
||||
resBool = db->rollback();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
queryStr = QString("DELETE FROM public.report_items "
|
||||
"WHERE fk_report_id = %1 ").arg(
|
||||
QString::number(report_id));
|
||||
|
||||
QSqlQuery queryItemsDEL = QSqlQuery(*db);
|
||||
if(!queryExec(queryStr, &queryItemsDEL))
|
||||
{
|
||||
resBool = db->rollback();
|
||||
return 0;
|
||||
}
|
||||
|
||||
queryStr = QString("DELETE FROM public.reports "
|
||||
"WHERE report_id = %1 ").arg(
|
||||
QString::number(report_id));
|
||||
|
||||
QSqlQuery queryReportsDEL = QSqlQuery(*db);
|
||||
if(!queryExec(queryStr, &queryReportsDEL))
|
||||
{
|
||||
resBool = db->rollback();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
queryStr = QString("DELETE FROM public.tasks_fim "
|
||||
"WHERE task_id = %1 "
|
||||
"RETURNING tasks_fim.task_id").arg(
|
||||
@@ -450,10 +500,10 @@ QList<TaskAmmFim> DataBaseLMS::selectTasksFIMofTrainee(int id_trainee)
|
||||
malfanction.description = queryMalf.value(3).toString();
|
||||
|
||||
//Выгребаем сигналы для этой неисправности
|
||||
queryStr = QString("SELECT malf_sign.sign_id, malf_sign.type, malf_sign.description "
|
||||
"FROM public.malf_sign "
|
||||
queryStr = QString("SELECT malf_signs.sign_id, malf_signs.type, malf_signs.description "
|
||||
"FROM public.malf_signs "
|
||||
"WHERE fk_malfunction_id = %1 "
|
||||
"ORDER BY malf_sign.sign_id ASC").arg(
|
||||
"ORDER BY malf_signs.sign_id ASC").arg(
|
||||
QString::number(malfunction_id));
|
||||
|
||||
QSqlQuery querySign = QSqlQuery(*db);
|
||||
@@ -601,10 +651,10 @@ TaskAmmFim DataBaseLMS::selectTaskFIMbyID(int id_task)
|
||||
malfanction.description = queryMalf.value(3).toString();
|
||||
|
||||
//Выгребаем сигналы для этой неисправности
|
||||
queryStr = QString("SELECT malf_sign.sign_id, malf_sign.type, malf_sign.description "
|
||||
"FROM public.malf_sign "
|
||||
queryStr = QString("SELECT malf_signs.sign_id, malf_signs.type, malf_signs.description "
|
||||
"FROM public.malf_signs "
|
||||
"WHERE fk_malfunction_id = %1 "
|
||||
"ORDER BY malf_sign.sign_id ASC").arg(
|
||||
"ORDER BY malf_signs.sign_id ASC").arg(
|
||||
QString::number(malfunction_id));
|
||||
|
||||
QSqlQuery querySign = QSqlQuery(*db);
|
||||
@@ -701,11 +751,12 @@ TaskAmmFim DataBaseLMS::selectTaskFIMbyID(int id_task)
|
||||
return task;
|
||||
}
|
||||
|
||||
int DataBaseLMS::deleteReportFIM(int task_id)
|
||||
int DataBaseLMS::updateReportFIMforTask(TaskAmmFim task)
|
||||
{
|
||||
QString queryStr;
|
||||
bool resBool = false;
|
||||
int report_id = 0;
|
||||
int task_id = task.getID();
|
||||
|
||||
resBool = db->transaction();
|
||||
|
||||
@@ -715,79 +766,47 @@ int DataBaseLMS::deleteReportFIM(int task_id)
|
||||
"ORDER BY reports.report_id ASC").arg(
|
||||
QString::number(task_id));
|
||||
|
||||
QSqlQuery query = QSqlQuery(*db);
|
||||
QSqlQuery queryReportsSEL = QSqlQuery(*db);
|
||||
|
||||
if(queryExec(queryStr, &query))
|
||||
if(queryExec(queryStr, &queryReportsSEL))
|
||||
{
|
||||
if (query.first())
|
||||
if (queryReportsSEL.first())
|
||||
{//Отчет
|
||||
report_id = query.value(0).toInt();
|
||||
report_id = queryReportsSEL.value(0).toInt();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
resBool = db->rollback();
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(!report_id)
|
||||
{
|
||||
resBool = db->rollback();
|
||||
return 0;
|
||||
queryStr = QString("INSERT INTO public.reports (fk_task_fim_id) "
|
||||
"VALUES (%1) "
|
||||
"RETURNING reports.report_id").arg(
|
||||
task.getID());
|
||||
|
||||
report_id = queryExecInt(queryStr);
|
||||
if(!report_id)
|
||||
{
|
||||
resBool = db->rollback();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
queryStr = QString("DELETE FROM public.report_items "
|
||||
"WHERE fk_report_id = %1 ").arg(
|
||||
QString::number(report_id));
|
||||
|
||||
QSqlQuery query1 = QSqlQuery(*db);
|
||||
if(!queryExec(queryStr, &query1))
|
||||
else
|
||||
{
|
||||
resBool = db->rollback();
|
||||
return 0;
|
||||
}
|
||||
queryStr = QString("DELETE FROM public.report_items "
|
||||
"WHERE fk_report_id = %1 ").arg(
|
||||
QString::number(report_id));
|
||||
|
||||
queryStr = QString("DELETE FROM public.reports "
|
||||
"WHERE report_id = %1 ").arg(
|
||||
QString::number(report_id));
|
||||
|
||||
if(!queryExec(queryStr, &query1))
|
||||
{
|
||||
resBool = db->rollback();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
queryStr = QString("UPDATE public.tasks_fim SET status = '%1' "
|
||||
"WHERE task_id = %2 ").arg(
|
||||
"new",
|
||||
QString::number(task_id) );
|
||||
|
||||
if(!queryExec(queryStr, &query1))
|
||||
{
|
||||
resBool = db->rollback();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
resBool = db->commit();
|
||||
return report_id;
|
||||
}
|
||||
|
||||
int DataBaseLMS::insertReportFIM(TaskAmmFim task)
|
||||
{
|
||||
QString queryStr;
|
||||
bool resBool = false;
|
||||
|
||||
resBool = db->transaction();
|
||||
|
||||
//task.title = task.title.replace("'", "''"); //Задваиваем одинарные кавычки
|
||||
|
||||
queryStr = QString("INSERT INTO public.reports (fk_task_fim_id) "
|
||||
"VALUES (%1) "
|
||||
"RETURNING reports.report_id").arg(
|
||||
task.getID());
|
||||
|
||||
int report_id = queryExecInt(queryStr);
|
||||
if(!report_id)
|
||||
{
|
||||
resBool = db->rollback();
|
||||
return 0;
|
||||
QSqlQuery queryItemsDEL = QSqlQuery(*db);
|
||||
if(!queryExec(queryStr, &queryItemsDEL))
|
||||
{
|
||||
resBool = db->rollback();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
int number = 0;
|
||||
@@ -811,19 +830,17 @@ int DataBaseLMS::insertReportFIM(TaskAmmFim task)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
queryStr = QString("UPDATE public.tasks_fim SET status = '%1' "
|
||||
"WHERE task_id = %2 ").arg(
|
||||
"checkup",
|
||||
QString::number(task.getID()) );
|
||||
QString::number(task_id) );
|
||||
|
||||
QSqlQuery query1 = QSqlQuery(*db);
|
||||
if(!queryExec(queryStr, &query1))
|
||||
QSqlQuery queryTaskUPD = QSqlQuery(*db);
|
||||
if(!queryExec(queryStr, &queryTaskUPD))
|
||||
{
|
||||
resBool = db->rollback();
|
||||
return 0;
|
||||
}
|
||||
*/
|
||||
|
||||
resBool = db->commit();
|
||||
return report_id;
|
||||
|
||||
@@ -19,7 +19,7 @@ void InterfaceDataBaseLMS::slot_LanguageChanged(QString language)
|
||||
QCoreApplication::installTranslator(&qtLanguageTranslator);
|
||||
}
|
||||
|
||||
bool InterfaceDataBaseLMS::ConnectionToDB()
|
||||
bool InterfaceDataBaseLMS::connectionToDB()
|
||||
{
|
||||
QMutexLocker mtxLocker(&mtxAccess);
|
||||
if(!createConnection())
|
||||
@@ -34,7 +34,7 @@ bool InterfaceDataBaseLMS::ConnectionToDB()
|
||||
}
|
||||
}
|
||||
|
||||
bool InterfaceDataBaseLMS::DisConnectionFromDB()
|
||||
bool InterfaceDataBaseLMS::disConnectionFromDB()
|
||||
{
|
||||
QMutexLocker mtxLocker(&mtxAccess);
|
||||
deleteConnection();
|
||||
@@ -51,7 +51,7 @@ bool InterfaceDataBaseLMS::DBisConnected()
|
||||
|
||||
//Инструкторы
|
||||
|
||||
bool InterfaceDataBaseLMS::AuthorizationInstructor(QString login, QString password)
|
||||
bool InterfaceDataBaseLMS::authorizationInstructor(QString login, QString password)
|
||||
{
|
||||
QMutexLocker mtxLocker(&mtxAccess);
|
||||
|
||||
@@ -81,7 +81,7 @@ bool InterfaceDataBaseLMS::deAuthorizationInstructor(QString login)
|
||||
bool InterfaceDataBaseLMS::deAuthorizationAllInstructors()
|
||||
{
|
||||
QMutexLocker mtxLocker(&mtxAccess);
|
||||
return updateAllUsersLoggedIn(DataBaseLMS::TypeUserDBInstructor,false);
|
||||
return updateAllUsersLoggedIn(DataBaseLMS::TypeUserDBInstructor, false);
|
||||
}
|
||||
|
||||
QString InterfaceDataBaseLMS::getNameInstructorByLogin(QString login)
|
||||
@@ -125,43 +125,33 @@ int InterfaceDataBaseLMS::editInstructor(Instructor instructor)
|
||||
QMutexLocker mtxLocker(&mtxAccess);
|
||||
|
||||
//Проверка корректности логина, имени, пароля
|
||||
QList<Instructor> listInstructors = selectAllInstructors();
|
||||
for(Instructor exist_instructor : listInstructors)
|
||||
{
|
||||
if(instructor.getName() == QStringLiteral("<instructor>"))
|
||||
{//Имя не корректно!
|
||||
QMessageBox::critical(ownerWidget, tr("Editing error!"),
|
||||
tr("Unacceptable instructor name has been entered.\nThe changes will not be accepted."));
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(instructor.getLogin() == QStringLiteral("<login>"))
|
||||
{//Логин не корректен!
|
||||
QMessageBox::critical(ownerWidget, tr("Editing error!"),
|
||||
tr("Unacceptable instructor login has been entered.\nThe changes will not be accepted."));
|
||||
return 0;
|
||||
}
|
||||
if(instructor.getName() == QStringLiteral("<name>"))
|
||||
{//Имя не корректно!
|
||||
QMessageBox::critical(ownerWidget, tr("Editing error!"),
|
||||
tr("Unacceptable instructor name has been entered.\nThe changes will not be accepted."));
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(instructor.getPassword() == QStringLiteral("<password>"))
|
||||
{//Пароль не корректный!
|
||||
QMessageBox::critical(ownerWidget, tr("Editing error!"),
|
||||
tr("Unacceptable instructor password has been entered.\nThe changes will not be accepted."));
|
||||
return 0;
|
||||
}
|
||||
if(instructor.getLogin() == QStringLiteral("<login>"))
|
||||
{//Логин не корректен!
|
||||
QMessageBox::critical(ownerWidget, tr("Editing error!"),
|
||||
tr("Unacceptable instructor login has been entered.\nThe changes will not be accepted."));
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(instructor.getName() == exist_instructor.getName() && instructor.getID() != exist_instructor.getID())
|
||||
{//Имя уже существует
|
||||
QMessageBox::critical(ownerWidget, tr("Editing error!"),
|
||||
tr("An existing instructor name has been entered."));
|
||||
return 0;
|
||||
}
|
||||
if(instructor.getPassword() == QStringLiteral("<password>"))
|
||||
{//Пароль не корректный!
|
||||
QMessageBox::critical(ownerWidget, tr("Editing error!"),
|
||||
tr("Unacceptable instructor password has been entered.\nThe changes will not be accepted."));
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(instructor.getLogin() == exist_instructor.getLogin() && instructor.getID() != exist_instructor.getID())
|
||||
{//Логин уже существует!
|
||||
QMessageBox::critical(ownerWidget, tr("Editing error!"),
|
||||
tr("An existing instructor login has been entered.\nThe changes will not be accepted."));
|
||||
return 0;
|
||||
}
|
||||
if(selectUserID(DataBaseLMS::TypeUserDBInstructor, instructor.getLogin()) || selectUserID(DataBaseLMS::TypeUserDBTrainee, instructor.getLogin()))
|
||||
{//Логин уже существует!
|
||||
QMessageBox::critical(ownerWidget, tr("Editing error!"),
|
||||
tr("An existing instructor or trainee login has been entered.\nThe changes will not be accepted."));
|
||||
return 0;
|
||||
}
|
||||
|
||||
return updateInstructor(instructor);
|
||||
@@ -188,7 +178,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);
|
||||
|
||||
@@ -408,7 +398,6 @@ int InterfaceDataBaseLMS::newTaskFIM(TaskAmmFim task, int id_trainee)
|
||||
int InterfaceDataBaseLMS::delTaskFIM(int id)
|
||||
{
|
||||
QMutexLocker mtxLocker(&mtxAccess);
|
||||
deleteReportFIM(id);
|
||||
return deleteTaskFIM(id);
|
||||
}
|
||||
|
||||
@@ -421,15 +410,7 @@ int InterfaceDataBaseLMS::editTaskFIM(TaskAmmFim task)
|
||||
int InterfaceDataBaseLMS::replaceReportFIM(TaskAmmFim task)
|
||||
{
|
||||
QMutexLocker mtxLocker(&mtxAccess);
|
||||
deleteReportFIM(task.getID());
|
||||
|
||||
if(int report_id = insertReportFIM(task))
|
||||
{
|
||||
updateStatusTaskFIM(task.getID(), "checkup");
|
||||
return report_id;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return updateReportFIMforTask(task);
|
||||
}
|
||||
|
||||
int InterfaceDataBaseLMS::changeStatusTaskFIM(int id_task, QString status)
|
||||
@@ -461,43 +442,33 @@ int InterfaceDataBaseLMS::editTrainee(Trainee trainee)
|
||||
QMutexLocker mtxLocker(&mtxAccess);
|
||||
|
||||
//Проверка корректности логина, имени, пароля
|
||||
QList<Trainee> listTrainees = selectAllTrainees();
|
||||
for(Trainee exist_trainee : listTrainees)
|
||||
{
|
||||
if(trainee.getName() == QStringLiteral("<trainee>"))
|
||||
{//Имя не корректно!
|
||||
QMessageBox::critical(ownerWidget, tr("Editing error!"),
|
||||
tr("Unacceptable trainee name has been entered.\nThe changes will not be accepted."));
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(trainee.getLogin() == QStringLiteral("<login>"))
|
||||
{//Логин не корректен!
|
||||
QMessageBox::critical(ownerWidget, tr("Editing error!"),
|
||||
tr("Unacceptable trainee login has been entered.\nThe changes will not be accepted."));
|
||||
return 0;
|
||||
}
|
||||
if(trainee.getName() == QStringLiteral("<trainee>"))
|
||||
{//Имя не корректно!
|
||||
QMessageBox::critical(ownerWidget, tr("Editing error!"),
|
||||
tr("Unacceptable trainee name has been entered.\nThe changes will not be accepted."));
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(trainee.getPassword() == QStringLiteral("<password>"))
|
||||
{//Пароль не корректный!
|
||||
QMessageBox::critical(ownerWidget, tr("Editing error!"),
|
||||
tr("Unacceptable trainee password has been entered.\nThe changes will not be accepted."));
|
||||
return 0;
|
||||
}
|
||||
if(trainee.getLogin() == QStringLiteral("<login>"))
|
||||
{//Логин не корректен!
|
||||
QMessageBox::critical(ownerWidget, tr("Editing error!"),
|
||||
tr("Unacceptable trainee login has been entered.\nThe changes will not be accepted."));
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(trainee.getName() == exist_trainee.getName() && trainee.getID() != exist_trainee.getID())
|
||||
{//Имя уже существует
|
||||
QMessageBox::critical(ownerWidget, tr("Editing error!"),
|
||||
tr("An existing trainee name has been entered."));
|
||||
return 0;
|
||||
}
|
||||
if(trainee.getPassword() == QStringLiteral("<password>"))
|
||||
{//Пароль не корректный!
|
||||
QMessageBox::critical(ownerWidget, tr("Editing error!"),
|
||||
tr("Unacceptable trainee password has been entered.\nThe changes will not be accepted."));
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(trainee.getLogin() == exist_trainee.getLogin() && trainee.getID() != exist_trainee.getID())
|
||||
{//Логин уже существует!
|
||||
QMessageBox::critical(ownerWidget, tr("Editing error!"),
|
||||
tr("An existing trainee login has been entered.\nThe changes will not be accepted."));
|
||||
return 0;
|
||||
}
|
||||
if(selectUserID(DataBaseLMS::TypeUserDBInstructor, trainee.getLogin()) || selectUserID(DataBaseLMS::TypeUserDBTrainee, trainee.getLogin()))
|
||||
{//Логин уже существует!
|
||||
QMessageBox::critical(ownerWidget, tr("Editing error!"),
|
||||
tr("An existing instructor or trainee login has been entered.\nThe changes will not be accepted."));
|
||||
return 0;
|
||||
}
|
||||
|
||||
return updateTrainee(trainee);
|
||||
|
||||
@@ -20,14 +20,14 @@ public Q_SLOTS:
|
||||
|
||||
public:
|
||||
//Соединение
|
||||
bool ConnectionToDB();
|
||||
bool DisConnectionFromDB();
|
||||
bool connectionToDB();
|
||||
bool disConnectionFromDB();
|
||||
bool DBisConnected();
|
||||
|
||||
|
||||
//Инструкторы
|
||||
|
||||
bool AuthorizationInstructor(QString login, QString password);
|
||||
bool authorizationInstructor(QString login, QString password);
|
||||
bool deAuthorizationInstructor(QString login);
|
||||
bool deAuthorizationAllInstructors();
|
||||
|
||||
@@ -48,7 +48,7 @@ public:
|
||||
|
||||
//Обучаемые
|
||||
|
||||
bool AuthorizationTrainee(QString login, QString password, QString classroom_name, QString computer_name);
|
||||
bool authorizationTrainee(QString login, QString password, QString classroom_name, QString computer_name);
|
||||
bool deAuthorizationTrainee(QString login);
|
||||
bool deAuthorizationAllTrainees();
|
||||
|
||||
@@ -82,13 +82,13 @@ public:
|
||||
int delGroup(int id);
|
||||
int editGroup(Group group);
|
||||
|
||||
|
||||
//Задачи
|
||||
|
||||
int newTaskAMM(TaskAmmFim task, int id_trainee);
|
||||
int delTaskAMM(int id);
|
||||
int editTaskAMM(TaskAmmFim task);
|
||||
|
||||
|
||||
//Задачи
|
||||
|
||||
QList<TaskAmmFim> getListTasksAMMofTrainee(int id_trainee);
|
||||
QList<TaskAmmFim> getListTasksFIMofTrainee(int id_trainee);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user