Repository navigation
Expand file tree
/
Copy pathmain.cpp
More file actions
166 lines (153 loc) · 5.4 KB
/
Copy pathmain.cpp
File metadata and controls
166 lines (153 loc) · 5.4 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
#include <iostream>
#include <map>
#include "src/lib/data_manager/data_manager.h"
#include "src/lib/view/input.h"
#include "src/lib/view/drawBoard.h"
#include "src/lib/algorithms/algorithms.h"
#include "src/lib/view/my_show.h"
#include <stack>
std::map<int, char *> anhXaLTC_MH;
std::map<std::string, std::string> anhXaMSSV_dsLTC;
PTRSV firstSV = NULL;
PTRMH treeMH = NULL;
LIST_LTC dsLTC;
PTRLH firstLH = NULL;
int main()
{
int out = 0;
int pos = 0;
treeMH = loadCourseList(fileDsMonhoc);
dsLTC = loadCreditClassList(fileDsLTC);
firstSV = loadStudentList(fileDsSinhvien);
firstLH = loadClassList(fileDsMaLop);
anhXaMSSV_dsLTC = loadMapMSSV_dsLTC(fileMapMSSV_dsLTC);
anhXaLTC_MH = loadMapMaLTC_MaMH(fileMapMaLTC_maMH);
while (true)
{
system("cls");
SetColor("WHITE");
ShowCur(0);
out = menu(30, 4, menu_chinh, 15, pos);
// pos = 13;
ShowCur(1);
if (out == 1)
{
break;
}
if (pos == 0) // cau a
{
capNhatLopTinChi_User(30, 10, dsLTC, treeMH);
}
else if (pos == 1) // cau b
{
inDanhSachSinhVienDangKy(30, 10, firstSV, dsLTC);
}
else if (pos == 2) // cau c
{
capNhatSinhVienLopHoc(30, 10, firstSV);
}
else if (pos == 3) // cau d
{
inDanhSachSinhVienTheoTen(30, 10, firstSV, firstLH);
}
else if (pos == 4) // cau e
{
capNhatDanhSachMonHoc_User(treeMH, 30, 10);
}
else if (pos == 5) // cau f
{
inDanhSachMonHocTheoTen(30, 10, treeMH);
}
else if (pos == 6) // cau g
{
dangKyLopTinChi(30, 10, dsLTC, treeMH, firstSV);
}
else if (pos == 7) // cau h
{
huyLopTinChiKhongDuDieuKien(30, 10, dsLTC);
}
else if (pos == 8) // cau i
{
nhapDiemLopTinChi(30, 10, firstSV, dsLTC);
}
else if (pos == 9) // cau j
{
inBangDiemLopTinChi(firstSV, dsLTC);
}
else if (pos == 10) // cau k
{
inBangDiemTrungBinhLopHoc(20, 10, firstSV, firstLH, treeMH, dsLTC, anhXaMSSV_dsLTC);
}
else if (pos == 11) // cau l
{
// in bang diem tong ket
ShowCur(0);
fillFinalPointBoard(10, 10, dsLTC, firstSV, treeMH, anhXaMSSV_dsLTC);
ShowCur(1);
}
else if (pos == 12) // xuat thong tin
{
int pos = 0;
int out = 0;
while (true)
{
out = menu(30, 10, show_file, 3, pos);
if (out == 1)
{
break;
}
if (pos == 0)
{ // xuat danh sach lop tin chi
fillCreditClassBoard(5, 10, dsLTC);
}
else if (pos == 1)
{ // xuat danh sach sinh vien
fillStudentInfoBoard(firstSV, 10, 10);
}
else if (pos == 2)
{ // xuat danh sach mon hoc
std::vector<PTRMH> dsMonhoc;
getListTreeNode(treeMH, dsMonhoc);
fillCourseInfoBoard(20, 10, dsMonhoc);
}
}
}
else if (pos == 13)
{ // cap nhat diem sinh vien
if (XacNhan(30, 10, "XAC NHAN CAP NHAT DIEM SINH VIEN") == "YES")
updateStudentHighestScore(dsLTC, anhXaMSSV_dsLTC, anhXaLTC_MH);
}
else if (pos == 14)
{
if (XacNhan(30, 10, "XAC NHAN LUU TIEN TRINH") == "YES")
{
xuatDanhSachSinhVien_File_Txt(firstSV, fileDsSinhvien);
xuatDanhSachMonHoc_File_Txt(treeMH, fileDsMonhoc);
xuatDanhSachLopTinChi_File_Txt(dsLTC, fileDsLTC);
saveMapMSSV_dsLTC(anhXaMSSV_dsLTC, fileMapMSSV_dsLTC);
saveMapMaLTC_MaMH(anhXaLTC_MH, fileMapMaLTC_maMH);
}
}
}
if (XacNhan(30, 10, "LUU TIEN TRINH TRUOC KHI THOAT") == "YES")
{
xuatDanhSachSinhVien_File_Txt(firstSV, fileDsSinhvien);
xuatDanhSachMonHoc_File_Txt(treeMH, fileDsMonhoc);
xuatDanhSachLopTinChi_File_Txt(dsLTC, fileDsLTC);
saveMapMSSV_dsLTC(anhXaMSSV_dsLTC, fileMapMSSV_dsLTC);
saveMapMaLTC_MaMH(anhXaLTC_MH, fileMapMaLTC_maMH);
}
return 0;
}
/*
DANH SACH SINH VIEN DANG KY
Nien khoa: 2020 _ Hoc ky: 2 _ Nhom: 2 _ Ma mon hoc: MH54
Co 20 sinh vien trong danh sach
x x1 x2 x3 x4 x5 x6
+=========+==============+==================+=============+===========+==============+===============+
| STT | MSSV | HO | TEN | GIOI TINH | MA LOP | SO DIEN THOAI |
y1 +=========+==============+==================+=============+===========+==============+===============+
| | | | | | | |
| | | | | | | |
+=========+==============+==================+=============+===========+==============+===============+
*/