Exemplo n.º 1
0
        public ActionResult SelectMovie(int id)
        {
            var dvdsList = _oops.ReturnDvdsFromDbForMovieId(id);

            var viewMovieDVDsVM = new ViewMovieDVDsVM();
            viewMovieDVDsVM.DVDs = dvdsList;

            return View(viewMovieDVDsVM);
        }
Exemplo n.º 2
0
        //Rent DVD from DVDs Statuses Page with drop down user
        public ActionResult RentDVD(ViewMovieDVDsVM vM)
        {
            //Library method to rent DVD based on DVDID and BorrowerID
            var rentalTicket = new RentalTicket();
            rentalTicket.BorrowerId = vM.Borrower.BorrowerId;
            rentalTicket.DVDId = vM.DVDIdToRent;
            rentalTicket.DateBorrowed = DateTime.Now.Date;
            rentalTicket.MovieId = vM.MovieId;

            var newRentalTicket = _oops.RentDVD(rentalTicket);

            return RedirectToAction("ViewDVDsStatus", "Home", new {id = newRentalTicket.MovieId});
        }
Exemplo n.º 3
0
        //Grab all DVD statuses based on MovieID
        public ActionResult ViewDVDsStatus(int id)
        {
            var vM = new ViewMovieDVDsVM();

            //lighter weight return
            vM.DVDs = _oops.ReturnPartialDVDsInfo(id);

            return View(vM);
        }