mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
51 lines
1.1 KiB
C++
51 lines
1.1 KiB
C++
#ifndef DATABASELMS_H
|
|
#define DATABASELMS_H
|
|
|
|
#include <QSqlDatabase>
|
|
|
|
#include "instructor.h"
|
|
#include "trainee.h"
|
|
#include "group.h"
|
|
|
|
#include "DataBaseLMS_global.h"
|
|
|
|
class DATABASELMS_EXPORT DataBaseLMS
|
|
{
|
|
public:
|
|
DataBaseLMS();
|
|
~DataBaseLMS();
|
|
|
|
public:
|
|
bool createConnection();
|
|
void deleteConnection();
|
|
|
|
QList<Instructor> selectAllInstructors();
|
|
QList<Trainee> selectAllTrainees();
|
|
QList<Group> selectAllGroups();
|
|
|
|
bool insertInstructor(Instructor instructor);
|
|
bool deleteInstructor(int instructor_id);
|
|
bool updateInstructor(Instructor instructor);
|
|
|
|
bool insertGroup(Group group);
|
|
bool deleteGroup(int group_id);
|
|
bool updateGroup(Group group);
|
|
|
|
bool insertTrainee(Trainee trainee);
|
|
bool deleteTrainee(int trainee_id);
|
|
bool updateTrainee(Trainee trainee);
|
|
|
|
private:
|
|
bool queryExec(QString queryStr);
|
|
void messageWarningErrorQuery(QString queryStr);
|
|
|
|
private:
|
|
QSqlDatabase* db;
|
|
const QString dbName = "DataBaseLMS";
|
|
const QString dbUserName = "postgres";
|
|
const QString dbPassword = "12345678";
|
|
const QString dbType = "QPSQL";
|
|
};
|
|
|
|
#endif // DATABASELMS_H
|