71 lines
1.8 KiB
Plaintext
71 lines
1.8 KiB
Plaintext
@using ComputerShopContracts.ViewModels
|
|
|
|
@{
|
|
ViewData["Title"] = "CreateAssembly";
|
|
}
|
|
<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 id="component" name="component" class="form-control" asp-items="@(new SelectList(@ViewBag.Components,"Id", "ComponentName"))"></select>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-4">Количество:</div>
|
|
<div class="col-8"><input type="text" name="count" id="count" /></div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-4">Сумма:</div>
|
|
<div class="col-8"><input type="text" id="sum" name="sum" readonly /></div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-8"></div>
|
|
<div class="col-4"><input type="submit" value="Добавить компонент" class="btn btn-primary" /></div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-8"></div>
|
|
<div class="col-4"><input type="submit" value="Создать сборку" class="btn btn-primary" /></div>
|
|
</div>
|
|
</form>
|
|
|
|
<div class="text-center">
|
|
<h1 class="display-4">Список компонентов</h1>
|
|
</div>
|
|
<div class="text-center">
|
|
@{
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>
|
|
Номер
|
|
</th>
|
|
<th>
|
|
Компонент
|
|
</th>
|
|
<th>
|
|
Цена
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach (var item in (ViewBag.CurrentComponents as IEnumerable<ComponentViewModel>))
|
|
{
|
|
<tr>
|
|
<td>
|
|
@Html.DisplayFor(modelItem => item.Id)
|
|
</td>
|
|
<td>
|
|
@Html.DisplayFor(modelItem => item.ComponentName)
|
|
</td>
|
|
<td>
|
|
@Html.DisplayFor(modelItem => item.Cost)
|
|
</td>
|
|
</tr>
|
|
}
|
|
</tbody>
|
|
</table>
|
|
}
|
|
</div> |