diff --git a/Areas/MMS/Controllers/MarineController.cs b/Areas/MMS/Controllers/MarineController.cs
index 1a18fdc..a325004 100644
--- a/Areas/MMS/Controllers/MarineController.cs
+++ b/Areas/MMS/Controllers/MarineController.cs
@@ -55,16 +55,17 @@ namespace PSTW_CentralSystem.Areas.MMS.Controllers
return View();
}
- public IActionResult TarBallForm()//Queries the database and returns a view with tarball data
+ public IActionResult TarBallForm()
{
try
{
- var marineTarballs = _context.MarineTarballs //ERRORRRRRRR======================================
+ var marineTarballs = _context.MarineTarballs
.Select(t => new
{
- t.Id,
- Date = t.DateSample.ToString("yyyy/MM/dd"),
- Station = t.StationID
+ id = t.Id,
+ date = t.DateSample.ToString("yyyy/MM/dd"),
+ station = t.StationID,
+ time = t.TimeSample.ToString("hh\\:mm\\:ss")
})
.ToList();
@@ -73,10 +74,8 @@ namespace PSTW_CentralSystem.Areas.MMS.Controllers
}
catch (Exception ex)
{
- // Show the real error in the browser (for debugging only)
return Content($"Error: {ex.Message}
{ex.StackTrace}", "text/html");
}
-
}
[HttpGet] // Explicitly mark as a GET endpoint
diff --git a/Areas/MMS/Models/PDFGenerator/TarBallPDF.cs b/Areas/MMS/Models/PDFGenerator/TarBallPDF.cs
index 379f31c..7fe9c82 100644
--- a/Areas/MMS/Models/PDFGenerator/TarBallPDF.cs
+++ b/Areas/MMS/Models/PDFGenerator/TarBallPDF.cs
@@ -308,11 +308,11 @@ namespace PSTW_CentralSystem.Areas.MMS.Models.PDFGenerator
// Row 2: Captions
table.Cell().Element(CellStyle)
- .Text(string.IsNullOrEmpty(_photoPath5) ? "" : $"Figure 5: {_optionalName1}")
+ .Text($"Figure 5: {(_optionalName1 ?? "")}")
.FontSize(12).AlignLeft();
table.Cell().Element(CellStyle)
- .Text(string.IsNullOrEmpty(_photoPath6) ? "" : $"Figure 6: {_optionalName2}")
+ .Text($"Figure 6: {(_optionalName2 ?? "")}")
.FontSize(12).AlignLeft();
// Row 3: Optional images 7 & 8
@@ -321,11 +321,11 @@ namespace PSTW_CentralSystem.Areas.MMS.Models.PDFGenerator
// Row 4: Captions
table.Cell().Element(CellStyle)
- .Text(string.IsNullOrEmpty(_photoPath7) ? "" : $"Figure 7: {_optionalName3}")
+ .Text($"Figure 7: {(_optionalName3 ?? "")}")
.FontSize(12).AlignLeft();
table.Cell().Element(CellStyle)
- .Text(string.IsNullOrEmpty(_photoPath8) ? "" : $"Figure 8: {_optionalName4}")
+ .Text($"Figure 8: {(_optionalName4 ?? "")}")
.FontSize(12).AlignLeft();
});
@@ -360,7 +360,7 @@ namespace PSTW_CentralSystem.Areas.MMS.Models.PDFGenerator
table.Cell().Element(CellStyle).Text("Signature").FontSize(12);
table.Cell().Element(CellStyle).Text("");
table.Cell().Element(CellStyle).Text("Date").FontSize(12);
- table.Cell().Element(CellStyle).Text($"{_dateSample:yyyyMMdd}").FontSize(12);
+ table.Cell().Element(CellStyle).Text($"{_dateSample:dd/MM/yyyy}").FontSize(12);
table.Cell().Element(CellStyle).Text("Designation").FontSize(12);
table.Cell().ColumnSpan(3).Element(CellStyle).Text(_levelName).FontSize(12);
diff --git a/Areas/MMS/Views/Marine/TarBallForm.cshtml b/Areas/MMS/Views/Marine/TarBallForm.cshtml
index 2ee56d5..add8d50 100644
--- a/Areas/MMS/Views/Marine/TarBallForm.cshtml
+++ b/Areas/MMS/Views/Marine/TarBallForm.cshtml
@@ -69,6 +69,7 @@