сделал newInstructor

This commit is contained in:
krivoshein
2024-12-11 12:50:52 +03:00
parent 4556c07fc9
commit 0cb03e49b1
89 changed files with 1318 additions and 671 deletions

View File

@@ -30,6 +30,10 @@ EditorInstructors::~EditorInstructors()
void EditorInstructors::on_btnNewInstructor_clicked()
{
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_NEW_INSTRUCTOR);
return;
if(int id_instructor = dbLMS->newInstructor())
{
loadInstructorsFromDB();
@@ -236,7 +240,7 @@ void EditorInstructors::on_treeWidget_currentItemChanged(QTreeWidgetItem *curren
int id = current->text(ColumnsTreeInsructors::clmn_ID).toInt();
if(dbLMS->isArchivedInstructor(id))
if(connectorToServer->isArchivedInstructor(id))
{//Архивный
ui->btnToOrFromArchive->setText(tr("From archive"));
ui->btnToOrFromArchive->setIcon(QIcon(QStringLiteral(":/icons/instructorFromArchive.png")));
@@ -249,7 +253,7 @@ void EditorInstructors::on_treeWidget_currentItemChanged(QTreeWidgetItem *curren
ui->btnNewInstructor->setEnabled(true);
if(dbLMS->isAdminInstructor(id) || dbLMS->isLoggedInInstructor(id))
if(connectorToServer->isAdminInstructor(id) || connectorToServer->isLoggedInInstructor(id))
{//Это Админ или залогированный! Удалять/Архивировать/Редактировать нельзя!
ui->btnDeleteInstructor->setEnabled(false);
ui->btnToOrFromArchive->setEnabled(false);
@@ -259,7 +263,7 @@ void EditorInstructors::on_treeWidget_currentItemChanged(QTreeWidgetItem *curren
{
ui->btnToOrFromArchive->setEnabled(true);
if(dbLMS->isArchivedInstructor(id))
if(connectorToServer->isArchivedInstructor(id))
ui->btnDeleteInstructor->setEnabled(true);
else
ui->btnDeleteInstructor->setEnabled(false);

View File

@@ -40,6 +40,8 @@ void ViewerInstructors::on_btnEditorInstructors_clicked()
Q_EMIT signal_BlockAutorization(true);
EditorInstructors editorInstructors(connectorToServer, adminMode);
connect(connectorToServer, &ConnectorToServer::signal_UpdateDB, &editorInstructors, &EditorInstructors::slot_NeedUpdateUI);
QDialog* dialog = new QDialog(this);
QHBoxLayout *layout = new QHBoxLayout(dialog);
layout->addWidget(&editorInstructors);