-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexchange.cpp
More file actions
110 lines (108 loc) · 2.95 KB
/
Copy pathexchange.cpp
File metadata and controls
110 lines (108 loc) · 2.95 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
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
#include<Exchange.h>
#include<homes.h>
#include<QVector>
#include<mainwindow.h>
/*void Exchange::set_Home(T a)
{
Home=a;
}*/
void Exchange::set_Commission(QString a)
{
Commission=a;
}
/*T Exchange::get_Home(void)
{
return Home;
}*/
QString Exchange::get_Commission(void)
{
return Commission;
}
void Exchange::set_IDD(QString a)
{
IDD=a;
}
void Sale::set_Terms_of_sale(QString a)
{
Terms_of_sale=a;
}
void Sale::set_Final_price(void)
{
//Final_price=a;
//Final_price=QString::number(this->Home.get_Total_price().toDouble()+this->get_Commission().toDouble()*this->Home.get_Total_price().toDouble());
if(this->IDD[0]=='N')
{
QVector<North>::iterator it;
for(it=MainWindow::northvillas.begin();MainWindow::northvillas.end()!=it;it++)
if(IDD==it->get_ID())
{
Final_price=QString::number(it->get_Total_price().toDouble()+this->get_Commission().toDouble()*it->get_Total_price().toDouble());
}
}
else if(this->IDD[0]=='S')
{
QVector<South>::iterator it;
for(it=MainWindow::southvillas.begin();MainWindow::southvillas.end()!=it;it++)
if(IDD==it->get_ID())
{
Final_price=QString::number(it->get_Total_price().toDouble()+this->get_Commission().toDouble()*it->get_Total_price().toDouble());
}
}
}
QString Sale::get_Terms_of_sale(void)
{
return Terms_of_sale;
}
QString Sale::get_Final_price(void)
{
return Final_price;
}
void Rent::set_Mortage(QString a)
{
Mortage=a;
}
void Rent::set_Lease_rate(QString a)
{
Lease_rate=a;
}
void Rent::set_Lease_duration(QString a)
{
Lease_duration=a;
}
void Rent::set_Final_price(void)
{
if(this->IDD[0]=='N')
{
QVector<North>::iterator it;
for(it=MainWindow::northvillas.begin();MainWindow::northvillas.end()!=it;it++)
if(IDD==it->get_ID())
{
Final_price=QString::number(it->get_Total_price().toDouble()*(1/100)*this->get_Lease_duration().toDouble()+it->get_Total_price().toDouble()*(5/100)+it->get_Total_price().toDouble()*(5/100)*this->get_Commission().toDouble());
}
}
else if(this->IDD[0]=='S')
{
QVector<South>::iterator it;
for(it=MainWindow::southvillas.begin();MainWindow::southvillas.end()!=it;it++)
if(IDD==it->get_ID())
{
Final_price=QString::number(it->get_Total_price().toDouble()*(1/100)*this->get_Lease_duration().toDouble()+it->get_Total_price().toDouble()*(5/100)+it->get_Total_price().toDouble()*(5/100)*this->get_Commission().toDouble());
}
}
}
QString Rent::get_Mortage(void)
{
return Mortage;
}
QString Rent::get_Lease_rate(void)
{
return Lease_rate;
}
QString Rent::get_Lease_duration(void)
{
return Lease_duration;
}
QString Rent::get_Final_price(void)
{
return Final_price;
}