CourseWork_Bank/Bank/BankEmployeeApp/Views/Home/Operation.cshtml

47 lines
1.5 KiB
Plaintext

@using Microsoft.AspNetCore.Mvc.TagHelpers
@model BankContracts.ViewModels.OperationViewModel?
@{
ViewData["Title"] = Model == null ? "Создание операции" : "Изменение операции";
}
<div>
<h2 class="display-4">@ViewData["Title"]</h2>
</div>
<form method="post">
<div class="row mb-2">
<div class="col-2">Вид:</div>
<div class="col-sm-10">
<input type="text" class="form-control" name="Mark" id="Mark" placeholder="Вид">
</div>
</div>
<div class="row mb-2">
<div class="col-2">Тип:</div>
<div class="col-sm-10">
<input type="text" class="form-control" name="Model" id="Model" placeholder="Тип">
</div>
</div>
<div class="row mb-2">
<div class="col-2">Стоимость:</div>
<div class="col-sm-10">
<input type="text" class="form-control" name="Price" id="Price" placeholder="Стоимость">
</div>
</div>
<div class="text-center mb-2">
<input type="submit" value="Создать" class="btn btn-primary" id="submit"/>
</div>
</form>
@if (Model != null)
{
@section Scripts
{
<script>
$("#submit").val("Изменить");
$("#Mark").attr('readonly', true);
$("#Mark").val("@Html.Raw(Model.Mark)");
$("#Model").attr('readonly', true);
$("#Model").val("@Html.Raw(Model.Model)");
$("#Price").val("@Html.Raw(Model.Price)");
</script>
}
}