A lot of stuff related to parsing; index page input validation

This commit is contained in:
Simon Martens
2023-09-17 15:29:51 +02:00
parent d86d508786
commit b15ce8793c
23 changed files with 294 additions and 60 deletions

View File

@@ -1,4 +1,6 @@
namespace HaWeb.Models;
using System.Collections.Immutable;
using HaDocument.Models;
public class IndexViewModel {
@@ -8,15 +10,16 @@ public class IndexViewModel {
public List<(int StartYear, int EndYear)>? AvailableYears { get; private set; }
public string? ActivePerson { get; set; }
public CommentModel? PersonComment { get; set; }
public List<string>? AvailableLetters { get; private set; }
public List<(string Key, string Name)>? AvailablePersons { get; private set; }
public List<(string Volume, List<string> Pages)>? AvailablePages { get; private set; }
public Dictionary<string, List<string>>? AvailablePages { get; private set; }
public string? ActiveVolume { get; private set; }
public string? ActivePage { get; private set; }
public string EndYear { get; private set; }
public string EndPageString { get; private set; }
public IndexViewModel(
List<(int Year, List<BriefeMetaViewModel> LetterList)>? letters,
int activeYear,
@@ -24,7 +27,8 @@ public class IndexViewModel {
string endPageString,
List<(int StartYear, int EndYear)>? availableYears,
List<(string Key, string Name)>? availablePersons,
List<(string Volume, List<string> Pages)>? availablePages,
Dictionary<string, List<string>>? availablePages,
List<string>? availableLetters,
string? activeVolume,
string? activePage,
string? activePerson
@@ -34,6 +38,7 @@ public class IndexViewModel {
Count = letters.Select(x => x.LetterList.Count).Aggregate(0, (x, y) => { x += y; return x; });
else
Count = 0;
AvailableLetters = availableLetters;
ActiveYear = activeYear;
AvailableYears = availableYears;
AvailablePersons = availablePersons;