Рефакт

This commit is contained in:
2025-08-12 17:52:32 +03:00
parent bcd58e9631
commit 7466e33599
7 changed files with 150 additions and 245 deletions

View File

@@ -30,8 +30,8 @@ public:
~DataBaseLMS();
public:
const QString TypeUserDBInstructor = "instructor";
const QString TypeUserDBTrainee = "trainee";
static const QString TypeUserDBInstructor;
static const QString TypeUserDBTrainee;
protected:
//Подключение
@@ -43,17 +43,19 @@ protected:
bool transactionBegin();
bool transactionEnd();
//Юзер
int selectUserID(QString type, QString login, QString password = QStringLiteral(""));
QString selectUserNameByLogin(QString type, QString login);
bool selectUserLoggedIn(QString type, int id_user);
bool selectUserArchived(QString type, int id_user);
int updateUserLoggedIn(QString type, int id_user, bool loggedIn);
bool updateAllUsersLoggedIn(QString type, bool loggedIn);
int updateUserArchived(QString type, int id_user, bool archived);
//Инструктор
QList<Instructor> selectAllInstructors();
Instructor selectInstructor(int id_instructor);
int selectInstructorID(QString login, QString password = QStringLiteral(""));
QString selectInstructorNameByLogin(QString login);
bool selectInstructorIsAdmin(int id_instructor);
bool selectInstructorLoggedIn(int id_instructor);
bool selectInstructorArchived(int id_instructor);
int updateInstructorLoggedIn(int id_instructor, bool loggedIn);
bool updateAllInstructorsLoggedIn(bool loggedIn);
int updateInstructorArchived(int id_instructor, bool archived);
int insertInstructor();
int insertInstructor(Instructor instructor);
int deleteInstructor(int id_instructor);
@@ -71,15 +73,8 @@ protected:
QList<Trainee> selectAllTrainees();
Trainee selectTrainee(int id_trainee);
QList<Trainee> selectAllTraineesInGroup(int id_group);
int selectTraineeID(QString login, QString password = QStringLiteral(""));
QString selectTraineeNameByLogin(QString login);
QString selectTraineeNameOnComputer(QString computer_name);
Trainee selectTraineeOnComputer(QString computer_name);
bool selectTraineeArchived(int id_trainee);
bool selectTraineeLoggedIn(int id_trainee);
int updateTraineeLoggedIn(int id_trainee, bool loggedIn);
bool updateAllTraineesLoggedIn(bool loggedIn);
int updateTraineeArchived(int id_trainee, bool archived);
int insertTrainee(int id_group);
int insertTrainee(Trainee trainee);
int deleteTrainee(int id_trainee);