Доделал остальные операции по редактированию

This commit is contained in:
krivoshein
2024-12-12 10:27:18 +03:00
parent 1569df7d94
commit d28453440f
56 changed files with 725 additions and 540 deletions

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.11.1, 2024-12-10T17:52:46. -->
<!-- Written by QtCreator 4.11.1, 2024-12-11T17:49:41. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>

View File

@@ -20,12 +20,12 @@ bool InterfaceDataBaseLMS::ConnectionToDB()
{
if(!createConnection())
{
QMessageBox::critical(this, dbName, tr("Connection error: ") + db->lastError().text());
QMessageBox::critical(nullptr, dbName, tr("Connection error: ") + db->lastError().text());
return false;
}
else
{
//QMessageBox::information(this, dbName, tr("Connection is successful!"));
//QMessageBox::information(nullptr, dbName, tr("Connection is successful!"));
return true;
}
}
@@ -33,7 +33,7 @@ bool InterfaceDataBaseLMS::ConnectionToDB()
bool InterfaceDataBaseLMS::DisConnectionFromDB()
{
deleteConnection();
//QMessageBox::information(this, dbName, tr("Disconnection is successful!"));
//QMessageBox::information(nullptr, dbName, tr("Disconnection is successful!"));
return true;
}
@@ -112,35 +112,35 @@ int InterfaceDataBaseLMS::editInstructor(Instructor instructor)
{
if(instructor.getName() == QStringLiteral("<instructor>"))
{//Имя не корректно!
QMessageBox::critical(this, tr("Editing error!"),
QMessageBox::critical(nullptr, tr("Editing error!"),
tr("Unacceptable instructor name has been entered.\nThe changes will not be accepted."));
return 0;
}
if(instructor.getLogin() == QStringLiteral("<login>"))
{//Логин не корректен!
QMessageBox::critical(this, tr("Editing error!"),
QMessageBox::critical(nullptr, tr("Editing error!"),
tr("Unacceptable instructor login has been entered.\nThe changes will not be accepted."));
return 0;
}
if(instructor.getPassword() == QStringLiteral("<password>"))
{//Пароль не корректный!
QMessageBox::critical(this, tr("Editing error!"),
QMessageBox::critical(nullptr, tr("Editing error!"),
tr("Unacceptable instructor password has been entered.\nThe changes will not be accepted."));
return 0;
}
if(instructor.getName() == exist_instructor.getName() && instructor.getID() != exist_instructor.getID())
{//Имя уже существует
QMessageBox::critical(this, tr("Editing error!"),
QMessageBox::critical(nullptr, tr("Editing error!"),
tr("An existing instructor name has been entered."));
return 0;
}
if(instructor.getLogin() == exist_instructor.getLogin() && instructor.getID() != exist_instructor.getID())
{//Логин уже существует!
QMessageBox::critical(this, tr("Editing error!"),
QMessageBox::critical(nullptr, tr("Editing error!"),
tr("An existing instructor login has been entered.\nThe changes will not be accepted."));
return 0;
}
@@ -265,14 +265,14 @@ int InterfaceDataBaseLMS::editGroup(Group group)
{
if(group.getName() == QStringLiteral("<group>"))
{//Имя не корректно!
QMessageBox::critical(this, tr("Editing error!"),
QMessageBox::critical(nullptr, tr("Editing error!"),
tr("Unacceptable group name has been entered.\nThe changes will not be accepted."));
return 0;
}
if(group.getName() == exist_group.getName() && group.getID() != exist_group.getID())
{//Имя уже существует
QMessageBox::critical(this, tr("Editing error!"),
QMessageBox::critical(nullptr, tr("Editing error!"),
tr("An existing group name has been entered.\nThe changes will not be accepted."));
return 0;
}
@@ -299,35 +299,35 @@ int InterfaceDataBaseLMS::editTrainee(Trainee trainee)
{
if(trainee.getName() == QStringLiteral("<trainee>"))
{//Имя не корректно!
QMessageBox::critical(this, tr("Editing error!"),
QMessageBox::critical(nullptr, tr("Editing error!"),
tr("Unacceptable trainee name has been entered.\nThe changes will not be accepted."));
return 0;
}
if(trainee.getLogin() == QStringLiteral("<login>"))
{//Логин не корректен!
QMessageBox::critical(this, tr("Editing error!"),
QMessageBox::critical(nullptr, tr("Editing error!"),
tr("Unacceptable trainee login has been entered.\nThe changes will not be accepted."));
return 0;
}
if(trainee.getPassword() == QStringLiteral("<password>"))
{//Пароль не корректный!
QMessageBox::critical(this, tr("Editing error!"),
QMessageBox::critical(nullptr, tr("Editing error!"),
tr("Unacceptable trainee password has been entered.\nThe changes will not be accepted."));
return 0;
}
if(trainee.getName() == exist_trainee.getName() && trainee.getID() != exist_trainee.getID())
{//Имя уже существует
QMessageBox::critical(this, tr("Editing error!"),
QMessageBox::critical(nullptr, tr("Editing error!"),
tr("An existing trainee name has been entered."));
return 0;
}
if(trainee.getLogin() == exist_trainee.getLogin() && trainee.getID() != exist_trainee.getID())
{//Логин уже существует!
QMessageBox::critical(this, tr("Editing error!"),
QMessageBox::critical(nullptr, tr("Editing error!"),
tr("An existing trainee login has been entered.\nThe changes will not be accepted."));
return 0;
}