-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathAdmin.cpp
119 lines (115 loc) · 3.38 KB
/
Admin.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
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
#include "Admin.h"
void DangNhap_Admin( QuanLyPhim& QLP, QuanLyNhanVien& QLNV,vector<Customer>& CTM, QLPhongChieu& QLPC, QuanLyLichChieu& QLLC, QuanLyVe& QLV, int& SoKhach){
system("cls");
string taikhoan,mk;
system("cls");
GoTo(70,5);
cout << "Nhap Tai Khoan: ";cin >> taikhoan;
GoTo(70,7);
cout << "Nhap Mat Khau: "; cin >> mk;
int index = QLNV.TimTaiKhoan(taikhoan,mk);
if(taikhoan == "0"){
DangNhap_Admin(QLP, QLNV,CTM, QLPC, QLLC, QLV, SoKhach);
}
if(index == -1){
system("cls");
DangNhap_Admin(QLP, QLNV,CTM, QLPC, QLLC, QLV, SoKhach);
SetColor(0,4);
CanLe();
cout << "Tai Khoan Hoac Mat Khau Khong Dung!";
getch();
}
else{
if(QLNV[index].getChucVu() == "Nhan Vien Quan Ly Ve"){
Admin_Ve(QLV);
}
else if(QLNV[index].getChucVu() == "Nhan Vien Quan Ly Phim"){
Admin_Phim(QLP);
}
else if(QLNV[index].getChucVu() == "Nhan Vien Quan Ly Phong Chieu"){
Admin_PhongChieu(QLPC);
}
else if(QLNV[index].getChucVu() == "Nhan Vien Quan Ly Khach"){
Admin_Khach(CTM,SoKhach);
}
else if(QLNV[index].getChucVu() == "Quan Ly Nhan Vien"){
Admin(QLP, QLNV,CTM, QLPC, QLLC, QLV, SoKhach);
}
else{
SetColor(0,4);
cout << "Ban Chua Duoc Phan Quyen" << endl;
DangNhap_Admin(QLP, QLNV,CTM, QLPC, QLLC, QLV, SoKhach);
}
}
}
void Admin( QuanLyPhim& QLP, QuanLyNhanVien& QLNV,vector<Customer>& CTM, QLPhongChieu& QLPC, QuanLyLichChieu& QLLC, QuanLyVe& QLV, int& SoKhach){
DocFile(QLNV, QLP, QLLC, QLPC, QLV, CTM, SoKhach);
system("cls");
SetColor(0,6);
GoTo(78,11); cout << "UNG DUNG QUAN LY RAP PHIM\n\n\n";
vector<string> m={
"1.Quan Ly Phim" ,
"2.Quan Ly Lich Chieu" ,
"3.Quan Ly Ve" ,
"4.Quan Ly Nhan Vien" ,
"5.Quan Ly Nguoi Dung" ,
"6.Quan Ly Phong Chieu" ,
"7.Thoat"};
int chon=menu(m);
switch (chon)
{
case 1:
QLP.Menu();
UpdateFile_Phim(QLP);
Admin(QLP, QLNV,CTM, QLPC, QLLC, QLV, SoKhach);
break;
case 2:
QLLC.Menu();
UpdateFile_LichChieu(QLLC);
Admin(QLP, QLNV,CTM, QLPC, QLLC, QLV, SoKhach);
break;
case 3:
QLV.Menu();
UpdateFile_Ve(QLV);
Admin(QLP, QLNV,CTM, QLPC, QLLC, QLV, SoKhach);
break;
case 4:
QLNV.Menu();
UpdateFile_NV(QLNV);
Admin(QLP, QLNV,CTM, QLPC, QLLC, QLV, SoKhach);
break;
case 5:
Menu_Khach(CTM, SoKhach);
UpdateFile_Khach(CTM,SoKhach);
Admin(QLP, QLNV,CTM, QLPC, QLLC, QLV, SoKhach);
break;
case 6:
QLPC.Menu();
UpdateFile_PC(QLPC);
Admin(QLP, QLNV,CTM, QLPC, QLLC, QLV, SoKhach);
break;
default:
break;
}
Update(QLNV, QLP, QLLC, QLPC, QLV, CTM, SoKhach);
}
void Admin_Phim(QuanLyPhim& QLP){
QLP.Menu();
UpdateFile_Phim(QLP);
}
void Admin_PhongChieu(QLPhongChieu& QLPC){
QLPC.Menu();
UpdateFile_PC(QLPC);
}
void Admin_LichChieu(QuanLyLichChieu& QLLC){
QLLC.Menu();
UpdateFile_LichChieu(QLLC);
}
void Admin_Ve(QuanLyVe& QLV){
QLV.Menu();
UpdateFile_Ve(QLV);
}
void Admin_Khach(vector<Customer>& CTM, int& SoKhach){
Menu_Khach(CTM, SoKhach);
UpdateFile_Khach(CTM,SoKhach);
}