SUBD/ForumUserApp/Views/Home/HardRequest.cshtml

76 lines
1.6 KiB
Plaintext
Raw Normal View History

2023-05-05 18:44:46 +04:00
@using ForumContracts.ViewModels
@model List<QuestionViewModel>
@{
ViewData["Title"] = "HardRequest Page";
}
<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 class="row">
<div class="col-4">С:</div>
<div class="col-8"><input type="date" name="dateFrom" /></div>
</div>
<div class="row">
<div class="col-4">По:</div>
<div class="col-8"><input type="date" name="dateTo" /></div>
</div>
<div class="row">
<div class="col-8"></div>
<div class="col-4"><input type="submit" value="Показать" class="btn btn-primary" /></div>
</div>
</form>
<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.CreateDate)
</td>
<td>
@Html.DisplayFor(modelItem => item.UserName)
</td>
<td>
@Html.DisplayFor(modelItem => item.CategoryName)
</td>
<td>
@Html.DisplayFor(modelItem => item.QuestionDes)
</td>
</tr>
}
</tbody>
</table>
}
</div>