@page
@using bahnplan.web.database
@using Microsoft.AspNetCore.Http
@model InspectionModel
@{
ViewData["Title"] = "Inspection";
if (HttpContext.Session.GetString("authorized") != "true") {
Response.Redirect("/");
return;
}
}
Ticket for @Model.Leg.TrainType @Model.Leg.TrainNr from @Model.Leg.DepStation to @Model.Leg.ArrStation, starting @DateTime.Parse(Model.Leg.DepTime).ToString("yyyy-MM-dd HH:mm")
@Model.Ticket.TicketInfo
@if (Model.Ticket.TicketInfo.Contains("BC 50")) {
await using var db = new Database.DbConn();
if (db.Cards.Any(p => p.Value == 50 && p.Traveller == Model.Ticket.Traveller)) {
var card = db.Cards.First(p => p.Value == 50 && p.Traveller == Model.Ticket.Traveller);
}
else {
I would show your BahnCard but you haven't added a card matching the value and name of the ticket yet.
You can do that now.
}
}
else if (Model.Ticket.TicketInfo.Contains("BC 25")) {
await using var db = new Database.DbConn();
if (db.Cards.Any(p => p.Value == 25 && p.Traveller == Model.Ticket.Traveller)) {
var card = db.Cards.First(p => p.Value == 25 && p.Traveller == Model.Ticket.Traveller);
}
else {
I would show your BahnCard but you haven't added a card matching the value and name of the ticket yet.
You can do that now.
}
}