From b297be7fe679d1eb8c993855c429467255561afe Mon Sep 17 00:00:00 2001 From: misya Date: Fri, 4 Jul 2025 10:46:32 +0800 Subject: [PATCH] Revert "clean" This reverts commit 100a4adff61e5396735084aa1f7011069fcaca43. --- Areas/MMS/Controllers/MarineController.cs | 7 +++++++ Areas/MMS/Models/PDFGenerator/TarBallPDF.cs | 9 ++++++--- Areas/MMS/Views/Marine/TarBallForm.cshtml | 10 ++++------ 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/Areas/MMS/Controllers/MarineController.cs b/Areas/MMS/Controllers/MarineController.cs index 5233508..3cacec2 100644 --- a/Areas/MMS/Controllers/MarineController.cs +++ b/Areas/MMS/Controllers/MarineController.cs @@ -1,7 +1,14 @@ using Microsoft.AspNetCore.Mvc; using PSTW_CentralSystem.DBContext; +//using PSTW_CentralSystem.Areas.MMS.Models; +//using System.IO; +//using System.Linq; using PSTW_CentralSystem.Areas.MMS.Models.PDFGenerator; using QuestPDF.Fluent; +//using System.Threading.Tasks; +//using System.Threading; +//using System.Collections.Generic; +//using Microsoft.Data.SqlClient; using Microsoft.EntityFrameworkCore; using MySqlConnector; diff --git a/Areas/MMS/Models/PDFGenerator/TarBallPDF.cs b/Areas/MMS/Models/PDFGenerator/TarBallPDF.cs index 2fdeca3..7fe9c82 100644 --- a/Areas/MMS/Models/PDFGenerator/TarBallPDF.cs +++ b/Areas/MMS/Models/PDFGenerator/TarBallPDF.cs @@ -1,13 +1,16 @@ using QuestPDF.Fluent; using QuestPDF.Infrastructure; using QuestPDF.Helpers; +using Google.Protobuf.WellKnownTypes; +using PSTW_CentralSystem.Models; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion.Internal; namespace PSTW_CentralSystem.Areas.MMS.Models.PDFGenerator { public class TarBallPDF(string stateName, string stationID, string locationName, - string longitude, string latitude, DateTime dateSample, TimeSpan timeSample, string classifyID, - bool tarBallYes, bool tarBallNo, bool isSand, bool isNonSandy, bool isCoquina, - string photoPath1, string photoPath2, string photoPath3, string photoPath4, + string longitude, string latitude, DateTime dateSample, TimeSpan timeSample, + string classifyID, bool tarBallYes, bool tarBallNo, bool isSand, bool isNonSandy, + bool isCoquina, string photoPath1, string photoPath2, string photoPath3, string photoPath4, string? photoPath5, string? photoPath6, string? photoPath7, string? photoPath8, string? optionalName1, string? optionalName2, string? optionalName3, string? optionalName4, string firstSampler, string fullName, string levelName diff --git a/Areas/MMS/Views/Marine/TarBallForm.cshtml b/Areas/MMS/Views/Marine/TarBallForm.cshtml index 9a1acdc..afae953 100644 --- a/Areas/MMS/Views/Marine/TarBallForm.cshtml +++ b/Areas/MMS/Views/Marine/TarBallForm.cshtml @@ -190,7 +190,7 @@ // Populate the table with initial data this.updateDataTable(this.sortedFilteredData); - //auto-filtering => search bar + //auto-filtering $('#tarballTable_filter input').on('keyup', function () { self.dataTable.search(this.value).draw(); }); @@ -210,14 +210,12 @@ }); }, watch: { - //runs on auto when month/year dropdowns changed sortedFilteredData(newData) { - //1. UPDATE THE TABLE: take the new filtered list (newData) and put it in the table + // Automatically update DataTables whenever the filtered data changes this.updateDataTable(newData); - //2. CLEAR THE SEARCH BOX: if table exist, clear anything typed in the search bar - //Like pressing 'clear' on a calculator after getting new numbers + //trigger search function after updating data(?) if(this.dataTable) { - this.dataTable.search('').draw(); //empty the search box + this.dataTable.search('').draw(); } } }