-
Notifications
You must be signed in to change notification settings - Fork 0
/
signup.cpp
52 lines (48 loc) · 1.3 KB
/
signup.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
51
52
#include "signup.h"
#include "ui_signup.h"
#include"mainwindow.h"
#include"Logic/Library.h"
#include"QMessageBox"
#include<iostream>
using namespace std;
SignUp::SignUp(QWidget *parent) :
QWidget(parent),
ui(new Ui::SignUp)
{
ui->setupUi(this);
}
SignUp::~SignUp()
{
delete ui;
}
void SignUp::on_SignUp_2_pressed()
{
QString username = ui->UserName->text();
QString email = ui->Email->text();
QString password = ui->Password->text();
QString re_password = ui->re_Password->text();
if(username.toStdString()!=""&&email.toStdString()!=""&&password.toStdString()!=""&&password==re_password){
long id = library->add_librarian(username.toStdString(),password.toStdString());
QString str = "Use this id to sign in ";
str+=QString::number(id);
QMessageBox messageBox;
messageBox.information(0,"ID",str);
messageBox.setFixedSize(500,200);
messageBox.show();
this->hide();
MainWindow * w = new MainWindow();
w->show();
}
else{
QMessageBox messageBox;
messageBox.critical(0,"Error","Please Enter Correct input!");
messageBox.setFixedSize(500,200);
messageBox.show();
}
}
void SignUp::on_Back_pressed()
{
this->hide();
MainWindow * w = new MainWindow();
w->show();
}