-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathNotfication.cpp
63 lines (58 loc) · 1.41 KB
/
Notfication.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
62
63
#include "Notfication.h"
Notification::Notification()
{
}
Notification::Notification(string sender, string recipient, string date, string type, bool role, double amount)
{
this->sender = sender;
this->recipient = recipient;
this->date = date;
this->type = type;
this->role = role;
this->amount = amount;
}
string Notification::getSender()
{
return this->sender;
}
string Notification::getRecipient()
{
return this->recipient;
}
string Notification::getMessage()
{
string message;
if (role == 0 and type == "request")
{
message = recipient + " has requested from you " + to_string(amount) + " pounds" + " on " + date;
}
else if(role == 0 and type == "send"){
message = sender + "has sent to you " + to_string(amount) + " pounds" + " on " + date;
}
else if(role == 1 and type == "send") {
message = "An admin " + sender + " has sent to you " + to_string(amount) + " pounds" + " on " + date;
}
else if(role == 1 and type == "edit"){
message = "An admin " + sender + " has edited your balance to " + to_string(amount) + " pounds" + " on " + date;
}
return message;
}
string Notification::getDate()
{
return this->date;
}
string Notification::getType()
{
return this->type;
}
bool Notification::getRole()
{
return this->role;
}
double Notification::getAmount()
{
return this->amount;
}
Notification::~Notification()
{
}