-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtransaction.cpp
More file actions
72 lines (67 loc) · 1.65 KB
/
transaction.cpp
File metadata and controls
72 lines (67 loc) · 1.65 KB
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
#include "transaction.h"
using namespace std;
Transaction::Transaction()
{
}
Transaction::Transaction(unsigned int subscriberId, unsigned int contentId, QDate issueDate, QDate returnDate)
{
this->contentId = contentId;
this->subscriberId = subscriberId;
this->issueDate = issueDate;
this->returnDate = returnDate;
}
void Transaction::updateTransactions(unsigned int subscriberId, unsigned int contentId, QDate issueDate, QDate returnDate)
{
this->contentId = contentId;
this->subscriberId = subscriberId;
this->issueDate = issueDate;
this->returnDate = returnDate;
}
//======setters=======
Transaction& Transaction::setSubscriberId(unsigned int subscriberId)
{
this->subscriberId = subscriberId;
return *this;
}
Transaction& Transaction::setContentId(unsigned int contentId)
{
this->contentId = contentId;
return *this;
}
Transaction& Transaction::setIssueDate(QDate date)
{
this->issueDate = date;
return *this;
}
Transaction& Transaction::setIssueDate(int day, int month, int year)
{
this->issueDate.setDate(year,month,day);
return *this;
}
Transaction& Transaction::setReturnDate(int day,int month, int year)
{
this->returnDate.setDate(year,month,day);
return *this;
}
Transaction& Transaction::setReturnDate(QDate date)
{
this->returnDate = date;
return *this;
}
//======getters========
unsigned int Transaction::getSubscriberId() const
{
return this->subscriberId;
}
unsigned int Transaction::getContentId() const
{
return this->contentId;
}
QDate Transaction::getIssueDate() const
{
return this->issueDate;
}
QDate Transaction::getReturnDate() const
{
return this->returnDate;
}