From 2a5ff7a911fd46609617a0e355964070f7ce2adf Mon Sep 17 00:00:00 2001 From: "DESKTOP-GENO133\\IvanPlex" Date: Wed, 21 Feb 2024 10:32:25 -0700 Subject: [PATCH] added ability to select reminders from tax modal. --- Controllers/VehicleController.cs | 5 +++++ Models/TaxRecord/TaxRecordInput.cs | 1 + Views/Vehicle/_TaxRecordModal.cshtml | 9 +++++++++ wwwroot/js/collisionrecord.js | 2 +- wwwroot/js/servicerecord.js | 2 +- wwwroot/js/taxrecord.js | 3 ++- wwwroot/js/upgraderecord.js | 2 +- 7 files changed, 20 insertions(+), 4 deletions(-) diff --git a/Controllers/VehicleController.cs b/Controllers/VehicleController.cs index 9b4e9d7..62bdeb8 100644 --- a/Controllers/VehicleController.cs +++ b/Controllers/VehicleController.cs @@ -927,6 +927,11 @@ namespace CarCareTracker.Controllers { //move files from temp. taxRecord.Files = taxRecord.Files.Select(x => { return new UploadedFiles { Name = x.Name, Location = _fileHelper.MoveFileFromTemp(x.Location, "documents/") }; }).ToList(); + //push back any reminders + if (taxRecord.ReminderRecordId != default) + { + PushbackRecurringReminderRecordWithChecks(taxRecord.ReminderRecordId); + } var result = _taxRecordDataAccess.SaveTaxRecordToVehicle(taxRecord.ToTaxRecord()); return Json(result); } diff --git a/Models/TaxRecord/TaxRecordInput.cs b/Models/TaxRecord/TaxRecordInput.cs index 723623d..4ad9c2f 100644 --- a/Models/TaxRecord/TaxRecordInput.cs +++ b/Models/TaxRecord/TaxRecordInput.cs @@ -4,6 +4,7 @@ { public int Id { get; set; } public int VehicleId { get; set; } + public int ReminderRecordId { get; set; } public string Date { get; set; } = DateTime.Now.ToShortDateString(); public string Description { get; set; } public decimal Cost { get; set; } diff --git a/Views/Vehicle/_TaxRecordModal.cshtml b/Views/Vehicle/_TaxRecordModal.cshtml index 38f4f58..56cec53 100644 --- a/Views/Vehicle/_TaxRecordModal.cshtml +++ b/Views/Vehicle/_TaxRecordModal.cshtml @@ -24,6 +24,14 @@ + @if (isNew) + { +
+ +
+ } @@ -107,6 +115,7 @@