Initial Commit.

This commit is contained in:
ivancheahhh
2023-12-31 20:24:44 -07:00
parent 91e379ca0d
commit 8e9d7760be
90 changed files with 74999 additions and 0 deletions

36
wwwroot/js/site.js Normal file
View File

@@ -0,0 +1,36 @@
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';
}
})
}

24
wwwroot/js/vehicle.js Normal file
View File

@@ -0,0 +1,24 @@
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';
}
})
}
//tap into tabchange
$(document).ready(function () {
var vehicleId = GetVehicleId().vehicleId;
getVehicleNote(vehicleId);
});
function getVehicleNote(vehicleId) {
$.get(`/Vehicle/GetNoteByVehicleId?vehicleId=${vehicleId}`, function (data) {
if (data) {
$("#noteTextArea").val(data);
}
});
}