public IActionResult OnPost(int ID)
        {
            var UserName    = HttpContext.Session.GetString("UserName");
            var MovieRecord = movieRepository.GetMovieById(ID);

            if (string.IsNullOrEmpty(UserName))
            {
                return(RedirectToPage("/SignIn"));
            }
            var newRecord = new Record()
            {
                User       = movieRepository.GetUserByName(UserName),
                Movie      = MovieRecord,
                LendDate   = DateTime.Now,
                ReturnDate = DateTime.Now.AddDays(7),
                Status     = "Not Returned"
            };

            movieRepository.AddRecord(newRecord);
            movieRepository.Commit();
            return(RedirectToPage("/Movies/Index"));
        }