Möglichkeit zur Angabe eines zeitraumes für die angezeigten Briefe

This commit is contained in:
Simon Martens
2023-05-08 16:39:14 +02:00
parent 5093951f7a
commit 87337ea992
15 changed files with 91 additions and 19 deletions

View File

@@ -0,0 +1,9 @@
namespace HaWeb.Models;
using System.ComponentModel.DataAnnotations;
public class StartEndYear {
[Required]
public int StartYear { get; set; }
[Required]
public int EndYear { get; set; }
}

View File

@@ -10,13 +10,18 @@ public class UploadViewModel {
public List<FileModel>? AvailableFiles { get; set; }
public Dictionary<string, List<FileModel>?>? UsedFiles { get; private set; }
public Dictionary<string, List<FileModel>?>? ProductionFiles { get; set; }
public List<int> AvailableYears { get; private set; }
public int StartYear { get; private set; }
public int EndYear { get; private set; }
public List<FileModel>? HamannFiles { get; set; }
public UploadViewModel(string title, string? prefix, List<IXMLRoot>? roots, Dictionary<string, List<FileModel>?>? usedFiles) {
public UploadViewModel(string title, string? prefix, List<IXMLRoot>? roots, Dictionary<string, List<FileModel>?>? usedFiles, int startYear, int endYear, List<int> availableYears) {
Prefix = prefix;
ActiveTitle = title;
AvailableRoots = roots;
UsedFiles = usedFiles;
StartYear = startYear;
EndYear = endYear;
AvailableYears = availableYears;
}
}

View File

@@ -30,7 +30,6 @@ public class XMLRootDocument {
_file = value;
// After saving, we don't need to save the ELement anymore, it can get read in if it's used.
// We do this to prevent memory hogging. TODO: MAKE IT MORE EFFICIENT, EG ALL USED FILES HAVE SET ELEMENTS OR SO
// TODO Also make the file directory more efficient by reading in the directories as they are requested.
if (value != null) _Element = null;
} }
public string Prefix { get; private set; }