mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-29 20:05:38 +03:00
PSQL 30.10.2024
This commit is contained in:
82
DBXML/InstructorsAndTrainees/trainees/databasetrainees.h
Normal file
82
DBXML/InstructorsAndTrainees/trainees/databasetrainees.h
Normal file
@@ -0,0 +1,82 @@
|
||||
#ifndef DATABASETRAINEES_H
|
||||
#define DATABASETRAINEES_H
|
||||
|
||||
#include "instructorsAndTrainees_global.h"
|
||||
#include "trainee.h"
|
||||
#include "group.h"
|
||||
|
||||
#include "databaselms.h"
|
||||
|
||||
#include <QList>
|
||||
#include <QColor>
|
||||
#include <QObject>
|
||||
|
||||
class INSTRUCTORSANDTRAINEES_EXPORT DataBaseTrainees : QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DataBaseTrainees(QString appPath, DataBaseLMS* dbLMS = nullptr);
|
||||
~DataBaseTrainees();
|
||||
|
||||
void LoadTraineesGroupsXML();
|
||||
void SaveTraineesGroupsXML();
|
||||
|
||||
void LoadTraineesGroupsPSQL();
|
||||
|
||||
bool AuthorizationTrainee(QString login, QString password, QString learnClass, QString computer);
|
||||
bool deAuthorizationTrainee(QString login);
|
||||
|
||||
void setWhatItDoes(QString login, QString whatItDoes);
|
||||
QStringList getWhatItDoes(QString login);
|
||||
|
||||
QString getNameTraineeOnComputer(QString computer);
|
||||
Trainee getTraineeOnComputer(QString computer);
|
||||
|
||||
QString getNameTraineeByLogin(QString login);
|
||||
QColor getColorGroupByLogin(QString login);
|
||||
|
||||
QList<Trainee> getListTraineesInGroup(QString nameGroup);
|
||||
QList<Group> getListGroups();
|
||||
|
||||
QColor getColorGroup(Group::ColorGroup numColor);
|
||||
|
||||
Trainee getTrainee(QString name);
|
||||
Group getGroup(QString nameGroup);
|
||||
|
||||
QString newGroup();
|
||||
bool deleteGroup(QString name);
|
||||
bool editGroup(QString name, QString newName);
|
||||
|
||||
QString newTrainee(QString nameGroup);
|
||||
void deleteTrainee(QString name);
|
||||
void toArchiveTrainee(QString name);
|
||||
void fromeArchiveTrainee(QString name);
|
||||
bool editTrainee(QString name, Trainee trainee);
|
||||
|
||||
bool isArchived(QString name);
|
||||
|
||||
private:
|
||||
QString generateDefaultNameGroup();
|
||||
QString generateDefaultNameTrainee();
|
||||
bool checkExistNameGroup(QString name);
|
||||
bool checkExistNameTrainee(QString name);
|
||||
|
||||
QString generateDefaultLoginTrainee();
|
||||
bool checkExistLoginTrainee(QString login);
|
||||
|
||||
Group::ColorGroup generateDefaultColorGroup();
|
||||
bool checkExistColorGroup(Group::ColorGroup color);
|
||||
|
||||
private:
|
||||
QList<Trainee> listOfTrainees;
|
||||
QList<Group> listOfGroups;
|
||||
|
||||
QList<QColor> listOfColorGroup;
|
||||
|
||||
QString appDirPath;
|
||||
|
||||
DataBaseLMS* dbLMS;
|
||||
};
|
||||
|
||||
#endif // DATABASETRAINEES_H
|
||||
Reference in New Issue
Block a user