mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
PSQL 02.11.2024
This commit is contained in:
@@ -66,18 +66,28 @@ void EditorInstructors::on_btnToOrFromArchive_clicked()
|
||||
|
||||
QString name = treeItemCurrent->text(0);
|
||||
|
||||
if(dbInstructors->isArchived(name))
|
||||
Instructor instructor = dbInstructors->getInstructor(name);
|
||||
|
||||
if(instructor.getArchived())
|
||||
{//Архивный
|
||||
dbInstructors->fromeArchiveInstructor(name);
|
||||
loadInstructorsFromDB();
|
||||
setCurrentInstructor(name);
|
||||
instructor.setArchived(false);
|
||||
if(dbInstructors->editInstructor(name, instructor))
|
||||
{
|
||||
loadInstructorsFromDB();
|
||||
setCurrentInstructor(instructor.getName());
|
||||
}
|
||||
}
|
||||
else
|
||||
{//Не Архивный
|
||||
dbInstructors->toArchiveInstructor(name);
|
||||
loadInstructorsFromDB();
|
||||
if(archiveVisible)
|
||||
setCurrentInstructor(name);
|
||||
instructor.setArchived(true);
|
||||
if(dbInstructors->editInstructor(name, instructor))
|
||||
{
|
||||
if(!archiveVisible)
|
||||
ui->btnArchive->click();
|
||||
|
||||
loadInstructorsFromDB();
|
||||
setCurrentInstructor(instructor.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user