-
Notifications
You must be signed in to change notification settings - Fork 0
/
clsPerson.h
114 lines (90 loc) · 2.21 KB
/
clsPerson.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#pragma once
#include <iostream>
using namespace std;
class clsPerson
{
private:
string _FirstName;
string _LastName;
string _Email;
string _Phone;
public:
clsPerson(string FirstName, string LastName, string Email, string Phone)
{
_FirstName = FirstName;
_LastName = LastName;
_Email = Email;
_Phone = Phone;
}
//Read Only Property
//Property Set
void setFirstName(string FirstName)
{
_FirstName = FirstName;
}
//Property Get
string GetFirstName()
{
return _FirstName;
}
__declspec(property(put = setFirstName, get = GetFirstName)) string FirstName;
//Property Set
void setLastName(string LastName)
{
_LastName = LastName;
}
//Property Get
string GetLastName()
{
return _LastName;
}
__declspec(property(put = setLastName, get = GetLastName)) string LastName;
//Property Set
void setEmail(string Email)
{
_Email = Email;
}
//Property Get
string GetEmail()
{
return _Email;
}
__declspec(property(put = setEmail, get = GetEmail)) string Email;
//Property Set
void setPhone(string Phone)
{
_Phone = Phone;
}
//Property Get
string GetPhone()
{
return _Phone;
}
__declspec(property(put = setPhone, get = GetPhone)) string Phone;
string FullName()
{
return _FirstName + " " + _LastName;
}
void Print()
{
cout << "\nInfo:";
cout << "\n___________________";
cout << "\nFirstName: " << _FirstName;
cout << "\nLastName : " << _LastName;
cout << "\nFull Name: " << FullName();
cout << "\nEmail : " << _Email;
cout << "\nPhone : " << _Phone;
cout << "\n___________________\n";
}
void SendEmail(string Subject, string Body)
{
cout << "\nThe following message sent successfully to email: " << _Email;
cout << "\nSubject: " << Subject;
cout << "\nBody: " << Body << endl;
}
void SendSMS(string TextMessage)
{
cout << "\nThe following SMS sent successfully to phone: " << _Phone;
cout << "\n" << TextMessage << endl;
}
};