loginController.setErrorMessage("Please login to make a loan.");
}else {
DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss");
Date date = new Date();
String currentDate = dateFormat.format(date);
Loan loan = new Loan();
loan.setPatron(patron);
loan.setBook(book);
loan.setLoanDate(currentDate);
loan.setDueDate(currentDate);
loan.setStatus("In Progress...");
book.getLoans().add(loan);
book.setAvailability(false);
loginController.getPatronLoans().add(loan);
//bookService.addLoan(loan);
bookService.addBook(book);