PSQL 30.10.2024

This commit is contained in:
krivoshein
2024-10-30 15:33:26 +03:00
commit 024cd38bd6
256 changed files with 31332 additions and 0 deletions

View 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