写进word的版本。
This commit is contained in:
@@ -24,7 +24,7 @@ const std::string ListDisplay::searchForRecordTypeToString() const {
|
||||
ListDisplay::ListDisplay(const List<BaseRecord *> &_allRecordsPtrList)
|
||||
: allRecordsPtrList(_allRecordsPtrList), fromDate(), toDate(),
|
||||
searchForStu(), searchForCourseName(""),
|
||||
searchForRecordType(StuRecord::Any), recordNumPerPage(20),
|
||||
searchForRecordType(StuRecord::Any), recordNumPerPage(10),
|
||||
currentPageIndex(0),
|
||||
maxPageIndex((allRecordsPtrList.length() - 1) / recordNumPerPage),
|
||||
sortOrder(ASCENT), sortByProp(RecordID) {
|
||||
@@ -420,8 +420,9 @@ void ListDisplay::promptForSearchStuID() {
|
||||
// std::cin.ignore();
|
||||
tempStuID = safeInputNum<int>("Please input a positive integer.\n",
|
||||
[](const int &num) { return num >= 0; });
|
||||
this->searchForStu.setNumber(tempStuID == 0 ? this->searchForStu.getNumber()
|
||||
: tempStuID);
|
||||
if (tempStuID != 0) {
|
||||
this->searchForStu.setNumber(tempStuID);
|
||||
}
|
||||
this->reapplyFilter();
|
||||
}
|
||||
|
||||
@@ -442,8 +443,9 @@ void ListDisplay::promptForSearchStuName() {
|
||||
// std::cin >> tempStuName;
|
||||
// std::cin.ignore();
|
||||
std::getline(std::cin, tempStuName);
|
||||
this->searchForStu.setName(tempStuName == "0" ? this->searchForStu.getName()
|
||||
: tempStuName);
|
||||
if (tempStuName != "0") {
|
||||
this->searchForStu.setName(tempStuName);
|
||||
}
|
||||
this->reapplyFilter();
|
||||
}
|
||||
|
||||
|
||||
@@ -934,8 +934,9 @@ void StudentInfoManager::mainloop() {
|
||||
}
|
||||
else if (cmd == infoManagerCommand::home::closeFile) {
|
||||
this->closeFile();
|
||||
this->promptForFileName();
|
||||
this->readFile();
|
||||
if (this->promptForFileName()) {
|
||||
this->readFile();
|
||||
}
|
||||
this->displayer.reapplyFilter();
|
||||
}
|
||||
else if (cmd == infoManagerCommand::home::quit) {
|
||||
|
||||
Reference in New Issue
Block a user