Code cleanup
This commit is contained in:
parent
ec16ec5def
commit
6ab3774228
|
@ -1,11 +1,12 @@
|
|||
using System.Diagnostics.CodeAnalysis;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace trainav.web.Controllers {
|
||||
namespace trainav.web.Controllers;
|
||||
|
||||
[ApiController, Route("api/[controller]")]
|
||||
public class TestController : ControllerBase {
|
||||
[HttpGet]
|
||||
public ApiResponse Get() => new ApiResponse("test", 4);
|
||||
public ApiResponse Get() => new("test", 4);
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "UnusedAutoPropertyAccessor.Global")]
|
||||
|
@ -18,4 +19,3 @@ namespace trainav.web.Controllers {
|
|||
public string String1 { get; }
|
||||
public int Int1 { get; }
|
||||
}
|
||||
}
|
|
@ -6,7 +6,8 @@ using LinqToDB.Data;
|
|||
using trainav.web.database;
|
||||
using trainav.web.database.Tables;
|
||||
|
||||
namespace trainav.web {
|
||||
namespace trainav.web;
|
||||
|
||||
public static class Migrations {
|
||||
private const int DbVer = 1;
|
||||
|
||||
|
@ -102,4 +103,3 @@ namespace trainav.web {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,8 @@ using trainav.web.database.Tables;
|
|||
using trainav.web.JSON.CardResponse;
|
||||
using trainav.web.JSON.ListOrdersResponse;
|
||||
|
||||
namespace trainav.web.Pages {
|
||||
namespace trainav.web.Pages;
|
||||
|
||||
public class CardModel : PageModel {
|
||||
public void OnPost() {
|
||||
if (HttpContext.Session.GetString("authorized") != "true")
|
||||
|
@ -19,11 +20,9 @@ namespace trainav.web.Pages {
|
|||
|
||||
using var db = new Database.DbConn();
|
||||
var request = new XDocument(new XElement("rqorderheadlist",
|
||||
new XElement("rqheader", new XAttribute("ts", "2020-02-19T15:59:00"), new XAttribute("l", "de"),
|
||||
new XAttribute("v", "19120000"), new XAttribute("d", "iPad7,5"),
|
||||
new XAttribute("os", "iOS_13.3.1"), new XAttribute("app", "NAVIGATOR")),
|
||||
new XElement("authlogin", new XAttribute("user", Request.Form["user"]),
|
||||
new XAttribute("pw", Request.Form["pass"]),
|
||||
new XElement("rqheader", new XAttribute("ts", "2020-02-19T15:59:00"), new XAttribute("l", "de"), new XAttribute("v", "19120000"),
|
||||
new XAttribute("d", "iPad7,5"), new XAttribute("os", "iOS_13.3.1"), new XAttribute("app", "NAVIGATOR")),
|
||||
new XElement("authlogin", new XAttribute("user", Request.Form["user"]), new XAttribute("pw", Request.Form["pass"]),
|
||||
new XElement("sso", new XAttribute("genToken", "FALSE"))),
|
||||
new XElement("criteria", new XAttribute("validonly", "0")))).ToString();
|
||||
var response = new WebClient().UploadString("https://fahrkarten.bahn.de/mobile/dbc/xs.go", "POST", request);
|
||||
|
@ -34,11 +33,10 @@ namespace trainav.web.Pages {
|
|||
|
||||
foreach (var order in parsed.Rporderheadlist.Orderheadlist.Orderhead.Where(order => order.On.StartsWith("EBC_"))) {
|
||||
request = new XDocument(new XElement("rqorderdetails", new XAttribute("version", "1.0"),
|
||||
new XElement("rqheader", new XAttribute("ts", "2019-10-31T23:20:48"), new XAttribute("l", "de"),
|
||||
new XAttribute("v", "19100000"), new XAttribute("d", "iPad7,5"),
|
||||
new XAttribute("os", "iOS_13.1.3"), new XAttribute("app", "NAVIGATOR")),
|
||||
new XElement("rqorder", new XAttribute("on", order.On)),
|
||||
new XElement("authname", new XAttribute("tln", Request.Form["name"])))).ToString();
|
||||
new XElement("rqheader", new XAttribute("ts", "2019-10-31T23:20:48"), new XAttribute("l", "de"), new XAttribute("v", "19100000"),
|
||||
new XAttribute("d", "iPad7,5"), new XAttribute("os", "iOS_13.1.3"), new XAttribute("app", "NAVIGATOR")),
|
||||
new XElement("rqorder", new XAttribute("on", order.On)), new XElement("authname", new XAttribute("tln", Request.Form["name"]))))
|
||||
.ToString();
|
||||
|
||||
response = new WebClient().UploadString("https://fahrkarten.bahn.de/mobile/dbc/xs.go", "POST", request);
|
||||
xmlobj = new XmlDocument();
|
||||
|
@ -65,4 +63,3 @@ namespace trainav.web.Pages {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -11,7 +11,8 @@ using trainav.web.database;
|
|||
using trainav.web.database.Tables;
|
||||
using trainav.web.JSON.CardResponse;
|
||||
|
||||
namespace trainav.web.Pages {
|
||||
namespace trainav.web.Pages;
|
||||
|
||||
public class CardsModel : PageModel {
|
||||
public List<Card> Cards;
|
||||
|
||||
|
@ -28,9 +29,8 @@ namespace trainav.web.Pages {
|
|||
|
||||
var request = new XDocument(new XElement("rqorderdetails", new XAttribute("version", "1.0"),
|
||||
new XElement("rqheader", new XAttribute("ts", "2019-10-31T23:20:48"), new XAttribute("l", "de"),
|
||||
new XAttribute("v", "19100000"), new XAttribute("d", "iPad7,5"),
|
||||
new XAttribute("os", "iOS_13.1.3"), new XAttribute("app", "NAVIGATOR")),
|
||||
new XElement("rqorder", new XAttribute("on", card.OrderId)),
|
||||
new XAttribute("v", "19100000"), new XAttribute("d", "iPad7,5"), new XAttribute("os", "iOS_13.1.3"),
|
||||
new XAttribute("app", "NAVIGATOR")), new XElement("rqorder", new XAttribute("on", card.OrderId)),
|
||||
new XElement("authname", new XAttribute("tln", card.Traveller.Split(" ").Last())))).ToString();
|
||||
|
||||
var response = new WebClient().UploadString("https://fahrkarten.bahn.de/mobile/dbc/xs.go", "POST", request);
|
||||
|
@ -52,4 +52,3 @@ namespace trainav.web.Pages {
|
|||
Cards = db.Cards.Where(p => p.UserId == int.Parse(HttpContext.Session.GetString("uid"))).ToList();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -5,7 +5,8 @@ using Microsoft.AspNetCore.Mvc.RazorPages;
|
|||
using trainav.web.database;
|
||||
using trainav.web.database.Tables;
|
||||
|
||||
namespace trainav.web.Pages {
|
||||
namespace trainav.web.Pages;
|
||||
|
||||
public class DeleteModel : PageModel {
|
||||
public User AuthorizedUser;
|
||||
|
||||
|
@ -48,19 +49,16 @@ namespace trainav.web.Pages {
|
|||
db.Delete(db.Legs.Where(p => p.TripId == tripid).OrderByDescending(p => p.DepTime).First());
|
||||
|
||||
var failsafe = false;
|
||||
foreach (var failsafeleg in db.Legs.Where(p => p.TripId == tripid).OrderBy(p => p.DepTime).ToList()) {
|
||||
foreach (var failsafeleg in db.Legs.Where(p => p.TripId == tripid).OrderBy(p => p.DepTime).ToList())
|
||||
if (failsafeleg.DepTime.EndsWith("placeholder")) {
|
||||
if (failsafe == false) {
|
||||
if (failsafe == false)
|
||||
failsafe = true;
|
||||
}
|
||||
else {
|
||||
else
|
||||
db.Legs.Delete(p => p.LegId == failsafeleg.LegId);
|
||||
}
|
||||
}
|
||||
else {
|
||||
failsafe = false;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
@ -83,4 +81,3 @@ namespace trainav.web.Pages {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -3,7 +3,8 @@ using Microsoft.AspNetCore.Mvc;
|
|||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace trainav.web.Pages {
|
||||
namespace trainav.web.Pages;
|
||||
|
||||
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
|
||||
public class ErrorModel : PageModel {
|
||||
private readonly ILogger<ErrorModel> _logger;
|
||||
|
@ -18,4 +19,3 @@ namespace trainav.web.Pages {
|
|||
RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -14,7 +14,8 @@ using trainav.web.database;
|
|||
using trainav.web.database.Tables;
|
||||
using Calendar = Ical.Net.Calendar;
|
||||
|
||||
namespace trainav.web.Pages {
|
||||
namespace trainav.web.Pages;
|
||||
|
||||
public class GenIcs : PageModel {
|
||||
public string IcsOutput;
|
||||
public List<Leg> Legs;
|
||||
|
@ -47,28 +48,20 @@ namespace trainav.web.Pages {
|
|||
|
||||
var calendar = new Calendar();
|
||||
foreach (var leg in Legs.Where(p => p.TrainType != "placeholder")) {
|
||||
var depst = ds100Mapping.Where(p => p.Station == leg.DepStation)
|
||||
.DefaultIfEmpty(new Ds100object {Station = leg.DepStation, Ds100 = leg.DepStation})
|
||||
.First()
|
||||
.Ds100;
|
||||
var arrst = ds100Mapping.Where(p => p.Station == leg.ArrStation)
|
||||
.DefaultIfEmpty(new Ds100object {Station = leg.ArrStation, Ds100 = leg.ArrStation})
|
||||
.First()
|
||||
.Ds100;
|
||||
var depst = ds100Mapping.Where(p => p.Station == leg.DepStation).DefaultIfEmpty(new Ds100object { Station = leg.DepStation, Ds100 = leg.DepStation }).First().Ds100;
|
||||
var arrst = ds100Mapping.Where(p => p.Station == leg.ArrStation).DefaultIfEmpty(new Ds100object { Station = leg.ArrStation, Ds100 = leg.ArrStation }).First().Ds100;
|
||||
var title = $"{depst} -> {arrst} ({leg.TrainType} {leg.TrainNr})";
|
||||
var e = new CalendarEvent {
|
||||
Summary = title, Start = new CalDateTime(DateTime.Parse(leg.DepTime)), End = new CalDateTime(DateTime.Parse(leg.ArrTime))
|
||||
};
|
||||
var e = new CalendarEvent { Summary = title, Start = new CalDateTime(DateTime.Parse(leg.DepTime)), End = new CalDateTime(DateTime.Parse(leg.ArrTime)) };
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(leg.Comment))
|
||||
e.Description =
|
||||
leg.Comment
|
||||
e.Description = leg.Comment
|
||||
+ "\n"
|
||||
+ "\n"
|
||||
+ $"https://marudor.de/details/{leg.TrainType}{leg.TrainNr}/{DateTime.Parse(leg.DepTime).ToUniversalTime().Subtract(new DateTime(1970, 1, 1)).TotalSeconds}000/?station={leg.DepStationId}";
|
||||
|
||||
else
|
||||
e.Description = $"https://marudor.de/details/{leg.TrainType}{leg.TrainNr}/{DateTime.Parse(leg.DepTime).ToUniversalTime().Subtract(new DateTime(1970, 1, 1)).TotalSeconds}000/?station={leg.DepStationId}";
|
||||
e.Description =
|
||||
$"https://marudor.de/details/{leg.TrainType}{leg.TrainNr}/{DateTime.Parse(leg.DepTime).ToUniversalTime().Subtract(new DateTime(1970, 1, 1)).TotalSeconds}000/?station={leg.DepStationId}";
|
||||
|
||||
calendar.Events.Add(e);
|
||||
}
|
||||
|
@ -101,4 +94,3 @@ namespace trainav.web.Pages {
|
|||
[Name("Aufgabenträger")] public string Verkehrsverbund { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -4,7 +4,8 @@ using Microsoft.AspNetCore.Mvc.RazorPages;
|
|||
using trainav.web.database;
|
||||
using trainav.web.database.Tables;
|
||||
|
||||
namespace trainav.web.Pages {
|
||||
namespace trainav.web.Pages;
|
||||
|
||||
public class IndexModel : PageModel {
|
||||
public User AuthorizedUser;
|
||||
|
||||
|
@ -17,4 +18,3 @@ namespace trainav.web.Pages {
|
|||
AuthorizedUser = db.Users.FirstOrDefault(p => p.UserId == uid);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -6,7 +6,8 @@ using Microsoft.AspNetCore.Mvc.RazorPages;
|
|||
using trainav.web.database;
|
||||
using trainav.web.database.Tables;
|
||||
|
||||
namespace trainav.web.Pages {
|
||||
namespace trainav.web.Pages;
|
||||
|
||||
public class InspectionModel : PageModel {
|
||||
public Leg Leg;
|
||||
public Ticket Ticket;
|
||||
|
@ -26,4 +27,3 @@ namespace trainav.web.Pages {
|
|||
Ticket.TicketSecCode = Encoding.UTF8.GetString(Convert.FromBase64String(Ticket.TicketSecCode));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,8 @@ using Microsoft.AspNetCore.Http;
|
|||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using trainav.web.database;
|
||||
|
||||
namespace trainav.web.Pages {
|
||||
namespace trainav.web.Pages;
|
||||
|
||||
public class LoginModel : PageModel {
|
||||
public void OnPost() {
|
||||
if (!Request.HasFormContentType || string.IsNullOrWhiteSpace(Request.Form["user"]) || string.IsNullOrWhiteSpace(Request.Form["pass"]))
|
||||
|
@ -50,4 +51,3 @@ namespace trainav.web.Pages {
|
|||
public static string UrlEncode(this string plainText) => HttpUtility.UrlEncode(plainText);
|
||||
public static string Delimit(this string input, int max) => input.PadRight(max, ' ').Substring(0, max).TrimEnd();
|
||||
}
|
||||
}
|
|
@ -1,9 +1,9 @@
|
|||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
|
||||
namespace trainav.web.Pages {
|
||||
namespace trainav.web.Pages;
|
||||
|
||||
public class LogoutModel : PageModel {
|
||||
public void OnGet() {
|
||||
HttpContext.Session.Clear();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -12,7 +12,8 @@ using Leg = trainav.web.database.Tables.Leg;
|
|||
|
||||
// ReSharper disable PossibleInvalidOperationException
|
||||
|
||||
namespace trainav.web.Pages {
|
||||
namespace trainav.web.Pages;
|
||||
|
||||
public class OEAPIModel : PageModel {
|
||||
public int TripId;
|
||||
|
||||
|
@ -23,12 +24,14 @@ namespace trainav.web.Pages {
|
|||
var link = Request.Query["link"].ToString();
|
||||
var shortcode = link;
|
||||
var oepage = "oeffisear.ch";
|
||||
if (link.Contains("oeffisear.ch"))
|
||||
if (link.Contains("oeffisear.ch")) {
|
||||
shortcode = link.Split("/#/").Last();
|
||||
}
|
||||
else if (link.Contains("transit.ztn.sh")) {
|
||||
shortcode = link.Split("/#/").Last();
|
||||
oepage = "transit.ztn.sh";
|
||||
}
|
||||
|
||||
var jid = shortcode.Split("/").Last();
|
||||
shortcode = shortcode.Split("/").First();
|
||||
|
||||
|
@ -56,7 +59,8 @@ namespace trainav.web.Pages {
|
|||
if (extractedTrainNo.Length > 0)
|
||||
trainNo = int.Parse(extractedTrainNo);
|
||||
}
|
||||
db.InsertWithInt32Identity(new database.Tables.Leg {
|
||||
|
||||
db.InsertWithInt32Identity(new Leg {
|
||||
TripId = tripId,
|
||||
UserId = int.Parse(HttpContext.Session.GetString("uid")),
|
||||
TrainType = journey.Line.ProductName,
|
||||
|
@ -73,4 +77,3 @@ namespace trainav.web.Pages {
|
|||
TripId = tripId;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,8 @@ using Microsoft.AspNetCore.Mvc.RazorPages;
|
|||
using trainav.web.database;
|
||||
using trainav.web.database.Tables;
|
||||
|
||||
namespace trainav.web.Pages {
|
||||
namespace trainav.web.Pages;
|
||||
|
||||
public class PlainModel : PageModel {
|
||||
public User AuthorizedUser;
|
||||
|
||||
|
@ -17,4 +18,3 @@ namespace trainav.web.Pages {
|
|||
AuthorizedUser = db.Users.FirstOrDefault(p => p.UserId == uid);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,7 +1,8 @@
|
|||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace trainav.web.Pages {
|
||||
namespace trainav.web.Pages;
|
||||
|
||||
public class PrivacyModel : PageModel {
|
||||
private readonly ILogger<PrivacyModel> _logger;
|
||||
|
||||
|
@ -9,4 +10,3 @@ namespace trainav.web.Pages {
|
|||
|
||||
public void OnGet() { }
|
||||
}
|
||||
}
|
|
@ -5,7 +5,8 @@ using Microsoft.AspNetCore.Mvc.RazorPages;
|
|||
using trainav.web.database;
|
||||
using trainav.web.database.Tables;
|
||||
|
||||
namespace trainav.web.Pages {
|
||||
namespace trainav.web.Pages;
|
||||
|
||||
public class RegisterModel : PageModel {
|
||||
public void OnPost() {
|
||||
if (!Request.HasFormContentType
|
||||
|
@ -28,4 +29,3 @@ namespace trainav.web.Pages {
|
|||
HttpContext.Session.SetString("authorized", "true");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -4,7 +4,8 @@ using Microsoft.AspNetCore.Mvc.RazorPages;
|
|||
using trainav.web.database;
|
||||
using trainav.web.database.Tables;
|
||||
|
||||
namespace trainav.web.Pages {
|
||||
namespace trainav.web.Pages;
|
||||
|
||||
public class SharedTripModel : PageModel {
|
||||
public List<Leg> Legs;
|
||||
public bool RedirToIndex;
|
||||
|
@ -24,4 +25,3 @@ namespace trainav.web.Pages {
|
|||
RedirToIndex = true;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -6,7 +6,8 @@ using Microsoft.AspNetCore.Mvc.RazorPages;
|
|||
using trainav.web.database;
|
||||
using trainav.web.database.Tables;
|
||||
|
||||
namespace trainav.web.Pages {
|
||||
namespace trainav.web.Pages;
|
||||
|
||||
public class TripModel : PageModel {
|
||||
public List<Leg> Legs;
|
||||
public bool RedirToIndex;
|
||||
|
@ -64,4 +65,3 @@ namespace trainav.web.Pages {
|
|||
db.Update(leg);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -6,7 +6,8 @@ using Microsoft.AspNetCore.Hosting;
|
|||
using Microsoft.Extensions.Hosting;
|
||||
using trainav.web.database;
|
||||
|
||||
namespace trainav.web {
|
||||
namespace trainav.web;
|
||||
|
||||
public class Program {
|
||||
public static void Main(string[] args) {
|
||||
DataConnection.DefaultSettings = new Database.Settings();
|
||||
|
@ -19,7 +20,5 @@ namespace trainav.web {
|
|||
CreateHostBuilder(args).Build().Run();
|
||||
}
|
||||
|
||||
public static IHostBuilder CreateHostBuilder(string[] args) =>
|
||||
Host.CreateDefaultBuilder(args).ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup<Startup>(); });
|
||||
}
|
||||
public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args).ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup<Startup>(); });
|
||||
}
|
|
@ -5,7 +5,8 @@ using Microsoft.Extensions.Configuration;
|
|||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
|
||||
namespace trainav.web {
|
||||
namespace trainav.web;
|
||||
|
||||
public class Startup {
|
||||
public Startup(IConfiguration configuration) => Configuration = configuration;
|
||||
|
||||
|
@ -63,4 +64,3 @@ namespace trainav.web {
|
|||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
using System.IO;
|
||||
|
||||
namespace trainav.web {
|
||||
namespace trainav.web;
|
||||
|
||||
public class Variables {
|
||||
public const string DataDir = "data";
|
||||
public static readonly string TicketDir = Path.Combine(DataDir, "tickets");
|
||||
}
|
||||
}
|
|
@ -5,7 +5,8 @@ using LinqToDB.Configuration;
|
|||
using LinqToDB.Data;
|
||||
using trainav.web.database.Tables;
|
||||
|
||||
namespace trainav.web.database {
|
||||
namespace trainav.web.database;
|
||||
|
||||
public class Database {
|
||||
public class ConnectionStringSettings : IConnectionStringSettings {
|
||||
public string ConnectionString { get; set; }
|
||||
|
@ -37,4 +38,3 @@ namespace trainav.web.database {
|
|||
public ITable<Card> Cards => GetTable<Card>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
using LinqToDB.Mapping;
|
||||
|
||||
namespace trainav.web.database.Tables {
|
||||
namespace trainav.web.database.Tables;
|
||||
|
||||
[Table(Name = "Cards")]
|
||||
public class Card {
|
||||
[Column(Name = "CardID"), PrimaryKey, Identity, NotNull]
|
||||
public int CardId { get; set; }
|
||||
[Column(Name = "CardID"), PrimaryKey, Identity, NotNull] public int CardId { get; set; }
|
||||
|
||||
[Column(Name = "OrderID"), NotNull] public string OrderId { get; set; }
|
||||
|
||||
|
@ -34,4 +34,3 @@ namespace trainav.web.database.Tables {
|
|||
|
||||
[Column(Name = "QRValidTo")] public string QrValidTo { get; set; }
|
||||
}
|
||||
}
|
|
@ -1,9 +1,9 @@
|
|||
using LinqToDB.Mapping;
|
||||
|
||||
namespace trainav.web.database.Tables {
|
||||
namespace trainav.web.database.Tables;
|
||||
|
||||
[Table(Name = "DbInfo")]
|
||||
public class DbInfo {
|
||||
[Column(Name = "ID"), PrimaryKey, Identity, NotNull] public int Id { get; set; }
|
||||
[Column(Name = "DbVer"), NotNull] public int DbVer { get; set; }
|
||||
}
|
||||
}
|
|
@ -1,10 +1,10 @@
|
|||
using LinqToDB.Mapping;
|
||||
|
||||
namespace trainav.web.database.Tables {
|
||||
namespace trainav.web.database.Tables;
|
||||
|
||||
[Table(Name = "Legs")]
|
||||
public class Leg {
|
||||
[Column(Name = "LegID"), PrimaryKey, Identity, NotNull]
|
||||
public int LegId { get; set; }
|
||||
[Column(Name = "LegID"), PrimaryKey, Identity, NotNull] public int LegId { get; set; }
|
||||
|
||||
[Column(Name = "TripID"), NotNull] public int TripId { get; set; }
|
||||
|
||||
|
@ -14,15 +14,13 @@ namespace trainav.web.database.Tables {
|
|||
|
||||
[Column(Name = "TrainNr"), NotNull] public int TrainNr { get; set; }
|
||||
|
||||
[Column(Name = "DepStationID"), NotNull]
|
||||
public int DepStationId { get; set; }
|
||||
[Column(Name = "DepStationID"), NotNull] public int DepStationId { get; set; }
|
||||
|
||||
[Column(Name = "DepStation"), NotNull] public string DepStation { get; set; }
|
||||
|
||||
[Column(Name = "DepTime"), NotNull] public string DepTime { get; set; }
|
||||
|
||||
[Column(Name = "ArrStationID"), NotNull]
|
||||
public int ArrStationId { get; set; }
|
||||
[Column(Name = "ArrStationID"), NotNull] public int ArrStationId { get; set; }
|
||||
|
||||
[Column(Name = "ArrStation"), NotNull] public string ArrStation { get; set; }
|
||||
|
||||
|
@ -32,4 +30,3 @@ namespace trainav.web.database.Tables {
|
|||
|
||||
[Column(Name = "Comment")] public string Comment { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using LinqToDB.Mapping;
|
||||
|
||||
namespace trainav.web.database.Tables {
|
||||
namespace trainav.web.database.Tables;
|
||||
|
||||
[Table(Name = "Tickets")]
|
||||
public class Ticket {
|
||||
[Column(Name = "TicketID"), PrimaryKey, Identity, NotNull] public int TicketId { get; set; }
|
||||
|
@ -19,4 +20,3 @@ namespace trainav.web.database.Tables {
|
|||
|
||||
[Column(Name = "Traveller")] public string Traveller { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using LinqToDB.Mapping;
|
||||
|
||||
namespace trainav.web.database.Tables {
|
||||
namespace trainav.web.database.Tables;
|
||||
|
||||
[Table(Name = "TicketLegs")]
|
||||
public class TicketLeg {
|
||||
[Column(Name = "TicketLegID"), PrimaryKey, Identity, NotNull]
|
||||
|
@ -12,18 +13,15 @@ namespace trainav.web.database.Tables {
|
|||
|
||||
[Column(Name = "TrainNr"), NotNull] public int TrainNr { get; set; }
|
||||
|
||||
[Column(Name = "DepStationID"), NotNull]
|
||||
public int DepStationId { get; set; }
|
||||
[Column(Name = "DepStationID"), NotNull] public int DepStationId { get; set; }
|
||||
|
||||
[Column(Name = "DepStation"), NotNull] public string DepStation { get; set; }
|
||||
|
||||
[Column(Name = "DepTime"), NotNull] public string DepTime { get; set; }
|
||||
|
||||
[Column(Name = "ArrStationID"), NotNull]
|
||||
public int ArrStationId { get; set; }
|
||||
[Column(Name = "ArrStationID"), NotNull] public int ArrStationId { get; set; }
|
||||
|
||||
[Column(Name = "ArrStation"), NotNull] public string ArrStation { get; set; }
|
||||
|
||||
[Column(Name = "ArrTime"), NotNull] public string ArrTime { get; set; }
|
||||
}
|
||||
}
|
|
@ -1,12 +1,10 @@
|
|||
using LinqToDB.Mapping;
|
||||
|
||||
namespace trainav.web.database.Tables {
|
||||
namespace trainav.web.database.Tables;
|
||||
|
||||
[Table(Name = "Trips")]
|
||||
public class Trip {
|
||||
[Column(Name = "TripID"), PrimaryKey, Identity, NotNull]
|
||||
public int TripId { get; set; }
|
||||
[Column(Name = "TripID"), PrimaryKey, Identity, NotNull] public int TripId { get; set; }
|
||||
|
||||
[Column(Name = "UserID"), PrimaryKey, NotNull]
|
||||
public int UserId { get; set; }
|
||||
}
|
||||
[Column(Name = "UserID"), PrimaryKey, NotNull] public int UserId { get; set; }
|
||||
}
|
|
@ -1,13 +1,12 @@
|
|||
using LinqToDB.Mapping;
|
||||
|
||||
namespace trainav.web.database.Tables {
|
||||
namespace trainav.web.database.Tables;
|
||||
|
||||
[Table(Name = "Users")]
|
||||
public class User {
|
||||
[Column(Name = "UserID"), PrimaryKey, Identity, NotNull]
|
||||
public int UserId { get; set; }
|
||||
[Column(Name = "UserID"), PrimaryKey, Identity, NotNull] public int UserId { get; set; }
|
||||
|
||||
[Column(Name = "Username"), NotNull] public string Username { get; set; }
|
||||
|
||||
[Column(Name = "Password"), NotNull] public string Password { get; set; }
|
||||
}
|
||||
}
|
Reference in New Issue