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);
}
break;
case ImportMode.InspectionRecord:
{
var existingRecord = _inspectionRecordTemplateDataAccess.GetInspectionRecordTemplateById(recordId);
existingRecord.Id = default;
existingRecord.ReminderRecordId = new List<int>();
result = _inspectionRecordTemplateDataAccess.SaveInspectionReportTemplateToVehicle(existingRecord);
}
break;
}
}
if (result)

View File

@ -63,6 +63,7 @@
<span class="visually-hidden">Toggle Dropdown</span>
</button>
<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>
</ul>
</div>

View File

@ -449,3 +449,8 @@ function duplicateInspectionRecordTemplateToVehicle() {
inspectionRecordsIds.push(getInspectionRecordModelData().id);
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";
refreshDataCallBack = getVehiclePlanRecords;
break;
case "InspectionRecord":
friendlySource = "Inspection Record";
refreshDataCallBack = hideInspectionRecordTemplateModal;
}
Swal.fire({
@ -1065,8 +1068,8 @@ function duplicateRecordsToOtherVehicles(ids, source) {
refreshDataCallBack = getVehiclePlanRecords;
break;
case "InspectionRecord":
friendlySource = "Inspection Records";
refreshDataCallBack = getVehicleInspectionRecords;
friendlySource = "Inspection Record";
refreshDataCallBack = hideInspectionRecordTemplateModal;
}
$.get(`/Home/GetVehicleSelector?vehicleId=${GetVehicleId().vehicleId}`, function (data) {