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