This repository has been archived on 2023-04-02. You can view files and clone it, but cannot push or open issues or pull requests.
trainav/bahnplan.web/Pages/Inspection.cshtml.cs

21 lines
587 B
C#
Raw Normal View History

2020-06-11 20:29:16 +02:00
using System.Linq;
using bahnplan.web.database;
using bahnplan.web.database.Tables;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace bahnplan.web.Pages {
public class InspectionModel : PageModel {
public Leg Leg;
2020-06-11 20:29:16 +02:00
public Ticket Ticket;
2020-06-11 20:29:16 +02:00
public void OnGet() {
if (HttpContext.Session.GetString("authorized") != "true")
2020-06-11 20:29:16 +02:00
return;
2020-06-11 20:29:16 +02:00
using var db = new Database.DbConn();
Ticket = db.Tickets.First(p => p.TicketId == int.Parse(Request.Query["id"]));
Leg = db.Legs.First(p => p.LegId == int.Parse(Request.Query["leg"]));
2020-06-11 20:29:16 +02:00
}
}
}