-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin.cpp
More file actions
120 lines (105 loc) · 2.26 KB
/
Copy pathadmin.cpp
File metadata and controls
120 lines (105 loc) · 2.26 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#include "admin.h"
#include "ui_admin.h"
#include "withdraw.h"
#include "deposit.h"
#include "transfer.h"
#include "login.h"
#include "mainwindow.h"
#include"userlist.h"
#include"usertransactions.h"
#include<QMessageBox>
#include<QDebug>
Admin::Admin(QWidget *parent) :
QWidget(parent),
ui(new Ui::Admin)
{
ui->setupUi(this);
ui->userInfo->hide();
MainWindow::session="admin";
}
Admin::~Admin()
{
delete ui;
}
void Admin::on_moneWithdrawal_clicked()
{
withdraw *w = new withdraw(nullptr,user);
w->show();
this->hide();
}
void Admin::on_moneyDeposit_clicked()
{
deposit *d = new deposit(nullptr,user);
d->show();
this->hide();
}
void Admin::on_moneyTransfer_clicked()
{
transfer *t = new transfer(nullptr,user);
t->show();
this->hide();
}
void Admin::on_searchUser_clicked()
{
head temp = MainWindow::user_top;
bool flag =false;
if(temp)
{
int account = ui->userSearch->text()!=""?(ui->userSearch->text()).toInt():-1;
do
{
if(temp->account==account)
{
flag=true;
qDebug()<<account;
user=temp;
break;
}
else{
temp=temp->next;
}
}
while(temp!=0);
if(flag)
{
ui->name->setText(temp->name);
ui->aadhaar->setText(temp->aadhar);
ui->account_no->setText(QString::number(temp->account));
ui->balance->setText(QString::number(temp->balance));
ui->mobile->setText(temp->phone);
ui->userInfo->show();
}
else{
QMessageBox::warning(this,"Bad credentials","Invalid account no.");
ui->userInfo->hide();
}
}
else
{
QMessageBox::warning(this,"Bad credentials","No user found");
}
}
void Admin::on_newAccount_clicked()
{
MainWindow *mainWindow = new MainWindow();
mainWindow->show();
this->hide();
}
void Admin::on_logout_clicked()
{
Login *login = new Login();
login->show();
this->hide();
}
void Admin::on_pushButton_clicked()
{
UserList *list = new UserList();
list->show();
this->hide();
}
void Admin::on_transactions_clicked()
{
Usertransactions *transaction = new Usertransactions(nullptr,user);
transaction->show();
this->hide();
}