Initial Commit.
This commit is contained in:
36
wwwroot/js/site.js
Normal file
36
wwwroot/js/site.js
Normal 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
24
wwwroot/js/vehicle.js
Normal 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);
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user