-
Notifications
You must be signed in to change notification settings - Fork 0
/
person.cpp
executable file
·61 lines (54 loc) · 1.9 KB
/
person.cpp
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
#include "person.h"
Person::Person(const QString& first_name,
const QString& last_name,
Address* address,
const QString& personal_code,
const QString& job,
const QString& license,
const QDate& date_of_issue,
const QString& email,
const QString& phone)
{
first_name_ = first_name;
last_name_ = last_name;
address_ = address;
personal_code_ = personal_code;
job_ = job;
license_ = license;
date_of_issue_ = date_of_issue;
email_ = email;
phone_ = phone;
}
Person::Person( const QString& first_name,
const QString& last_name,
Address* address,
const QString& personal_code,
const QString& job,
const QString& email,
const QString& phone)
{
first_name_ = first_name;
last_name_ = last_name;
address_ = address;
personal_code_ = personal_code;
job_ = job;
email_ = email;
phone_ = phone;
}
Person::~Person() {
delete address_;
}
bool Person::isSufficient() const
{
return !first_name_.isEmpty() &&
!last_name_.isEmpty() &&
!personal_code_.isEmpty() &&
(!email_.isEmpty() || phone_ != 0 );
}
void Person::setLicense(const QString& license, const QDate& date_of_issue, const bool& license_validity, const QDate& last_notification)
{
license_ = license;
date_of_issue_ = date_of_issue;
license_validity_ = license_validity;
last_notification_ = last_notification;
}