public bool checkForFine(BookItem bookitem) { BookLending lending = BookLending.FetchLendingDetails(bookitem.getBarcode()); Date dueDate = lending.dueDate; Date today = new Date(); if (today.CompareTo(dueDate) > 0) { int extradays = Date.Today() - dueDate; Fine.CollectForFine(this.getUserId(), extradays); } }
public bool Checkout(string usedId) { if (this.isReferenceOnly) { return(false); } if (!BookLending.LendBook(this.getBarcode(), usedId)) { return(false); } this.updateStatus(BookStatus.loaned); }