Update Areas/MMS/Models/PDFGenerator/TarBallPDF.cs

This commit is contained in:
Naz 2025-07-09 16:05:25 +08:00
parent a84b6cb783
commit b0437d2fe8

View File

@ -1,20 +1,20 @@
using QuestPDF.Fluent; using QuestPDF.Fluent;
using QuestPDF.Infrastructure; using QuestPDF.Infrastructure;
using QuestPDF.Helpers; using QuestPDF.Helpers;
using Google.Protobuf.WellKnownTypes; //using Google.Protobuf.WellKnownTypes;
using PSTW_CentralSystem.Models; //using PSTW_CentralSystem.Models;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion.Internal; //using Microsoft.EntityFrameworkCore.Storage.ValueConversion.Internal;
namespace PSTW_CentralSystem.Areas.MMS.Models.PDFGenerator namespace PSTW_CentralSystem.Areas.MMS.Models.PDFGenerator
{ {
public class TarBallPDF(string stateName, string stationID, string locationName, public class TarBallPDF(string stateName, string stationID, string locationName,
string longitude, string latitude, DateTime dateSample, TimeSpan timeSample, string longitude, string latitude, DateTime dateSample, TimeSpan timeSample,
string classifyID, bool tarBallYes, bool tarBallNo, bool isSand, bool isNonSandy, string classifyID, bool tarBallYes, bool tarBallNo, bool isSand, bool isNonSandy,
bool isCoquina, string photoPath1, string photoPath2, string photoPath3, string photoPath4, bool isCoquina, string photoPath1, string photoPath2, string photoPath3, string photoPath4,
string? photoPath5, string? photoPath6, string? photoPath7, string? photoPath8, string? photoPath5, string? photoPath6, string? photoPath7, string? photoPath8,
string? optionalName1, string? optionalName2, string? optionalName3, string? optionalName4, string? optionalName1, string? optionalName2, string? optionalName3, string? optionalName4,
string firstSampler, string fullName, string levelName string firstSampler, string fullName, string levelName
) )
: IDocument : IDocument
{ {
//have to be arranged accordingly(?) //have to be arranged accordingly(?)
@ -32,8 +32,8 @@ namespace PSTW_CentralSystem.Areas.MMS.Models.PDFGenerator
private readonly bool _isNonSandy = isNonSandy; private readonly bool _isNonSandy = isNonSandy;
private readonly bool _isCoquina = isCoquina; private readonly bool _isCoquina = isCoquina;
private readonly string _photoPath1 = photoPath1; private readonly string _photoPath1 = photoPath1;
private readonly string _photoPath2 = photoPath2; private readonly string _photoPath2 = photoPath2;
private readonly string _photoPath3 = photoPath3; private readonly string _photoPath3 = photoPath3;
private readonly string _photoPath4 = photoPath4; private readonly string _photoPath4 = photoPath4;
private readonly string? _photoPath5 = photoPath5; private readonly string? _photoPath5 = photoPath5;
private readonly string? _photoPath6 = photoPath6; private readonly string? _photoPath6 = photoPath6;
@ -241,7 +241,7 @@ namespace PSTW_CentralSystem.Areas.MMS.Models.PDFGenerator
.FitArea(); .FitArea();
table.Cell().Element(CellStyle).Height(150) table.Cell().Element(CellStyle).Height(150)
.Image(LoadImage(_photoPath2) ?? null) .Image(LoadImage(_photoPath2) ?? null)
.FitArea(); .FitArea();
// Row 2: Captions for figure 1 & 2 ================= // Row 2: Captions for figure 1 & 2 =================