mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
53 lines
1.2 KiB
C++
53 lines
1.2 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();
|
|
|
|
int insertInstructor(Instructor instructor);
|
|
int deleteInstructor(int instructor_id);
|
|
int updateInstructor(Instructor instructor);
|
|
|
|
int insertGroup(Group group);
|
|
int deleteGroup(int group_id);
|
|
int updateGroup(Group group);
|
|
|
|
int insertTrainee(Trainee trainee);
|
|
int deleteTrainee(int trainee_id);
|
|
int updateTrainee(Trainee trainee);
|
|
|
|
QList<Task> selectTasksOfTrainee(int trainee_id);
|
|
|
|
private:
|
|
int 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
|