@using FurnitureAssemblyContracts.ViewModels

@model List<SetViewModel>

@{
    ViewData["Title"] = "Формирование гарнитуров";
}

<div class="text-center">
    <h1 class="display-4">Гарнитуры</h1>
</div>

<div class="text-center">
    @{
        if (Model == null)
        {
            <h3 class="display-4">Авторизируйтесь</h3>
            return;
        }

        
        <form method="post">
            <div>
                <div class="form-check form-check-inline">
                    <input class="form-check-input" type="radio" name="type" value="docx" id="docx">
                    <label class="form-check-label" for="docx">
                        В docx
                    </label>
                </div>
                <div class="form-check form-check-inline">
                    <input class="form-check-input" type="radio" name="type" value="xlsx" id="xlsx" checked>
                    <label class="form-check-label" for="xlsx">
                        В xlsx
                    </label>
                </div>
            </div>
            <table class="table">
                <thead>
                    <tr>
                        <th>
                        
                        </th>
                        <th>
                            Название
                        </th>
                        <th>
                            Стоимость
                        </th>
                        <th>
                            Дата создания
                        </th>
                    </tr>
                </thead>
                <tbody>
                    @foreach (var item in Model)
                    {
                    <tr>
                        <td>
                                <input type="checkbox" class="form-check-input" name="setIds[]" value="@item.Id" id="@item.Id">
                        </td>
                        <td>
                                @Html.DisplayFor(modelItem => item.Name)
                        </td>
                        <td>
                                @Html.DisplayFor(modelItem => item.Cost)
                        </td>
                        <td>
                                @Html.DisplayFor(modelItem => item.DateCreate)
                        </td>
                    </tr>
                    }
                </tbody>
            </table>
            <button class="btn btn-primary" type="submit">Сгенерировать</button>
        </form>
    }
</div>