2024-05-27 17:32:21 +04:00
|
|
|
@using UniversityContracts.ViewModels
|
|
|
|
@model List<StudentViewModel>
|
|
|
|
@{
|
2024-04-29 19:06:11 +04:00
|
|
|
ViewData["Title"] = "Manage Students";
|
|
|
|
}
|
|
|
|
|
|
|
|
<div class="text-center">
|
|
|
|
<h2 class="display-4">@ViewData["Title"]</h2>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<form method="post">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-4">Name:</div>
|
|
|
|
<div class="col-8">
|
|
|
|
<input type="text" name="name" id="name" class="form-control" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-4">Plan Of Study:</div>
|
|
|
|
<div class="col-8">
|
|
|
|
<select name="planOfStudy" id="planOfStudy" class="form-control" multiple asp-items="ViewBag.PlanOfStudys"></select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-4">Phone number:</div>
|
|
|
|
<div class="col-8">
|
|
|
|
<textarea id="phoneNumber" name="phoneNumber" class="form-control"></textarea>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-8"></div>
|
|
|
|
<div class="col-4">
|
|
|
|
<input type="submit" value="Create Student" class="btn btn-primary" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
|
|
|
|
<table class="table">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
2024-05-27 17:32:21 +04:00
|
|
|
<th>Id</th>
|
2024-04-29 19:06:11 +04:00
|
|
|
<th>Name</th>
|
|
|
|
<th>Plan of study</th>
|
|
|
|
<th>Phone number</th>
|
|
|
|
<th>Actions</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
2024-05-27 17:32:21 +04:00
|
|
|
@foreach (var student in Model)
|
2024-04-29 19:06:11 +04:00
|
|
|
{
|
|
|
|
<tr>
|
|
|
|
<td>
|
2024-05-27 17:32:21 +04:00
|
|
|
@Html.DisplayFor(modelItem => student.Id)
|
2024-04-29 19:06:11 +04:00
|
|
|
</td>
|
|
|
|
<td>
|
2024-05-27 17:32:21 +04:00
|
|
|
@Html.DisplayFor(modelItem => student.Name)
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
@Html.DisplayFor(modelItem => student.PlanOfStudyId)
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
@Html.DisplayFor(modelItem => student.PhoneNumber)
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<a asp-controller="Home" asp-action="" asp-route-id="@student.Id" class="btn btn-warning">Изменить</a>
|
|
|
|
<form asp-controller="Home" asp-action="DeletePlanOfStudy" method="post">
|
|
|
|
<input type="hidden" name="id" value="@student.Id" />
|
|
|
|
<button type="submit" class="btn btn-danger">Удалить</button>
|
|
|
|
</form>
|
2024-04-29 19:06:11 +04:00
|
|
|
</td>
|
|
|
|
</tr>
|
2024-05-27 17:32:21 +04:00
|
|
|
}
|
2024-04-29 19:06:11 +04:00
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|