Added Confirmation before deleting vehicle, started work on collisions.
This commit is contained in:
@@ -49,12 +49,33 @@ function getVehicleServiceRecords(vehicleId) {
|
||||
}
|
||||
})
|
||||
}
|
||||
function DeleteVehicle(vehicleId) {
|
||||
$.post('/Vehicle/DeleteVehicle', { vehicleId: vehicleId }, function (data) {
|
||||
function editVehicle(vehicleId) {
|
||||
$.get(`/Vehicle/GetEditVehiclePartialViewById?vehicleId=${vehicleId}`, function (data) {
|
||||
if (data) {
|
||||
window.location.href = '/Home';
|
||||
$("#editVehicleModalContent").html(data);
|
||||
$('#editVehicleModal').modal('show');
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
function hideEditVehicleModal() {
|
||||
$('#editVehicleModal').modal('hide');
|
||||
}
|
||||
function deleteVehicle(vehicleId) {
|
||||
Swal.fire({
|
||||
title: "Confirm Deletion?",
|
||||
text: "This will also delete all data tied to this vehicle. Deleted Vehicles and their associated data cannot be restored.",
|
||||
showCancelButton: true,
|
||||
confirmButtonText: "Delete",
|
||||
confirmButtonColor: "#dc3545"
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.post('/Vehicle/DeleteVehicle', { vehicleId: vehicleId }, function (data) {
|
||||
if (data) {
|
||||
window.location.href = '/Home';
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
function getVehicleGasRecords(vehicleId) {
|
||||
$.get(`/Vehicle/GetGasRecordsByVehicleId?vehicleId=${vehicleId}`, function (data) {
|
||||
|
||||
Reference in New Issue
Block a user