public IActionResult Extend(string bookID) { try { BorrowController.ExtendDueDateForBorrowByID(bookID); ViewBag.Message = $"Extension Successfull{bookID}"; } catch (ValidationException e) { ViewBag.Message = "There is a problem with the Extension."; ViewBag.Exception = e; ViewBag.Error = true; } return(View("Details")); }
/************************************************** * Citation: Used class Tutorial for Validation * ***********************************************/ public IActionResult BorrowCreate(string bookID, string checkedOutDate, string returnedDate) { if (Request.Query.Count > 0) { try { BorrowController.CreateBorrow(bookID); ViewBag.Message = $"Borrow Successful for Book {bookID}"; } catch (ValidationException e) { ViewBag.CheckedOutDate = checkedOutDate; ViewBag.ReturnedDate = returnedDate; ViewBag.Message = "There is a problem with the Submission."; ViewBag.Exception = e; ViewBag.Error = true; } } return(View("Details")); }
//Taking the Method from the Borrow Controller public void ReturnBookByID(string bookID) { BorrowController.ReturnBorrowByID(bookID); }