Ejemplo n.º 1
0
        //[OutputCache(Duration = 3600, VaryByParam = "arrive,depart,room_select")]
        public ActionResult PrintLandingForGuestCheckinFuture(int?id, DateTime?arrive, DateTime?depart, int?room_select)
        {
            var model = new RoomBookingViewModel {
                GuestId = id.Value
            };
            var newGuest  = _guestService.GetById(id.Value);
            var path      = Path.Combine(Server.MapPath("~/Products/Receipt/"));
            var imagePath = Path.Combine(Server.MapPath("~/images/Receipt"), "ReceiptLogo.jpg");

            model.FilePath = PDFReceiptPrinter.PrintInvoiceCheckingFuture(path, newGuest, imagePath);
            return(View(model));
        }
Ejemplo n.º 2
0
        //[OutputCache(Duration = 3600, VaryByParam = "id")]
        public ActionResult PrintGuestAccount(int?id, bool checkout = false, bool?email = false)
        {
            var guest = _guestService.GetById(id.Value);

            var allItemisedItems = guest.SoldItemsAlls.Where(x => x.PaymentMethodId == (int)PaymentMethodEnum.POSTBILL).OrderByDescending(x => x.DateSold).ToList();

            var gravm = new GuestRoomAccountViewModel
            {
                Guest            = guest,
                RoomId           = 0,
                PaymentTypeId    = 0,
                Rooms            = guest.GuestRooms.Select(x => x.Room).ToList(),
                GuestRoomAccount = new GuestRoomAccount {
                    Amount = decimal.Zero
                },
                ItemmisedItems = allItemisedItems
            };

            gravm = PopulateModel(gravm, guest, checkout, false);

            gravm.DisplayList = GetDisplayList(gravm);

            string url = string.Format("{0}://{1}{2}", Request.Url.Scheme, Request.Url.Authority, Url.Content("~"));

            gravm.ImageUrl = url + "images/" + "LakehouseLogoNEW4.png";

            var path1 = Path.Combine(Server.MapPath("~/Products/Receipt/"));

            gravm.ImageUrl = Path.Combine(Server.MapPath("~/images/Receipt"), "ReceiptLogo.jpg");

            var filename = PDFReceiptPrinter.PrintInvoiceCheckout(path1, gravm, gravm.ImageUrl);

            var path = Path.Combine(Server.MapPath("~/Products/Receipt/"), filename + ".pdf");

            if (email.HasValue && email.Value)
            {
                EmailAttachmentToGuest(guest, path);
            }

            var fileNameNew = filename + "_" + "Receipt.pdf";

            return(File(path, "application/ms-excel", fileNameNew));
        }