lubelog/wwwroot/js/site.js
2023-12-31 20:24:44 -07:00

36 lines
1023 B
JavaScript

function showAddVehicleModal() {
$('#addVehicleModal').modal('show');
}
function hideAddVehicleModal() {
$('#addVehicleModal').modal('hide');
}
function DeleteVehicle(vehicleId) {
$.post('/Vehicle/DeleteVehicle', { vehicleId: vehicleId }, function (data) {
if (data) {
window.location.href = '/Home';
}
})
}
$(document).ready(function () {
loadGarage();
});
//refreshable function to reload Garage PartialView
function loadGarage() {
$.get('/Home/Garage', function (data) {
$("#garageContainer").html(data);
});
}
function viewVehicle(vehicleId) {
window.location.href = `/Vehicle/Index?vehicleId=${vehicleId}`;
}
function returnToGarage() {
window.location.href = '/Home';
}
function saveVehicleNote(vehicleId) {
var noteText = $("#noteTextArea").val();
$.post('/Vehicle/SaveNoteToVehicle', { vehicleId: vehicleId, noteText: noteText }, function (data) {
if (data) {
//window.location.href = '/Home';
}
})
}