Начал реализовывать обмен запросами к БД

This commit is contained in:
krivoshein
2024-12-06 11:15:02 +03:00
parent 53b37240eb
commit 2f48cf3921
107 changed files with 938 additions and 1189 deletions

View File

@@ -3,8 +3,8 @@
#include "dialogeditinstructor.h"
#include "ui_editorinstructors.h"
EditorInstructors::EditorInstructors(InterfaceDataBaseLMS* dbLMS, bool adminMode, QWidget *parent) :
InstructorsView(dbLMS, CommonView::TypeView::control, parent),
EditorInstructors::EditorInstructors(ConnectorToServer* connectorToServer, bool adminMode, QWidget *parent) :
InstructorsView(connectorToServer, CommonView::TypeView::control, parent),
ui(new Ui::EditorInstructors)
{
ui->setupUi((QDialog*)this);

View File

@@ -16,7 +16,7 @@ class EditorInstructors : public InstructorsView
Q_OBJECT
public:
explicit EditorInstructors(InterfaceDataBaseLMS* dbLMS, bool adminMode, QWidget *parent = nullptr);
explicit EditorInstructors(ConnectorToServer* connectorToServer, bool adminMode, QWidget *parent = nullptr);
~EditorInstructors();
private Q_SLOTS:

View File

@@ -2,8 +2,8 @@
#include <QTranslator>
#include "instructorsview.h"
InstructorsView::InstructorsView(InterfaceDataBaseLMS* dbLMS, TypeView type, QWidget *parent):
CommonView(dbLMS, type, parent)
InstructorsView::InstructorsView(ConnectorToServer* connectorToServer, TypeView type, QWidget *parent):
CommonView(connectorToServer, type, parent)
{
}
@@ -99,15 +99,14 @@ void InstructorsView::loadInstructorsFromDB()
//Обновление дерева
treeWidget->clear();
if(!dbLMS->DBisConnected())
{
mtxTreeWidget.unlock();
return;
}
//Инструкторы
QList<Instructor> listInstructors;
listInstructors = dbLMS->getListInstructors();
//TODO
//listInstructors = dbLMS->getListInstructors();
//sendSystem->getListInstructors();
listInstructors = connectorToServer->getListInstructors();
for(Instructor instructor : listInstructors)
{
QTreeWidgetItem *ItemInstructor = new QTreeWidgetItem(treeWidget);

View File

@@ -11,7 +11,7 @@ class InstructorsView: public CommonView
Q_OBJECT
public:
InstructorsView(InterfaceDataBaseLMS* dbLMS, TypeView type, QWidget *parent = nullptr);
InstructorsView(ConnectorToServer* connectorToServer, TypeView type, QWidget *parent = nullptr);
protected:
enum ColumnsTreeInsructors{

View File

@@ -3,8 +3,8 @@
#include "viewerinstructors.h"
#include "ui_viewerinstructors.h"
ViewerInstructors::ViewerInstructors(InterfaceDataBaseLMS* db, QWidget *parent) :
InstructorsView(db, CommonView::TypeView::onlyView, parent),
ViewerInstructors::ViewerInstructors(ConnectorToServer* connectorToServer, QWidget *parent) :
InstructorsView(connectorToServer, CommonView::TypeView::onlyView, parent),
ui(new Ui::ViewerInstructors)
{
ui->setupUi(this);
@@ -39,7 +39,7 @@ void ViewerInstructors::on_btnEditorInstructors_clicked()
{
Q_EMIT signal_BlockAutorization(true);
EditorInstructors editorInstructors(dbLMS, adminMode);
EditorInstructors editorInstructors(connectorToServer, adminMode);
QDialog* dialog = new QDialog(this);
QHBoxLayout *layout = new QHBoxLayout(dialog);
layout->addWidget(&editorInstructors);

View File

@@ -14,7 +14,7 @@ class ViewerInstructors : public InstructorsView
Q_OBJECT
public:
explicit ViewerInstructors(InterfaceDataBaseLMS* db, QWidget *parent = nullptr);
explicit ViewerInstructors(ConnectorToServer* connectorToServer, QWidget *parent = nullptr);
~ViewerInstructors();
protected: