public ActionResult ReturnBook(string bookInfo, BooksReturnBookVM model)
        {
            LibraryManagementSystemContext context = new LibraryManagementSystemContext();
            BooksRepository booksRepository = new BooksRepository(context);

            // makes an book info array in format {Barcode No.}{Empty}{Empty}{Book title}
            string[] bookInfoSplitted = bookInfo.Split(' ', '-');

            if (string.IsNullOrEmpty(bookInfo) || bookInfoSplitted[0] == "")
            {
                ModelState.AddModelError("BookBarcodeNumber", "* barcode required");
            }
            if (!ModelState.IsValid)
            {
                model.DateReturned = DateTime.Now;
                model.Books = booksRepository.GetAll();

                return View(model);
            }

            model.BookBarcodeNumber = int.Parse(bookInfoSplitted[0]);
            Book book = booksRepository
                .GetAll(filter: b => b.Barcodes.FirstOrDefault().BarcodeNumber == model.BookBarcodeNumber)
                .FirstOrDefault();
            book.StockCount++;
            booksRepository.Save(book);

            return RedirectToAction("Index", "Books");
        }
        public ActionResult ReturnBook()
        {
            LibraryManagementSystemContext context = new LibraryManagementSystemContext();
            BooksRepository booksRepository = new BooksRepository(context);
            BooksReturnBookVM model = new BooksReturnBookVM();

            model.DateReturned = DateTime.Now.Date;
            model.Books = booksRepository.GetAll();

            return View(model);
        }