mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
PSQL 01.11.2024
This commit is contained in:
50
DB_LMS/DataBaseLMS/databaselms.h
Normal file
50
DB_LMS/DataBaseLMS/databaselms.h
Normal file
@@ -0,0 +1,50 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user