|
|
|
@ -0,0 +1,47 @@
|
|
|
|
|
#include "Book.h"
|
|
|
|
|
|
|
|
|
|
Book::Book(string bookname, Date data, bool bookislead, int times)
|
|
|
|
|
{
|
|
|
|
|
this->BookName = bookname;
|
|
|
|
|
this->Data = data;
|
|
|
|
|
this->BookIsLend = bookislead;
|
|
|
|
|
this->Times = times;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Book::ShowInfo()
|
|
|
|
|
{
|
|
|
|
|
cout << "<<" << this->BookName << ">>" << endl;
|
|
|
|
|
if (!this->BookIsLend) {
|
|
|
|
|
cout << "状态:" << "在库" << endl;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
cout << "状态:" << "借出" << endl;//借出图书输出借出时间
|
|
|
|
|
cout << "借出时间:" << this->Data.ShowDate() << endl;
|
|
|
|
|
}
|
|
|
|
|
cout << "借出次数:" << this->Times << endl;
|
|
|
|
|
cout << endl;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Book::Show_LoanTime()
|
|
|
|
|
{
|
|
|
|
|
cout << "借出时间:" << this->Data.ShowDate() << endl;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Book::inTurnout()//在借出操作中使用_pstu1替换后,不需要再使用这个函数
|
|
|
|
|
{
|
|
|
|
|
if (this->BookIsLend == false) {
|
|
|
|
|
this->BookIsLend = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Book::outTurnin()
|
|
|
|
|
{
|
|
|
|
|
if (this->BookIsLend == true) {
|
|
|
|
|
this->BookIsLend = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Book::addTimes()
|
|
|
|
|
{
|
|
|
|
|
this->Times += 1;
|
|
|
|
|
}
|