54 lines
1.3 KiB
Plaintext
54 lines
1.3 KiB
Plaintext
@using CarShowroomDataModels.Views
|
||
@{
|
||
ViewData["Title"] = "ClientUpdate";
|
||
}
|
||
<div class="text-center">
|
||
<h2 class="display-4">Редактирование данных клиента</h2>
|
||
</div>
|
||
<form method="post">
|
||
<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>
|
||
<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">
|
||
<input type="submit" value="Cохранить данные"
|
||
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>
|
||
} |