-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathborrowingInformationQqueryMenu.cpp
More file actions
140 lines (132 loc) · 3.16 KB
/
borrowingInformationQqueryMenu.cpp
File metadata and controls
140 lines (132 loc) · 3.16 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
#include "borrowingInformationQqueryMenu.h"
/// <summary>
/// 3.借阅信息查询菜单
/// </summary>
/// <param name="Books"></param>
/// <param name="Borrowers"></param>
void borrowingInformationQquery_Menu(vector<Person>& Borrowers, vector<Book>& Books)
{
int nSortChoose;
while (1)
{
system("CLS");
printf("\t\t----------------------------------\n");
printf("\t\t|********借阅信息查询模块********|\n");
printf("\t\t| |\n");
printf("\t\t| 1.所有图书借阅情况 |\n");
printf("\t\t| |\n");
printf("\t\t| 2.所有人员借阅情况 |\n");
printf("\t\t| |\n");
printf("\t\t| 3.单书借阅信息查询 |\n");
printf("\t\t| |\n");
printf("\t\t| 4.单人借阅信息查询 |\n");
printf("\t\t| |\n");
printf("\t\t| 0.返回上级菜单 |\n");
printf("\t\t| |\n");
printf("\t\t----------------------------------\n");
printf("\t\t 请选择功能序号(0~4):");
//读入用户选择
//scanf("%d", &nSortChoose);
cin >> nSortChoose;
system("CLS");
switch (nSortChoose)
{
case 1:
//3.1 所有图书借阅情况
allBooksInformation(Books);
system("PAUSE");
break;
case 2:
//3.2 所有人员借阅情况
allPersonsInformation(Borrowers, Books);
system("PAUSE");
break;
case 3:
//3.3 单书借阅信息查询
singleBookInformation(Books);
system("PAUSE");
break;
case 4:
//3.4 单人借阅信息查询
singlePersonInformation(Borrowers, Books);
system("PAUSE");
break;
case 0:
return;
break;
default:printf("\t\t选择有误,请重选!\n");
}//switch结束
}//while(1)结束
}
/// <summary>
/// 3.1 所有图书借阅情况
/// </summary>
/// <param name="Books"></param>
void allBooksInformation(vector<Book>& Books)
{
cout << "当前书籍的信息" << endl;
//测试展示函数
display_book_title();
for (Book temp_book : Books)
{
temp_book.display();
}
}
/// <summary>
/// 3.2 所有人员借阅情况
/// </summary>
/// <param name="Borrowers"></param>
void allPersonsInformation(vector<Person>& Borrowers, vector<Book>& Books)
{
cout << "当前书籍的信息" << endl;
//测试展示函数
display_person_title();
for (Person temp_person : Borrowers)
{
temp_person.display();
temp_person.display_all_books(Books);
}
}
/// <summary>
/// 3.3 单人借阅信息查询
/// </summary>
/// <param name="Books"></param>
void singleBookInformation(vector<Book>& Books)
{
int temp_ID;
cout << "请输入书籍ID:";
cin >> temp_ID;
for (Book temp_Book : Books)
{
if (temp_Book.searchBookID(temp_ID))
{
display_book_title();
temp_Book.display();
return;
break;
}
}
cout << "没有找到此书" << endl;
}
/// <summary>
/// 3.4 单人借阅信息查询
/// </summary>
/// <param name="Borrowers"></param>
void singlePersonInformation(vector<Person>& Borrowers, vector<Book>& Books)
{
int temp_ID;
cout << "请输入人员ID:";
cin >> temp_ID;
for (Person temp_Borrower : Borrowers)
{
if (temp_Borrower.searchPersonID(temp_ID))
{
display_person_title();
temp_Borrower.display();
temp_Borrower.display_all_books(Books);
return;
break;
}
}
cout << "没有找到此人" << endl;
}