-
Notifications
You must be signed in to change notification settings - Fork 11
/
payment.cpp
50 lines (42 loc) · 1.09 KB
/
payment.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
#include "payment.h"
#include "ui_payment.h"
#include<QMessageBox>
#include<QDebug>
payment::payment(QWidget *parent) :
QDialog(parent),
ui(new Ui::payment)
{
ui->setupUi(this);
this->setWindowTitle("PAYMENT");
//QPixmap pix("D:\\qt\\irctc3\\payment.jpg");
//ui->label_2->setPixmap(pix);
}
payment::~payment()
{
delete ui;
}
void payment::on_pushButton_2_clicked()
{
exit(0);
}
void payment :: print_ticket()
{
dl=new details(this);
dl->show();
}
void payment::on_pushButton_clicked()
{
//confirm the ticket
//print ticket details
qDebug()<<ui->lineEdit->text().toInt()<< ui->lineEdit_2->text().toInt() << ui->lineEdit_3->text().toInt();
qDebug()<<(ui->lineEdit->text().toInt() && ui->lineEdit_2->text().toInt() && ui->lineEdit_3->text().toInt());
if(ui->lineEdit->text().toInt()>=1000 && ui->lineEdit_2->text().toInt()>=10000000 && ui->lineEdit_3->text().toInt()>=100)
{
print_ticket();
this->hide();
}
else
{
QMessageBox::critical(this,tr("error"),tr("fields are empty or Incorrect details"));
}
}