#ifndef DATABASELMS_H #define DATABASELMS_H #include #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 selectAllInstructors(); QList selectAllTrainees(); QList 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