added: now plugin ticket uses a new horizontal table (plugins.ticket)

columns: dir_id, param, value
we are able to build complicated tickets 



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@664 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2010-10-19 00:31:20 +00:00
parent 33057acd62
commit 1b053c03ba
53 changed files with 1680 additions and 1902 deletions

View File

@@ -300,7 +300,72 @@ return buffer;
void DbBase::CreateIdList(const std::vector<long> & id_tab, std::string & list, bool add_parentheses)
{
char buffer[50];
list.clear();
if( add_parentheses )
list += '(';
for(size_t i=0 ; i<id_tab.size() ; ++i)
{
sprintf(buffer, "%lu", (unsigned long)id_tab[i]);
list += buffer;
if( i+1 < id_tab.size() )
list += ',';
}
if( add_parentheses )
list += ')';
}
Error DbBase::DoCommand(const char * command)
{
PGresult * r = 0;
Error status = WINIX_ERR_OK;
try
{
bquery.Clear();
bquery << R(command);
r = AssertQuery(bquery);
AssertResult(r, PGRES_COMMAND_OK);
}
catch(const Error & e)
{
status = e;
}
ClearResult(r);
return status;
}
Error DbBase::BeginTrans()
{
return DoCommand("BEGIN;");
}
Error DbBase::RollbackTrans()
{
return DoCommand("ROLLBACK;");
}
Error DbBase::CommitTrans()
{
return DoCommand("COMMIT;");
}