Работает, но выводит тока ID

This commit is contained in:
Кашин Максим 2023-05-18 15:31:21 +04:00
parent 6fb7d5e29b
commit 0136307b4e
3 changed files with 15 additions and 7 deletions

View File

@ -552,7 +552,7 @@ namespace HostrelHeadwaiterApp.Controllers
NameHall = conferenceBookingElem.NameHall, NameHall = conferenceBookingElem.NameHall,
HeadwaiterId = conferenceBookingElem.HeadwaiterId, HeadwaiterId = conferenceBookingElem.HeadwaiterId,
}); });
Response.Redirect("ListConferences"); Response.Redirect("ListConferenceBookings");
} }
} }
} }

View File

@ -7,19 +7,19 @@
<form method="post"> <form method="post">
<div class="u-form-group u-form-name u-label-top"> <div class="u-form-group u-form-name u-label-top">
<label class="u-label u-text-custom-color-1 u-label-1">План питания: </label> <label class="u-label u-text-custom-color-1 u-label-1">Конференция: </label>
<div class="u-input u-input-rectangle"> <div class="u-input u-input-rectangle">
<select id="conference" name="conference" class="form-control" asp-items="@(new SelectList(@ViewBag.Conferences, "Id", "ConferenceName"))"></select> <select id="conference" name="conference" class="form-control" asp-items="@(new SelectList(@ViewBag.Conferences, "Id", "ConferenceName"))"></select>
</div> </div>
</div> </div>
<div class="u-form-group u-form-name u-label-top"> <div class="u-form-group u-form-name u-label-top">
<label class="u-label u-text-custom-color-1 u-label-1">Комната: </label> <label class="u-label u-text-custom-color-1 u-label-1">Зал концеренций: </label>
<div class="u-input u-input-rectangle"> <div class="u-input u-input-rectangle">
<select id="conferenceBooking" name="conferenceBooking" class="form-control" asp-items="@(new SelectList(@ViewBag.ConferenceBookings, "Id", "NameHall"))"></select> <select id="conferenceBooking" name="conferenceBooking" class="form-control" asp-items="@(new SelectList(@ViewBag.ConferenceBookings, "Id", "NameHall"))"></select>
</div> </div>
</div> </div>
<div class="u-align-right u-form-group u-form-submit u-label-top"> <br>
<div class="col-8"></div> <div class="u-container-layout u-container-layout-2">
<div class="col-4"><input type="submit" value="Добавить комнату" class="u-active-custom-color-6 u-border-none u-btn u-btn-submit u-button-style u-custom-color-1 u-hover-custom-color-2 u-btn-1" /></div> <input type="submit" value="Добавить конференцию" class="btn btn-outline-dark text-center d-flex justify-content-md-center" />
</div> </div>
</form> </form>

View File

@ -25,6 +25,9 @@
<th class="u-border-1 u-border-grey-50 u-table-cell"> <th class="u-border-1 u-border-grey-50 u-table-cell">
Название зала Название зала
</th> </th>
<th class="u-border-1 u-border-grey-50 u-table-cell">
Название конференций
</th>
</tr> </tr>
</thead> </thead>
<tbody class="u-table-body"> <tbody class="u-table-body">
@ -39,6 +42,11 @@
class="u-border-1 u-border-grey-40 u-border-no-left u-border-no-right u-table-cell" class="u-border-1 u-border-grey-40 u-border-no-left u-border-no-right u-table-cell"
> >
@Html.DisplayFor(modelItem => item.NameHall) @Html.DisplayFor(modelItem => item.NameHall)
</td>
<td
class="u-border-1 u-border-grey-40 u-border-no-left u-border-no-right u-table-cell"
>
@Html.DisplayFor(modelItem => item.ConferenceId)
</td> </td>
</tr> </tr>
} }