сделал delInstructor

This commit is contained in:
krivoshein
2024-12-11 14:24:50 +03:00
parent 0cb03e49b1
commit 1569df7d94
43 changed files with 302 additions and 320 deletions

View File

@@ -33,7 +33,7 @@ void EditorInstructors::on_btnNewInstructor_clicked()
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_NEW_INSTRUCTOR);
return;
/*
if(int id_instructor = dbLMS->newInstructor())
{
loadInstructorsFromDB();
@@ -78,6 +78,7 @@ void EditorInstructors::on_btnNewInstructor_clicked()
}
}
}
*/
}
void EditorInstructors::on_btnDeleteInstructor_clicked()
@@ -92,13 +93,13 @@ void EditorInstructors::on_btnDeleteInstructor_clicked()
int id = treeItemCurrent->text(ColumnsTreeInsructors::clmn_ID).toInt();
if(dbLMS->isAdminInstructor(id))
if(connectorToServer->isAdminInstructor(id))
{//Это Админ!
QMessageBox::critical(this, tr("Error!"), tr("You cannot delete the Administrator."));
return;
}
if(dbLMS->isLoggedInInstructor(id))
if(connectorToServer->isLoggedInInstructor(id))
{//Инструктор залогирован!
QMessageBox::critical(this, tr("Error!"), tr("You cannot delete a logged-in instructor."));
return;
@@ -106,8 +107,9 @@ void EditorInstructors::on_btnDeleteInstructor_clicked()
if(QMessageBox::warning(this, tr("Attention!"), tr("The deletion will be irrevocable.\nDelete it anyway?"), QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Ok)
{
if(dbLMS->delInstructor(id))
loadInstructorsFromDB();
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_DEL_INSTRUCTOR, id);
//if(dbLMS->delInstructor(id))
//loadInstructorsFromDB();
}
}
}