-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadd_person.cpp
More file actions
59 lines (48 loc) · 940 Bytes
/
add_person.cpp
File metadata and controls
59 lines (48 loc) · 940 Bytes
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
#include "add_person.h"
Add_Person::Add_Person(QWidget *parent)
: QDialog(parent)
{
ui.setupUi(this);
connect(ui.add_pb , SIGNAL(clicked()), this, SLOT(add ()));
connect(ui.cancel_pb , SIGNAL(clicked()), this, SLOT(cancel ()));
}
Add_Person::~Add_Person()
{
}
void Add_Person::cancel ()
{
reject();
}
void Add_Person::add ()
{
prs.name = ui.name_le ->text();
prs.surname = ui.surname_le ->text();
prs.father_name = ui.father_name_le ->text();
prs.description = ui.description_le ->toPlainText();
prs.date_birth = ui.dateEdit ->date();
prs.age = QDateTime::currentDateTime().date().year() - prs.date_birth.year();
emit send_Person();
reject();
}
QString get_string_dayOfWeek(int n)
{
switch(n)
{
case 1:
return "Ïí";
case 2:
return "Âò";
case 3:
return "Ñð";
case 4:
return "×ò";
case 5:
return "Ïò";
case 6:
return "Ñá";
case 7:
return "Âñ";
default:
return "Îøèáêà";
}
}