This repository has been archived by the owner on Oct 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdatabase.hpp
61 lines (53 loc) · 1.45 KB
/
database.hpp
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
/*
* SPDX-License-Identifier: BSD-3-Clause
* Copyright (c) 2017 Markus Jylhänkangas
*/
#ifndef DATABASE_HPP
#define DATABASE_HPP
#include <QDataStream>
#include <QString>
// TODO: Lisää tietorakenteille vertailu overload
struct ProductStruct {
QString NameProd;
float PriceProd;
int KplProd;
};
QDataStream &operator>>(QDataStream &in, ProductStruct &product);
QDataStream &operator<<(QDataStream &out, const ProductStruct &product);
struct CustomerStruct {
QString Nimi1;
QString Nimi2;
QString Puh;
QString Katu1;
QString Katu2;
QString Kaupunki;
QString Postinum;
QString Potilas;
};
QDataStream &operator>>(QDataStream &in, CustomerStruct &customer);
QDataStream &operator<<(QDataStream &out, const CustomerStruct &customer);
struct CompanyStruct {
QString Y_tunnus = "0";
QString Name = "0";
QString Address;
QString Postal;
QString City;
QString Phonenumber;
QString Iban;
QString SaveFolderPath;
QString Field2;
QString Field1;
QString AlvText;
int Maksuaika;
};
QDataStream &operator>>(QDataStream &in, CompanyStruct &company);
QDataStream &operator<<(QDataStream &out, const CompanyStruct &company);
struct DatabaseStruct {
QList<ProductStruct> ProductList;
QList<CustomerStruct> CustomerList;
CompanyStruct CompanyInfo;
quint64 InvoiceNumber = 100;
};
QDataStream &operator>>(QDataStream &in, DatabaseStruct &data);
QDataStream &operator<<(QDataStream &out, const DatabaseStruct &data);
#endif // DATABASE_HPP