Exemplo n.º 1
0
 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"));
 }
Exemplo n.º 2
0
        /**************************************************
         * 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"));
        }
Exemplo n.º 3
0
        //Taking the Method from  the Borrow Controller


        public void ReturnBookByID(string bookID)
        {
            BorrowController.ReturnBorrowByID(bookID);
        }