KissCount/model/Database.h

40 lines
805 B
C
Raw Normal View History

#ifndef DATABASE_H
#define DATABASE_H
2010-05-15 11:21:42 +02:00
#include <stdio.h>
#include <fstream>
#include <list>
#include <wx/wxsqlite3.h>
#include <wx/wx.h>
#include <sha1.h>
2010-05-15 11:21:42 +02:00
#include "model.h"
#define BDD_FILE "kc.bdd"
#define INIT_SCRIPT "init.sql"
class Database
{
public:
Database();
std::list<wxString> GetUsers();
bool IsValidUser(wxString user, wxString password);
2010-05-15 11:21:42 +02:00
User* LoadUser(wxString name);
2010-05-16 10:35:34 +02:00
void LoadYear(User* user, int year);
2010-06-02 22:14:11 +02:00
double GetAccountAmount(wxString id, int month, int year);
2010-06-03 18:28:38 +02:00
void UpdateOperation(struct operation op);
void AddOperation(User* user, struct operation op);
void DeleteOperation(struct operation op);
2010-06-12 15:59:27 +02:00
void SetAccountAmount(int month, int year, wxString accountId, double amount);
2010-06-03 18:28:38 +02:00
private:
wxSQLite3Database _db;
void CreateDatabase();
};
#endif