mirror of
https://github.com/hargata/lubelog.git
synced 2025-12-10 00:46:08 -06:00
add functionality to duplicate inspection record templates
This commit is contained in:
parent
2ab822af8f
commit
3f05f06824
@ -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)
|
||||||
|
|||||||
@ -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>
|
||||||
|
|||||||
@ -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');
|
||||||
}
|
}
|
||||||
@ -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,7 +1068,7 @@ function duplicateRecordsToOtherVehicles(ids, source) {
|
|||||||
refreshDataCallBack = getVehiclePlanRecords;
|
refreshDataCallBack = getVehiclePlanRecords;
|
||||||
break;
|
break;
|
||||||
case "InspectionRecord":
|
case "InspectionRecord":
|
||||||
friendlySource = "Inspection Records";
|
friendlySource = "Inspection Record";
|
||||||
refreshDataCallBack = getVehicleInspectionRecords;
|
refreshDataCallBack = getVehicleInspectionRecords;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user