LabWork05_Hard: Готово

This commit is contained in:
Safgerd 2023-04-23 23:47:21 +04:00
parent fe90954785
commit a41f1a5638
2 changed files with 8 additions and 8 deletions

1
.gitignore vendored
View File

@ -398,3 +398,4 @@ FodyWeavers.xsd
# JetBrains Rider
*.sln.iml
/AutomobilePlant/ImplementationExtensions

View File

@ -49,7 +49,6 @@
</div>
</form>
<script>
function getData() {
$.ajax({
method: "GET",
@ -57,19 +56,19 @@
data: { shopId: $('#shop').val()},
success: function (result) {
console.log(result)
$("#name").val(result.Name);
$("#openingDate").val(new Date(result.OpeningDate).toISOString().substring(0, 16));
$("#address").val(result.Address);
$("#count").val(result.MaxCountCars);
fillTable(result.CarCount);
$("#name").val(result.name);
$("#openingDate").val(new Date(result.openingDate).toISOString().substring(0, 16));
$("#address").val(result.address);
$("#count").val(result.maxCountCars);
fillTable(result.carCount);
}
});
}
function fillTable(CarCount) {
function fillTable(carCount) {
$("#carCount").empty();
for (var i = 0; i < CarCount.length; i++)
for (var i = 0; i < carCount.length; i++)
$("#carCount").append('<tr><td>' + carCount[i].item1 + '</td><td>' + carCount[i].item2 + '</td></tr>');
}
</script>