SUBD_PIbd-23_ZakharovRA/CarShowroom/CarShowroomManagerApp/Views/Home/ClientUpdate.cshtml

54 lines
1.3 KiB
Plaintext
Raw Normal View History

2024-05-12 16:54:11 +04:00
@using CarShowroomDataModels.Views
@{
ViewData["Title"] = "ClientUpdate";
}
<div class="text-center">
<h2 class="display-4">Редактирование данных клиента</h2>
</div>
<form method="post">
2024-05-13 14:36:30 +04:00
<div class="row">
<div class="col-4">Клиент:</div>
<div class="col-8">
<select name="client" id="client" class="form-control"
asp-items="@(new SelectList(@ViewBag.Clients, "Id", "Name"))"></select>
</div>
</div>
2024-05-12 16:54:11 +04:00
<div class="row">
<div class="col-4">Номер телефона:</div>
<div class="col-8"><input type="text" name="phonenumber" /></div>
</div>
<div class="row">
<div class="col-4">ФИО:</div>
<div class="col-8"><input type="text" name="name" /></div>
</div>
<div class="row">
<div class="col-8"></div>
<div class="col-4">
2024-05-13 14:36:30 +04:00
<input type="submit" value="Cохранить данные"
2024-05-12 16:54:11 +04:00
class="btn btn-primary" />
</div>
</div>
</form>
@section Scripts
{
<script>
function check() {
var client = $('#client').val();
if (client) {
$.ajax({
method: "GET",
url: "/Home/GetClient",
data: { clientId: client },
success: function (result) {
$('#number').val(result.item1.number);
}
});
};
}
check();
$('#client').on('change', function () {
check();
});
</script>
}