Ejemplo n.º 1
0
        public ActionResult Checkout(BTViewModel t)
        {
            if (!ModelState.IsValid)
            {
                return(View("~/Views/Ticket/GetBookingDetails.cshtml", t));
            }
            else
            {
                var t2 = new CheckoutViewModel()
                {
                    BookingName = t.BookingName,
                    Children    = t.Children,
                    Class       = t.Class,
                    Email       = t.Email,
                    FID         = t.FID,
                    RFID        = t.RFID,
                    Phone       = t.Phone,
                    Quantity    = t.Quantity,
                    Tickets     = t.Tickets,
                    Total_Price = t.Total_Price
                };

                Flights retf;
                Flights depf = db.Flights.Where(x => x.FlightID == t.FID).FirstOrDefault();
                if (t.RFID != null)
                {
                    retf = db.Flights.Where(x => x.FlightID == t.RFID).FirstOrDefault();
                    ViewBag.RetFlight = retf;
                }

                ViewBag.DepFlight = depf;

                return(View(t2));
            }
        }
Ejemplo n.º 2
0
        public ActionResult GetBookingDetails(int?goID, int?returnID, int persons, int children, decimal totalPrice, string classType, decimal goPricePP, decimal returnPricePP)
        {
            if (!goID.HasValue && returnID.HasValue)
            {
                goID     = returnID;
                returnID = null;
            }
            //We create a demo booking
            var BookTicketInfo = new BTViewModel()
            {
                FID         = (int)goID,
                RFID        = returnID,
                Total_Price = totalPrice,
                Quantity    = persons,
                Children    = children,
                Class       = classType,
            };

            return(View(BookTicketInfo));
        }