mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
сделал delInstructor
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user