示例#1
0
        public async Task <IActionResult> OnGet()
        {
            var userId = HttpContext.Session.GetInt32("UserId");

            if (userId == null)
            {
                return(new RedirectToPageResult("Login"));
            }

            var ticketController = new TicketController(_configRoot);
            var tickets          = await ticketController.GetTicketsByWorkerId((int)userId);

            ViewData["Tickets"] = tickets;

            return(Page());
        }