-
Notifications
You must be signed in to change notification settings - Fork 4
/
dbase.h
55 lines (31 loc) · 1.19 KB
/
dbase.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
#ifndef dbase_H
#define dbase_H
#include <QSqlDatabase>
#include<QList>
class Dbase
{
public:
Dbase(const QString& path);
~Dbase();
bool isOpen() const;
void createTable();
bool addAdmin(const QString &fname, const QString &lname, const QString &username, const QString &mobileno, const QString &email, const QString &passwd);
bool emailExists(const QString& email);
bool unameExists(const QString &uname);
bool userAuth(const QString& uname, const QString& pass) const;
QList<QString> getAdminInfo(const QString& uname);
bool getAdminInfo();
////functions for handling admin login
void createAdmin_LoginTable();//create table for admin that has log in
void addAdmin_Login(QString &uname);//store data of admin that has log in
void deleteAdmin_Login();
////functions for handling cashier login
bool cashierAuth(const QString& uname, const QString& pass) const;
void createCashier_LoginTable();
QList<QString> getCashierInfo(const QString &uname);
void addCashier_Login(QString &uname);
void deleteCashier_Login();
private:
QSqlDatabase db;
};
#endif // dbase_H