43 std::string iEntityName,
44 int iImgSessionID) :
QWidget(iParent),
45 m_NameDescDialog(NULL),
46 m_DatabaseConnector(NULL)
64 vtkMySQLDatabase *iDatabaseConnector)
90 this->
m_EntityName,
"Name",
"Description",
"ImagingSessionID",
104 vtkMySQLDatabase *iDatabaseConnector)
112 SIGNAL( ListEntitiesToDelete(std::vector< std::string > ) ),
117 return Dialog->
exec();
124 std::vector< std::string > iVectorNamesEntitiesToDelete)
129 "Name", iVectorNamesEntitiesToDelete);
146 std::vector< std::string > ResultsQuery;
147 if ( iDatabaseConnector )
154 iDatabaseConnector, this->
m_EntityName,
"Name",
"ImagingSessionID",
170 vtkMySQLDatabase *iDatabaseConnector)
174 EntityNameID +=
"ID";
vtkMySQLDatabase * m_DatabaseConnector
NamesDescrContainerType GetListExistingEntities(vtkMySQLDatabase *iDatabaseConnector)
return the list of all the existing entities stored in the database
std::string m_NameNewEntity
void DeleteEntitiesFromList(std::vector< std::string > iVectorNamesEntitiesToDelete)
Delete in the database the entities with the names contained in the vector.
~QGoDBNameDescEntityManager()
virtual void ValidateName(std::string iName, std::string iDescription)=0
Pure Virtual method : check that the name doesn't already exists in the database, if so...
QGoDBNameDescEntityManager(QWidget *iParent=0, std::string iEntityName="", int iImgSessionID=0)
int GetTheEntityID(std::string iName, vtkMySQLDatabase *iDatabaseConnector)
get the ID of the entity based on the name
QGoNameDescriptionInputDialog * m_NameDescDialog
std::vector< std::pair< std::string, std::string > > VectorTwoColumnsFromTable(vtkMySQLDatabase *DatabaseConnector, const std::string &ColumnNameOne, const std::string &ColumnNameTwo, const std::string &TableName, const std::string &OrderByColumnName)
SELECT ColumnNameOne,ColumnNameTwo FROM TableName ORDER BY ColumnName ASC.
virtual bool DeleteEntity(vtkMySQLDatabase *iDatabaseConnector)
show the list of the existing entities so the user can choose the ones he wants to delete...
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.
void DeleteRows(vtkMySQLDatabase *DatabaseConnector, std::string TableName, std::string field, std::vector< std::string > VectorValues)
std::vector< std::pair< std::string, std::string > > ListSpecificValuesForTwoColumns(vtkMySQLDatabase *DatabaseConnector, const std::string &TableName, const std::string &ColumnNameOne, const std::string &ColumnNameTwo, const std::string &field, const std::string &value, const std::string &ColumnNameOrder)
SELECT ColumnNameOne,ColumnName2 FROM TableName WHERE field = value ORDER BY ColumnNameOrder ASC"...
std::vector< std::string > ListSpecificValuesForOneColumn(vtkMySQLDatabase *iDatabaseConnector, const std::string &TableName, const std::string &ColumnName, const std::string &field, const std::string &value, bool ExcludeZero)
SELECT ColumnName FROM TableName WHERE field = value and ColumnName <> 0 (if excludezero) ...
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.
std::string GetNameNewEntity()
return the name of the new entity added
std::vector< std::pair< std::string, std::string > > NamesDescrContainerType
this class displays a list of entities and return the list of the ones selected by the user...
std::vector< std::string > GetNameExistingEntities(vtkMySQLDatabase *iDatabaseConnector)
return the names of all the entities stored in the database
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
std::string AddAnEntity(vtkMySQLDatabase *iDatabaseConnector)
execute the dialog asking the user to enter a name and a description, validates the name...