-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathborrowboow.cpp
More file actions
40 lines (36 loc) · 880 Bytes
/
Copy pathborrowboow.cpp
File metadata and controls
40 lines (36 loc) · 880 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
#include "borrowboow.h"
#include "ui_borrowboow.h"
#include"QMessageBox"
#include"librarianui.h"
#include"mainwindow.h"
BorrowBoow::BorrowBoow(QWidget *parent) :
QWidget(parent),
ui(new Ui::BorrowBoow)
{
ui->setupUi(this);
}
BorrowBoow::~BorrowBoow()
{
delete ui;
}
void BorrowBoow::on_Borrow_clicked()
{
long user = ui->userid->text().toInt();
long book = ui->bookid->text().toInt();
bool ok = library->borrow_book(book , user);
this->hide();
if(ok){
QMessageBox messageBox;
messageBox.information(0,"Ok","OK");
messageBox.setFixedSize(500,200);
messageBox.show();
}
else{
QMessageBox messageBox;
messageBox.critical(0,"Wrong","something go wrong the prosses failed");
messageBox.setFixedSize(500,200);
messageBox.show();
}
LibrarianUi *l = new LibrarianUi;
l->show();
}