-
Notifications
You must be signed in to change notification settings - Fork 0
/
useraddform.cpp
37 lines (31 loc) · 903 Bytes
/
useraddform.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
#include "useraddform.h"
#include "ui_useraddform.h"
UserAddForm::UserAddForm(QWidget *parent) :
QWidget(parent),
ui(new Ui::UserAddForm)
{
ui->setupUi(this);
}
UserAddForm::~UserAddForm()
{
delete ui;
}
void UserAddForm::on_cancel_but_clicked()
{
this->close();
}
void UserAddForm::on_add_but_clicked()
{
pass = Passanger(ui->line_pass_num->text().toStdString(),
ui->line_name->text().toStdString(),
ui->dateEdit->date().toString("dd.MM.yyyy").toStdString(),
ui->line_issplace->text().toStdString());
if (pass.full_name.size() < 5 || pass.passport_number.size() < 11 || pass.issue_date.size() < 5)
QMessageBox::warning(this, "Ошибка", "Не все поля заполнены!");
else
emit pressed_add();
}
Passanger UserAddForm::get_passanger()
{
return pass;
}