-
Notifications
You must be signed in to change notification settings - Fork 0
/
TDBAccount.h
147 lines (138 loc) · 2.87 KB
/
TDBAccount.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
#ifndef TDBACCOUNT_H
#define TDBACCOUNT_H
#include <stdio.h>
#include <QString>
#include <QSqlQuery>
#include <QSqlRecord>
#include <QVariant>
#include <QSqlField>
#include <QDateTime>
#include <QMessageBox>
#include "TDBApplication.h"
#include "TDBDatabase.h"
#include "TDBAuth.h"
#include "TDBExceptions.h"
enum TDBCat
{
X_platal,
X_ancien,
binet,
personnel,
supop,
autre
};
class TDBAccount
{
protected:
int id;
QString trigramme;
QString name;
QString first_name;
QString nickname;
int category;
QString casert;
int balance;
int turnover;
int promo;
QString eMail;
QString picture;
public:
TDBAccount(const QString& tri) throw (TDBTrigrammeInconnuException);
TDBAccount(const QString& tri,
const QString& n,
const QString& fn,
const QString& nn,
const int cat,
const QString cst,
const int init_bal,
const int p,
const QString mail,
const QString pct) throw (TDBTrigrammeException);
int get_id(void)
{
return id;
}
QString get_name(void)
{
return name;
}
QString get_first_name(void)
{
return first_name;
}
QString get_nickname(void)
{
return nickname;
}
int get_balance(void)
{
return balance;
}
int get_turnover(void)
{
return (turnover - balance);
}
QString get_casert(void)
{
return casert;
}
int get_category(void)
{
return category;
}
QString get_category_str(void)
{
switch (category)
{
case X_platal:
return "X Platalien";
break;
case X_ancien:
return "X ancien";
break;
case binet:
return "Binet";
break;
case personnel:
return "Personnel";
break;
case supop:
return "Supop";
break;
default:
case autre:
return "Autre";
break;
}
}
int get_promo(void)
{
return promo;
}
QString get_trigramme(void)
{
return trigramme;
}
QString get_mail(void)
{
return eMail;
}
QString get_picture(void)
{
return picture;
}
void refresh_money();
void sendmail(QString subject, QString body);
bool transaction(int money, QString reason, TDBAccount* dest_account, int admin_id);
void modif(const QString& tri,
const QString& n,
const QString& fn,
const QString& nn,
const int cat,
const QString cst,
const int p,
const QString mail,
const QString pct) throw (TDBTrigrammeException);
void erase();
};
#endif