Beispiel #1
0
        public ActionResult ViewSeat(int?dateWiseTripId)
        {
            //var temp = new List<int>() { 5, 10, 25 };
            ViewBag.Fare = dateWiseTripService.GetById(dateWiseTripId).Fare;
            var BookingTickets = bookingTicketService.GetAll().Where(m => m.DateWiseTripId == dateWiseTripId && m.IsBooked != true && m.IsTempLocked != true && m.IsDeleted == false).Select(m => m.SeatName).ToList();

            ViewBag.SeatNoList     = seatBaseService.GetAll().Where(m => BookingTickets.Contains(m.SeatName)).Select(m => m.Id).ToList();
            ViewBag.SeatNameList   = seatBaseService.GetAll().Select(m => m.SeatName).ToList();
            ViewBag.DateWiseTripId = dateWiseTripId;
            //ViewBag.SeatList = temp;
            return(View());
        }
Beispiel #2
0
        public ActionResult ShowTicketInfo(String seatList, int totalFare, int dateWiseTripId)
        {
            var seatNameList   = seatList.Split(',').ToList();
            var bookingTickets = bookingTicketService.GetAll().Where(m => m.DateWiseTripId == dateWiseTripId && seatNameList.Contains(m.SeatName)).ToList();

            //string[] arr1 = new string[] { "A", "B", "C" };
            foreach (var item in bookingTickets)
            {
                item.IsTempLocked = true;
                bookingTicketService.Update(item);
            }
            ViewBag.booking = bookingTickets;
            Ticket ticket = new Ticket()
            {
                Seats     = seatList,
                TotalFare = totalFare,
                TicketPIN = ticketService.RandomNumber().ToString(),
                //Bookings = bookingTickets,
            };

            TempData["DateWise"] = dateWiseTripId;
            return(View(ticket));
        }