37 #include "vtkSQLQuery.h"
41 #include <QFormLayout>
42 #include <QMessageBox>
44 #include <QInputDialog>
46 #include <QPushButton>
56 setSubTitle(
tr(
"Create the authors for the gofigure projects:") );
84 "AuthorID",
"author").empty() )
88 tr(
"Please create at least one author for your project.") );
114 if ( FirstNameValue.empty() || LastNameValue.empty() )
117 tr(
"Please enter at least the lastname and the firstname of your author") );
122 std::vector< FieldWithValue > Conditions;
125 Conditions.push_back(FirstName);
126 Conditions.push_back(LastName);
131 tr(
"There is already an Author with the same lastname and firstname, please enter a middlename") );
144 tr(
"This author already exists") );
151 tr(
"Your author has been successfully created") );
169 field(
"Password").toString().toStdString() );
182 std::string iUser, std::string iPassword)
187 this->
m_DBName =
"gofiguredatabase";
int DoesThisAuthorAlreadyExists(vtkMySQLDatabase *DatabaseConnector)
check if the author already exists in the database, if yes, return the corresponding ID...
void setSubTitle(const QString &subTitle)
bool CloseDatabaseConnection(vtkMySQLDatabase *DatabaseConnector)
return true if the connection has been closed, false if the connection was already closed ...
QPushButton * CreateButton
vtkMySQLDatabase * OpenDatabaseConnection(std::string ServerName, std::string login, std::string Password, std::string DBName)
manages a map with keys matching fields of the gofiguredatabase Author table and values of the map ma...
QString tr(const char *sourceText, const char *disambiguation, int n)
QLineEdit * lineFirstName
void setBold(bool enable)
std::vector< std::string > ListAllValuesForOneColumn(vtkMySQLDatabase *DatabaseConnector, const std::string &ColumnName, const std::string &TableName, std::string OrderByColumnName)
SELECT ColumnName from TableName ORDER BY OrderbyColumnName.
QGoDBInitCreateAuthorsPage(QWidget *iparent=0)
void setText(const QString &text)
int SaveInDB(vtkMySQLDatabase *DatabaseConnector)
int FindOneID(vtkMySQLDatabase *DatabaseConnector, const std::string &TableName, const std::string &ColumnName, const std::string &field, const std::string &value)
SELECT ColumnName FROM TableName WHERE field = value.
QLineEdit * lineMiddleName
QVariant field(const QString &name) const
void SetDatabaseVariables(std::string iUser, std::string iPassword)
vtkMySQLDatabase * m_DatabaseConnector
void SetField(const std::string &key, const T &value)
convert the value into a string and assign it to the key in the map
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)