public bool BorrowBook(Reader reader, ReaderType readerType, Book book, Reader OperatorUser) { if (reader == null || readerType == null || book == null || OperatorUser == null) { return(false); } if (reader.rdStatus != "有效" || (readerType.CanLendQty - reader.rdBorrowQty) <= 0) { return(false); } if (book.bkStatus != "在馆") { return(false); } reader.rdBorrowQty++; readerDAL.Update(reader); book.bkStatus = "借出"; bookDAL.Update(book); Borrow borrow = new Borrow(); borrow.rdID = reader.rdID; borrow.bkID = book.bkID; borrow.ldContinueTimes = 0; borrow.ldDateOut = DateTime.Now; borrow.ldDateRetPlan = DateTime.Now.AddDays(readerType.CanLendDay); borrow.lsHasReturn = false; borrow.OperatorLend = OperatorUser.rdName; borrowDAL.Add(borrow); return(true); }
public int Update(Reader reader) { return(readerDAL.Update(reader)); }