Example #1
0
        public ActionResult RentDetails(int idr)
        {
            RentDb dbRent = new RentDb();

            ModelState.Clear();
            return(View(dbRent.GetRentDetails(idr)));
        }
Example #2
0
        /// <summary>
        /// Display a PDF with the information of the customer
        /// and the products for one rent selected.
        /// The PDF is open in a new tab from the rents page.
        /// Rotativa is a package to help displaying PDF.
        /// </summary>
        /// <param name="idR"></param>
        /// <returns></returns>
        public ActionResult DownloadBill(int idR)
        {
            RentDb dbProducts = new RentDb();

            ModelState.Clear();
            BillViewModel model = dbProducts.GetRentDetails(idR);

            return(new Rotativa.ViewAsPdf("ViewPDF", model));
        }