写进word的版本。

This commit is contained in:
unlockable
2023-06-25 23:00:40 +08:00
parent c81338a152
commit f0ce327f6c
2 changed files with 10 additions and 7 deletions

View File

@@ -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();
}

View File

@@ -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) {