PNPkurs-PIbd-31-Alekseev-I-S/service/serviceloaddb.h
Иван Алексеев f522412382 готово
2025-01-15 22:57:00 +04:00

61 lines
1.3 KiB
C++

#ifndef SERVICELOADDB_H
#define SERVICELOADDB_H
#include "service/types.h"
#include <QObject>
#include <QMessageBox>
#include <QSql>
#include <QSqlDatabase>
#include <QSqlRecord>
#include <QSqlQuery>
#include <QSqlError>
#include <QString>
#include <QDebug>
#include <QStringList>
#include <QMap>
#include <QList>
#include <QFile>
class ServiceLoadDB : public QObject
{
Q_OBJECT
public:
explicit ServiceLoadDB(QObject *parent = nullptr);
void start();
void updateLikesState(QMap<int, Project> &);
private:
QList<DeviceStructureElement> readStructureElements(int modelId);
signals:
void sendStages(QMap<int, Stages> &);
void sendWorkers(QMap<int, Worker> &);
void sendTeams(QMap<int, Team> &);
void sendDeviceTypes(QMap<int, DeviceType> &);
void sendDeviceModels(QMap<int, DeviceModel> &);
void sendProjects(QMap<int, Project> &);
public slots:
void loadStages();
void loadWorkers();
void loadTeams();
void loadDeviceTypes();
void loadDeviceModels();
void loadProjects();
private:
QSqlDatabase db;
QString db_input;
QSqlQuery query;
QMap<int, Stages> mapStages;
QMap<int, Worker> mapWorkers;
QMap<int, Team> mapTeams;
QMap<int, DeviceType> mapDeviceTypes;
QMap<int, DeviceModel> mapDeviceModels;
QMap<int, Project> mapProjects;
signals:
};
#endif // SERVICELOADDB_H