mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
Убрал старые Task
This commit is contained in:
@@ -181,8 +181,6 @@ QList<Trainee> DataBaseLMS::selectAllTrainees()
|
||||
Computer computer = Computer(query.value(8).toInt(), query.value(9).toString(), query.value(10).toString(), classroom);
|
||||
trainee.setComputer(computer);
|
||||
|
||||
trainee.setTasks(selectTasksOfTrainee(trainee.getID()));
|
||||
|
||||
listTrainees.append(trainee);
|
||||
}
|
||||
}
|
||||
@@ -690,8 +688,6 @@ Trainee DataBaseLMS::selectTrainee(int id_trainee)
|
||||
Classroom classroom = Classroom(query.value(11).toInt(), query.value(12).toString());
|
||||
Computer computer = Computer(query.value(8).toInt(), query.value(9).toString(), query.value(10).toString(), classroom);
|
||||
trainee.setComputer(computer);
|
||||
|
||||
trainee.setTasks(selectTasksOfTrainee(trainee.getID()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -735,8 +731,6 @@ QList<Trainee> DataBaseLMS::selectAllTraineesInGroup(int id_group)
|
||||
Computer computer = Computer(query.value(8).toInt(), query.value(9).toString(), query.value(10).toString(), classroom);
|
||||
trainee.setComputer(computer);
|
||||
|
||||
trainee.setTasks(selectTasksOfTrainee(trainee.getID()));
|
||||
|
||||
listTrainees.append(trainee);
|
||||
}
|
||||
}
|
||||
@@ -820,8 +814,6 @@ Trainee DataBaseLMS::selectTraineeOnComputer(QString computer_name)
|
||||
Classroom classroom = Classroom(query.value(11).toInt(), query.value(12).toString());
|
||||
Computer computer = Computer(query.value(8).toInt(), query.value(9).toString(), query.value(10).toString(), classroom);
|
||||
trainee.setComputer(computer);
|
||||
|
||||
trainee.setTasks(selectTasksOfTrainee(trainee.getID()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1015,36 +1007,6 @@ int DataBaseLMS::updateTrainee(Trainee trainee)
|
||||
return queryExecInt(queryStr);
|
||||
}
|
||||
|
||||
QList<Task> DataBaseLMS::selectTasksOfTrainee(int trainee_id)
|
||||
{
|
||||
QList<Task> tasks;
|
||||
|
||||
/*
|
||||
QString queryStr = QString("SELECT tasks.task_id, tasks.name "
|
||||
"FROM public.trainees "
|
||||
"JOIN public.trainees_tasks ON trainees_tasks.trainee_id = trainees.trainee_id "
|
||||
"JOIN public.tasks ON tasks.task_id = trainees_tasks.task_id "
|
||||
"WHERE trainees.trainee_id = %1 "
|
||||
"ORDER BY tasks.name ASC").arg(
|
||||
trainee_id);
|
||||
|
||||
QSqlQuery query = QSqlQuery(*db);
|
||||
|
||||
if(queryExec(queryStr, &query))
|
||||
{
|
||||
while (query.next())
|
||||
{//Задача
|
||||
Task task;
|
||||
task.setID(query.value(0).toInt());
|
||||
task.setName(query.value(1).toString());
|
||||
tasks.append(task);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
return tasks;
|
||||
}
|
||||
|
||||
int DataBaseLMS::queryExecInt(QString queryStr)
|
||||
{
|
||||
QSqlQuery query = QSqlQuery(*db);
|
||||
|
||||
Reference in New Issue
Block a user