@using HotelContracts.ViewModels;
@using HotelDataModels.Models;

@{
    ViewData["Title"] = "AddDinnerToRoom";
}

@model Tuple<List<RoomViewModel>, List<DinnerViewModel>>

<div class="container">
    <h2>Добавление обедов в номер</h2>
    <form method="post">
        <div class="form-group">
            <label for="room">Выберите номер</label>
            <select id="room" name="room" class="form-control">
                @foreach (var room in Model.Item1)
                {
                    <option value="@room.Id">@Html.DisplayFor(modelItem => room.RoomName)</option>
                }
            </select>
        </div>
        <div class="form-group">
            <label for="dinner">Выберите обеды</label>
            <div class="card">
                <div class="card-body p-0">
                    <div class="table-responsive">
                        <table class="table mb-0">
                            <thead>
                                <tr>
                                    <th scope="col"></th>
                                    <th scope="col">Наименование</th>
                                    <th scope="col">Цена</th>
                                </tr>
                            </thead>
                            <tbody>
                                @foreach (var item in Model.Item2)
                                {
                                    <tr>
                                        <td class="align-middle">
                                            <div class="form-check">
                                                <input type="checkbox" class="form-check-input" name="dinner[]" value="@item.Id" id="@item.Id">
                                            </div>
                                        </td>
                                        <td class="align-middle">@Html.DisplayFor(modelItem => item.DinnerName)</td>
                                        <td class="align-middle">@Html.DisplayFor(modelItem => item.DinnerPrice)</td>
                                    </tr>
                                }
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
              <br>
      <div class="u-container-layout u-container-layout-2">
        <input type="submit" value="Добавить" class="btn btn-outline-dark text-center d-flex justify-content-md-center" />
      </div>
    </form>
</div>