Ejemplo n.º 1
0
        public IActionResult Buy(int id)
        {
            UserAccounts u = Autentification.GetLoggedUser(HttpContext);

            if (u == null)
            {
                return(RedirectToAction("Index", "Autentification"));
            }

            else
            {
                Tickets ticket = new Tickets();
                ticket.TicketTypeId = id;

                TicketTypes type = tickettypeRepository.GetType(id);

                ticket.Date     = DateTime.Now;
                ticket.Quantity = 1;
                ticket.Seen     = false;
                ticket.Active   = false;
                ticket.Code     = "";
                ticket.ClientId = clientRepository.GetClientByUserId(u.Id).Id;
                ticket.Quantity = 1;
                ticket.Total    = type.Price;

                ViewData["type"]  = type.Type;
                ViewData["total"] = ticket.Total * 100;


                return(View("Buy", ticket));
            }
        }
Ejemplo n.º 2
0
        public IActionResult GetType(int id)
        {
            TicketTypes model = tickettypeRepository.GetType(id);

            return(View("Edit", model));
        }