Example #1
0
        public ActionResult ViewTicket(int id)
        {
            TicketEntity createTicket = new TicketEntity();

            createTicket = TicketsBL.SearchTicketByIdBL(id);

            ViewerProfileEntity viewer = ViewrProfilesBL.SearchViewerProfileByIdBL(createTicket.ViewersId);
            ShowEntity          show   = ShowsBL.SearchShowByIdBL(createTicket.ShowId);
            MovyEntity          movie  = MovieBL.SearchMovieByIdBL(createTicket.MovieId);
            ScreenEntity        screen = ScreenBL.SearchScreenByIdBL(show.ScreenId);


            ViewBag.ShowDate       = show.ShowDate.ToShortDateString();
            ViewBag.ShowId         = show.ShowId;
            ViewBag.ViewerId       = viewer.ViewersId;
            ViewBag.MovieName      = movie.MovieName;
            ViewBag.Price          = show.Price * createTicket.NoOfTickets;
            ViewBag.NameOfCustomer = viewer.FirstName + " " + viewer.LastName;
            ViewBag.ScreenName     = screen.ScreenName;

            ViewBag.noOfTickets = createTicket.NoOfTickets;
            ViewBag.seatNos     = createTicket.Seats;


            if (createTicket != null)
            {
                return(View());
            }
            else
            {
                return(Redirect(string.Format("/Movies/ListAllMovies")));
            }
        }
Example #2
0
 public void CargarDatos(TicketsBL ticketsBL, ClientesBL clientesBL, ViajesBL viajesBL)
 {
     _ticketsBL = ticketsBL;
     listaDeTicketsBindingSource.DataSource  = ticketsBL.ListaDeTickets;
     listadeClientesBindingSource.DataSource = clientesBL.ListadeClientes;
     listadeViajesBindingSource.DataSource   = viajesBL.ListadeViajes;
 }
Example #3
0
        //Ticket Methods of admin
        // GET: Tickets
        // GET: Tickets
        public ActionResult IndexTickets()
        {
            var fromDate = DateTime.Parse(Request.QueryString["fromDate"]);
            var toDate   = DateTime.Parse(Request.QueryString["toDate"]);
            List <TicketEntityNew> ticketList = TicketsBL.ViewAllTicketBL(fromDate, toDate);

            return(View(ticketList));
        }
Example #4
0
        public Form1()
        {
            InitializeComponent();

            _busBL      = new BusBL();
            _viajesBL   = new ViajesBL();
            _clientesBL = new ClientesBL();
            _ticketsBL  = new TicketsBL();
            _usuariosBL = new UsuariosBL();
        }
Example #5
0
        public ActionResult MyTickets()
        {
            if (Session["ViewerId"] != null)
            {
                int viewerId = Convert.ToInt32(Session["ViewerId"]);
                List <TicketEntityNew> ticketList = TicketsBL.MyTicketsDAL(viewerId);
                ;


                return(View(ticketList));
            }
            else
            {
                string url = string.Format("/Users/LogIn");
                return(Redirect(url));
            }
        }
Example #6
0
        public ActionResult CreateTicket(TicketEntity ticket)
        {
            int    nooftickets = int.Parse(Request.QueryString["noofseats"]);
            int    viewerId    = int.Parse(Request.QueryString["viewerid"]);
            int    showId      = int.Parse(Request.QueryString["showid"]);
            int    movieId     = int.Parse(Request.QueryString["movieId"]);
            string seatnos     = Request.QueryString["seatnumbers"];

            ViewerProfileEntity viewer = ViewrProfilesBL.SearchViewerProfileByIdBL(viewerId);
            ShowEntity          show   = ShowsBL.SearchShowByIdBL(showId);
            MovyEntity          movie  = MovieBL.SearchMovieByIdBL(movieId);
            ScreenEntity        screen = ScreenBL.SearchScreenByIdBL(show.ScreenId);

            TicketEntity createTicket = new TicketEntity();

            createTicket.NoOfTickets     = nooftickets;
            createTicket.ShowId          = showId;
            ViewBag.MovieName            = movie.MovieName;
            createTicket.Price           = show.Price * nooftickets;
            createTicket.ViewersId       = viewer.ViewersId;
            createTicket.TransactionDate = DateTime.Now.Date;
            createTicket.MovieId         = movie.MovieId;
            createTicket.Seats           = seatnos;

            if (ModelState.IsValid)
            {
                var IsAdded = TicketsBL.CreateTicketBL(createTicket);
                if (IsAdded)
                {
                    return(Redirect(string.Format("/Payments/CompletePayment")));
                }
                else
                {
                    return(Redirect(string.Format("/SeatLayout/SelectSeatsView")));
                }
            }
            else
            {
                return(Redirect(string.Format("/SeatLayout/SelectSeatsView")));
            }
        }
Example #7
0
        public void CargarDatos(TicketsBL ticketsBL, ClientesBL clientesBL)
        {
            var bindingSource = new BindingSource();

            bindingSource.DataSource =
                from p in ticketsBL.ListaDeTickets
                select new
            {
                Id       = p.Id,
                Fecha    = p.Fecha,
                Cliente  = clientesBL.ListadeClientes.FirstOrDefault(r => r.Id == p.ClienteId).Nombre,
                Subtotal = p.Subtotal,
                Impuesto = p.Impuesto,
                Total    = p.Total
            };

            var reporteVentas = new ReporteDeVentas();

            reporteVentas.SetDataSource(bindingSource);

            crystalReportViewer1.ReportSource = reporteVentas;
            crystalReportViewer1.RefreshReport();
        }