FizHof/Abwesenheiten - Abfangen von Parsing-Error bei Null-Datum

This commit is contained in:
2025-04-10 14:00:20 +02:00
parent e50fdf3272
commit 2c1926f103

View File

@@ -34,17 +34,25 @@ namespace FizHof
if (ro.Rows != null && ro.Rows.Count > 0)
{
foreach (var row in ro.Rows)
{
{
if (row.Field3.ToString() != "Krankheit")
continue;
DateTime start = DateTime.Parse(row.Field4.ToString());
DateTime start = DateTime.Now;
DateTime end = DateTime.Now;
if (row.Field5 != null)
try
{
end = DateTime.Parse(row.Field5.ToString());
if (row.Field4 != null)
{
start = DateTime.Parse(row.Field4.ToString());
}
if (row.Field5 != null)
{
end = DateTime.Parse(row.Field5.ToString());
}
}
catch
{
//mach einfach weiter
}
double tage = 0;