-
Notifications
You must be signed in to change notification settings - Fork 0
/
database.h
47 lines (41 loc) · 944 Bytes
/
database.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
#ifndef DATABASE_H
#define DATABASE_H
#include <QSqlDatabase>
#include <QSqlQuery>
#include <QSqlQueryModel>
#include <QSqlError>
#include <QDebug>
#include <QMap>
#include <QJsonDocument>
#include <QJsonObject>
#include "synchronization.h"
#include "functions.h"
class Database
{
public:
Database();
~Database();
void database_definer();
QSqlQuery get_device_port_configuration();
bool control_card_id(QString);
QSqlQuery get_fuel_amount(int);
QSqlQuery get_fuel_price();
void update_fuel_amount(QMap<QString, QVariant>);
QSqlQuery get_fuel_price_all();
QSqlQuery get_fuel_amount_degree_all();
void insert_sale(QMap<QString, QVariant>);
QSqlQueryModel* get_table();
private:
static QSqlDatabase db_object;
};
struct my_struct
{
int id;
QString card_id;
QString name;
double fuel;
double fuel_price;
int tank_id;
};
extern my_struct my_stc;
#endif // DATABASE_H