-
Notifications
You must be signed in to change notification settings - Fork 0
/
customerrepo.h
48 lines (33 loc) · 1.03 KB
/
customerrepo.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
#ifndef CUSTOMERREPO_H
#define CUSTOMERREPO_H
#include <QVector>
#include <QString>
#include "customer.h"
using std::vector;
class customerRepo
{
QVector<customer> all;
bool exist(const customer &c) const;
public:
customerRepo() = default;
//nu se permite copierea de obiecte
customerRepo(const customerRepo &ot) = delete;
//salvare client
void store(const customer &c);
//cautare client
const customer & find(QString company, QString cui, QString bank, QString iban, QString country, QString phone,
QString email, QString address) const;
//cautare client dupa firma
const customer& findByCompany(QString company ) const;
//cautare client dupa cui
const customer& findByCui(QString cui) const;
//returnam toti clientii salvati
const QVector<customer>& getAll() const noexcept;
};
//semnalam eventuale exceptii ce apar in repo
class customerRepoException{
QString msg;
public:
customerRepoException(QString m) : msg{m}{}
};
#endif // CUSTOMERREPO_H