21 lines
553 B
C#
21 lines
553 B
C#
|
using System.Collections.Generic;
|
||
|
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 CardsModel : PageModel {
|
||
|
public List<Card> Cards;
|
||
|
|
||
|
public void OnGet() {
|
||
|
if (HttpContext.Session.GetString("authorized") != "true") {
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
using var db = new Database.DbConn();
|
||
|
Cards = db.Cards.Where(p => p.UserId == int.Parse(HttpContext.Session.GetString("uid"))).ToList();
|
||
|
}
|
||
|
}
|
||
|
}
|