Beispiel #1
0
        public IActionResult ReturnLending(Lending model)
        {
            if (ModelState.IsValid)
            {
                model = lendingService.ReturnLentBook(model);
                lendingService.Commit();
                TempData["Message"] = "Book returned!";

                return(RedirectToAction("Details", "Client", new { id = model.ClientId }));
            }

            return(View(model));
        }
Beispiel #2
0
        public IActionResult OnPost()
        {
            if (ModelState.IsValid)
            {
                Lending = lendingService.ReturnLentBook(Lending);
                lendingService.Commit();
                TempData["Message"] = "Book returned!";


                return(RedirectToPage("/Clients/ClientDetails", new { id = Lending.ClientId }));
            }

            return(Page());
        }