mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
Начал реализовывать обмен запросами к БД
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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{
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user