@using ComputerStoreContracts.ViewModels

@model List<RequestViewModel>

@{
    ViewData["Title"] = "Заявки";
}

<div class="text-center">
    <h1 class="display-4">Заявки</h1>
</div>

<div class="text-center">
    <p>
        <a asp-action="CreateRequest" class="nav-link">Создать заявку</a>
    </p>
    <table class="table">
        <thead>
            <tr>
                <th>Номер</th>
                <th>Дата</th>
                <th>Сборка</th>
                <th>Удалить заявку</th>
            </tr>
        </thead>
        <tbody>
            @foreach (var item in Model)
            {
                <tr>
                    <td>@Html.DisplayFor(modelItem => item.Id)</td>
                    <td>@Html.DisplayFor(modelItem => item.DateRequest)</td>
                    <td>@Html.DisplayFor(modelItem => item.AssemblyId)</td>
                    <td>
                        <a asp-action="DeleteRequest" asp-route-id="@item.Id" class="btn btn-danger">Удалить</a>
                    </td>
                </tr>
            }
        </tbody>
    </table>
</div>