61 lines
969 B
C
61 lines
969 B
C
|
/*
|
||
|
* This file is a part of Winix
|
||
|
* and is not publicly distributed
|
||
|
*
|
||
|
* Copyright (c) 2010, Tomasz Sowa
|
||
|
* All rights reserved.
|
||
|
*
|
||
|
*/
|
||
|
|
||
|
#ifndef headerfile_winix_plugins_ticket_tdb
|
||
|
#define headerfile_winix_plugins_ticket_tdb
|
||
|
|
||
|
|
||
|
#include <vector>
|
||
|
#include "ticket.h"
|
||
|
#include "db/dbbase.h"
|
||
|
#include "core/error.h"
|
||
|
|
||
|
|
||
|
namespace Ticket
|
||
|
{
|
||
|
|
||
|
|
||
|
class TDb : public DbBase
|
||
|
{
|
||
|
|
||
|
|
||
|
public:
|
||
|
|
||
|
Error GetTicketByDirId(long dir_id, Ticket & ticket);
|
||
|
Error GetTickets(long parent_id, std::vector<Ticket> & ticket_tab);
|
||
|
//bool IsTicket(long dir_id);
|
||
|
Error AddTicket(Ticket & ticket);
|
||
|
Error EditTicketById(Ticket & ticket);
|
||
|
Error EditTicketRemoveItem(long item_id);
|
||
|
Error RemoveTicket(long dir_id);
|
||
|
|
||
|
|
||
|
struct TicketColumns
|
||
|
{
|
||
|
int id, dir_id, parent_id, type, status, priority, category, expected, progress, item_id;
|
||
|
|
||
|
void SetColumns(PGresult * r);
|
||
|
void SetTicket(PGresult * r, long row, Ticket & ticket);
|
||
|
};
|
||
|
|
||
|
|
||
|
|
||
|
private:
|
||
|
|
||
|
DbTextStream query;
|
||
|
|
||
|
};
|
||
|
|
||
|
|
||
|
} // namespace
|
||
|
|
||
|
|
||
|
#endif
|
||
|
|