-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaccount.h
More file actions
252 lines (139 loc) · 8.03 KB
/
account.h
File metadata and controls
252 lines (139 loc) · 8.03 KB
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
//
// Created by lu'ren'jia'd's on 2021/12/15.
//
#ifndef UNTITLED1_ACCOUNT_H
#define UNTITLED1_ACCOUNT_H
#include <vector>
#include "book.h"
#include "account.h"
void InvalidReport();
struct accountInfo {
int rank = 0;
char Username[40];
char UserID[40];
char Password[40];
};
class People {
public:
People() = default;
~People() = default;
virtual accountInfo GetInfo() = 0;
virtual void InputInfo(accountInfo &tmp) = 0;
virtual void Su(char *id, char *pass_word) = 0;//以栈来维护,登入账号推入栈
virtual void Register(char *id, char *pass_word, char *user_name) = 0;//以块链维护账户信息
virtual void Passwd(char *id, char *passwd1, char *passwd2) = 0;//通过块链找到账户信息
virtual void Useradd(char *id, char *pass_word, int priority, char *user_name) = 0;//以块链维护账户信息
virtual void Delete(char *id) = 0;//先通过栈寻找是否登陆,再通过块链删除
virtual void Show(char *isbn, char *name, char *author, char *keyword) = 0;//图书信息由另一个文件的块链储存
virtual void Buy(char *isbn, int quantity) = 0;//通过块链找到信息并修改
virtual void Select(char *isbn) = 0;//通过块链找到信息,同时在该类中记录选中的图书
virtual void Modify(char *isbn, char *name, char *author, char *keyword, double price) = 0;//通过记录的信息在块链中修改
virtual void Import(int quantity, double cost) = 0;//通过记录的信息在块链中修改
virtual void ReportMyself() = 0;//以二进制文件储存,用链表维护(每一个节点的信息为操作以及下一个这个员工的操作在文件中的位置)
virtual void ShowFinance(int time) = 0;
virtual void ShowFinance() = 0;
virtual void ReportFinance() = 0;
virtual void ReportEmployee() = 0;
virtual void Log() = 0;//以上三个操作均存一个不同的ASCLL文件
};
class Manager : public People {
private:
accountInfo info;
public:
Manager();
~Manager() = default;
accountInfo GetInfo();
void InputInfo(accountInfo &tmp);
void Su(char *id, char *pass_word);//以栈来维护,登入账号推入栈
void Register(char *id, char *pass_word, char *user_name);//以块链维护账户信息
void Passwd(char *id, char *passwd1, char *passed2);//通过块链找到账户信息
void Useradd(char *id, char *pass_word, int priority, char *user_name);//以块链维护账户信息
void Delete(char *id);//先通过栈寻找是否登陆,再通过块链删除
void Show(char *isbn, char *name, char *author, char *keyword);//图书信息由另一个文件的块链储存
void Buy(char *isbn, int quantity);//通过块链找到信息并修改
void Select(char *isbn);//通过块链找到信息,同时在该类中记录选中的图书
void Modify(char *isbn, char *name, char *author, char *keyword, double price);//通过记录的信息在块链中修改
void Import(int quantity, double cost);//通过记录的信息在块链中修改
void ReportMyself();//以二进制文件储存,用链表维护(每一个节点的信息为操作以及下一个这个员工的操作在文件中的位置)
void ShowFinance(int time);
void ShowFinance();
void ReportFinance();
void ReportEmployee();
void Log();//以上三个操作均存一个不同的ASCLL文件
};
class Employee : public People {
private:
accountInfo info;
public:
Employee();
~Employee() = default;
accountInfo GetInfo();
void InputInfo(accountInfo &tmp);
void Su(char *id, char *pass_word);//以栈来维护,登入账号推入栈
void Register(char *id, char *pass_word, char *user_name);//以块链维护账户信息
void Passwd(char *id, char *passwd1, char *passwd2);//通过块链找到账户信息
void Useradd(char *id, char *pass_word, int priority, char *user_name);//以块链维护账户信息
void Delete(char *id);//先通过栈寻找是否登陆,再通过块链删除
void Show(char *isbn, char *name, char *author, char *keyword);//图书信息由另一个文件的块链储存
void Buy(char *isbn, int quantity);//通过块链找到信息并修改
void Select(char *isbn);//通过块链找到信息,同时在该类中记录选中的图书
void Modify(char *isbn, char *name, char *author, char *keyword, double price);//通过记录的信息在块链中修改
void Import(int quantity, double cost);//通过记录的信息在块链中修改
void ReportMyself();//以二进制文件储存,用链表维护(每一个节点的信息为操作以及下一个这个员工的操作在文件中的位置)
void ShowFinance(int time);
void ShowFinance();
void ReportFinance();
void ReportEmployee();
void Log();//以上三个操作均存一个不同的ASCLL文件
};
class Customer : public People {
private:
accountInfo info;
public:
Customer();
~Customer() = default;
accountInfo GetInfo();
void InputInfo(accountInfo &tmp);
void Su(char *id, char *pass_word);//以栈来维护,登入账号推入栈
void Register(char *id, char *pass_word, char *user_name);//以块链维护账户信息
void Passwd(char *id, char *passwd1, char *passwd2);//通过块链找到账户信息
void Useradd(char *id, char *pass_word, int priority, char *user_name);//以块链维护账户信息
void Delete(char *id);//先通过栈寻找是否登陆,再通过块链删除
void Show(char *isbn, char *name, char *author, char *keyword);//图书信息由另一个文件的块链储存
void Buy(char *isbn, int quantity);//通过块链找到信息并修改
void Select(char *isbn);//通过块链找到信息,同时在该类中记录选中的图书
void Modify(char *isbn, char *name, char *author, char *keyword, double price);//通过记录的信息在块链中修改
void Import(int quantity, double cost);//通过记录的信息在块链中修改
void ReportMyself();//以二进制文件储存,用链表维护(每一个节点的信息为操作以及下一个这个员工的操作在文件中的位置)
void ShowFinance(int time);
void ShowFinance();
void ReportFinance();
void ReportEmployee();
void Log();//以上三个操作均存一个不同的ASCLL文件
};
class Visitor : public People {
private:
accountInfo info;
public:
Visitor();
~Visitor() = default;
accountInfo GetInfo();
void InputInfo(accountInfo &tmp);
void Su(char *id, char *pass_word);//以栈来维护,登入账号推入栈
void Register(char *id, char *pass_word, char *user_name);//以块链维护账户信息
void Passwd(char *id, char *passwd1, char *new_passwd2);//通过块链找到账户信息
void Useradd(char *id, char *pass_word, int priority, char *user_name);//以块链维护账户信息
void Delete(char *id);//先通过栈寻找是否登陆,再通过块链删除
void Show(char *isbn, char *name, char *author, char *keyword);//图书信息由另一个文件的块链储存
void Buy(char *isbn, int quantity);//通过块链找到信息并修改
void Select(char *isbn);//通过块链找到信息,同时在该类中记录选中的图书
void Modify(char *isbn, char *name, char *author, char *keyword, double price);//通过记录的信息在块链中修改
void Import(int quantity, double cost);//通过记录的信息在块链中修改
void ReportMyself();//以二进制文件储存,用链表维护(每一个节点的信息为操作以及下一个这个员工的操作在文件中的位置)
void ShowFinance(int time);
void ShowFinance();
void ReportFinance();
void ReportEmployee();
void Log();//以上三个操作均存一个不同的ASCLL文件
};
#endif //UNTITLED1_ACCOUNT_H