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#

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;
public Ticket Ticket;
public void OnGet() {
if (HttpContext.Session.GetString("authorized") != "true")
return;
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"]));
}
}
}