📄 cfind.cpp
字号:
#include "stdafx.h"
#include "Date.h"
#include "Linklist.h"
#include "CManageBooks.h"
#include "Books.h"
#include <iomanip>
#include <string>
#include <iostream>
#include "CFind.h"
extern CManageBooks * pBase;
void CFind::OnFindID()
{
string id;
cout<<"请输入书籍的编号:";
cin>>id;
Books *p=LinkPtr->SearchByID(id);
if(p!=NULL)
{
cout<<*p;
}
}
void CFind::OnFindAuthor()
{
string author;
cout<<"请输入作者名:";
cin>>author;
Books *p=LinkPtr->SearchByAuthor(author);
if(p)
{
cout<<*p;
}
}
void CFind::OnFindBookName()
{
string bookname;
cout<<"请输入书名:";
cin>>bookname;
Books *p=LinkPtr->SearchByBookName(bookname);
if(p)
{
cout<<*p;
}
}
void CFind::ShowMenu()
{
cout<<endl;
cout<<"*************************查找*************************\n";
cout<<"1 按编号查找\t2 按书名查找\t3 按作者查找\t0 退出\n";
cout<<"******************************************************\n";
}
void CFind::DoEvent(int ID)
{
switch(ID)
{
case 1:
OnFindID();
break;
case 2:
OnFindBookName();
break;
case 3:
OnFindAuthor();
break;
case 0:
cout<<"退出查找菜单\n";
pBase=parent;
delete this;
break;
default:
OnInvalidateInput("输入,,,");
break;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -