Compare commits

...

3 Commits

Author SHA1 Message Date
Hargata Softworks
83f1a25057
Merge pull request #1127 from hargata/Hargata/dupe.inspection.template
add functionality to duplicate inspection record templates
2025-11-06 16:29:23 -07:00
DESKTOP-T0O5CDB\DESK-555BD
7f671c1802 call back 2025-11-06 16:29:03 -07:00
DESKTOP-T0O5CDB\DESK-555BD
3f05f06824 add functionality to duplicate inspection record templates 2025-11-06 16:27:53 -07:00
4 changed files with 19 additions and 2 deletions

View File

@ -935,6 +935,14 @@ namespace CarCareTracker.Controllers
result = _planRecordDataAccess.SavePlanRecordToVehicle(existingRecord); result = _planRecordDataAccess.SavePlanRecordToVehicle(existingRecord);
} }
break; break;
case ImportMode.InspectionRecord:
{
var existingRecord = _inspectionRecordTemplateDataAccess.GetInspectionRecordTemplateById(recordId);
existingRecord.Id = default;
existingRecord.ReminderRecordId = new List<int>();
result = _inspectionRecordTemplateDataAccess.SaveInspectionReportTemplateToVehicle(existingRecord);
}
break;
} }
} }
if (result) if (result)

View File

@ -63,6 +63,7 @@
<span class="visually-hidden">Toggle Dropdown</span> <span class="visually-hidden">Toggle Dropdown</span>
</button> </button>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li><a class="dropdown-item" href="#" onclick="duplicateInspectionRecordTemplate()">@translator.Translate(userLanguage, "Duplicate")</a></li>
<li><a class="dropdown-item" href="#" onclick="duplicateInspectionRecordTemplateToVehicle()">@translator.Translate(userLanguage, "Duplicate To Vehicle")</a></li> <li><a class="dropdown-item" href="#" onclick="duplicateInspectionRecordTemplateToVehicle()">@translator.Translate(userLanguage, "Duplicate To Vehicle")</a></li>
</ul> </ul>
</div> </div>

View File

@ -448,4 +448,9 @@ function duplicateInspectionRecordTemplateToVehicle() {
let inspectionRecordsIds = []; let inspectionRecordsIds = [];
inspectionRecordsIds.push(getInspectionRecordModelData().id); inspectionRecordsIds.push(getInspectionRecordModelData().id);
duplicateRecordsToOtherVehicles(inspectionRecordsIds, 'InspectionRecord'); duplicateRecordsToOtherVehicles(inspectionRecordsIds, 'InspectionRecord');
}
function duplicateInspectionRecordTemplate() {
let inspectionRecordsIds = [];
inspectionRecordsIds.push(getInspectionRecordModelData().id);
duplicateRecords(inspectionRecordsIds, 'InspectionRecord');
} }

View File

@ -991,6 +991,9 @@ function duplicateRecords(ids, source) {
friendlySource = "Plan"; friendlySource = "Plan";
refreshDataCallBack = getVehiclePlanRecords; refreshDataCallBack = getVehiclePlanRecords;
break; break;
case "InspectionRecord":
friendlySource = "Inspection Record";
refreshDataCallBack = hideInspectionRecordTemplateModal;
} }
Swal.fire({ Swal.fire({
@ -1065,8 +1068,8 @@ function duplicateRecordsToOtherVehicles(ids, source) {
refreshDataCallBack = getVehiclePlanRecords; refreshDataCallBack = getVehiclePlanRecords;
break; break;
case "InspectionRecord": case "InspectionRecord":
friendlySource = "Inspection Records"; friendlySource = "Inspection Record";
refreshDataCallBack = getVehicleInspectionRecords; refreshDataCallBack = hideInspectionRecordTemplateModal;
} }
$.get(`/Home/GetVehicleSelector?vehicleId=${GetVehicleId().vehicleId}`, function (data) { $.get(`/Home/GetVehicleSelector?vehicleId=${GetVehicleId().vehicleId}`, function (data) {