54 lines
2.0 KiB
Plaintext
54 lines
2.0 KiB
Plaintext
@using ServiceStationContracts.ViewModels;
|
|
@using ServiceStationDataModels.Models;
|
|
|
|
@{
|
|
ViewData["Title"] = "AddCarToDefect";
|
|
}
|
|
|
|
@model Tuple<List<DefectViewModel>, List<CarViewModel>>
|
|
|
|
<div class="container">
|
|
<h2>Добавление машин к неисправностям:</h2>
|
|
<form method="post">
|
|
<div class="form-group">
|
|
<label for="defect">Выберите неисправность</label>
|
|
<select id="defect" name="defect" class="form-control">
|
|
@foreach (var defect in Model.Item1)
|
|
{
|
|
<option value="@defect.Id">@Html.DisplayFor(modelItem => defect.DefectType)</option>
|
|
}
|
|
</select>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="car">Выберите машины</label>
|
|
<table class="table mb-0">
|
|
<thead>
|
|
<tr>
|
|
<th scope="col"></th>
|
|
<th scope="col">Номер</th>
|
|
<th scope="col">Марка</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach (var car in Model.Item2)
|
|
{
|
|
<tr>
|
|
<td class="align-middle">
|
|
<div class="form-check">
|
|
<input type="checkbox" class="form-check-input" name="car[]" value="@car.Id" id="@car.Id">
|
|
</div>
|
|
</td>
|
|
<td class="align-middle">@Html.DisplayFor(modelItem => car.CarNumber)</td>
|
|
<td class="align-middle">@Html.DisplayFor(modelItem => car.CarBrand)</td>
|
|
</tr>
|
|
}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<br>
|
|
<div>
|
|
<input type="submit" value="Добавить" class="btn btn-secondary" />
|
|
</div>
|
|
</form>
|
|
</div>
|