UsersController

This commit is contained in:
ani_konarcheva@abv.bg
2022-04-07 23:52:54 +03:00
parent 7a352c35f6
commit 4e25e34b99
14 changed files with 784 additions and 20 deletions

View File

@@ -0,0 +1,118 @@
@model Data.Entities.User
@{
ViewData["Title"] = "Create";
}
<h1>Create</h1>
<h4>User</h4>
<hr />
<div class="row">
<div class="col-md-4">
<form asp-action="Create">
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
<div class="form-group">
<label asp-for="FirstName" class="control-label"></label>
<input asp-for="FirstName" class="form-control" />
<span asp-validation-for="FirstName" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="LastName" class="control-label"></label>
<input asp-for="LastName" class="form-control" />
<span asp-validation-for="LastName" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="PersonalNumber" class="control-label"></label>
<input asp-for="PersonalNumber" class="form-control" />
<span asp-validation-for="PersonalNumber" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="Id" class="control-label"></label>
<input asp-for="Id" class="form-control" />
<span asp-validation-for="Id" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="UserName" class="control-label"></label>
<input asp-for="UserName" class="form-control" />
<span asp-validation-for="UserName" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="NormalizedUserName" class="control-label"></label>
<input asp-for="NormalizedUserName" class="form-control" />
<span asp-validation-for="NormalizedUserName" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="Email" class="control-label"></label>
<input asp-for="Email" class="form-control" />
<span asp-validation-for="Email" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="NormalizedEmail" class="control-label"></label>
<input asp-for="NormalizedEmail" class="form-control" />
<span asp-validation-for="NormalizedEmail" class="text-danger"></span>
</div>
<div class="form-group form-check">
<label class="form-check-label">
<input class="form-check-input" asp-for="EmailConfirmed" /> @Html.DisplayNameFor(model => model.EmailConfirmed)
</label>
</div>
<div class="form-group">
<label asp-for="PasswordHash" class="control-label"></label>
<input asp-for="PasswordHash" class="form-control" />
<span asp-validation-for="PasswordHash" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="SecurityStamp" class="control-label"></label>
<input asp-for="SecurityStamp" class="form-control" />
<span asp-validation-for="SecurityStamp" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="ConcurrencyStamp" class="control-label"></label>
<input asp-for="ConcurrencyStamp" class="form-control" />
<span asp-validation-for="ConcurrencyStamp" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="PhoneNumber" class="control-label"></label>
<input asp-for="PhoneNumber" class="form-control" />
<span asp-validation-for="PhoneNumber" class="text-danger"></span>
</div>
<div class="form-group form-check">
<label class="form-check-label">
<input class="form-check-input" asp-for="PhoneNumberConfirmed" /> @Html.DisplayNameFor(model => model.PhoneNumberConfirmed)
</label>
</div>
<div class="form-group form-check">
<label class="form-check-label">
<input class="form-check-input" asp-for="TwoFactorEnabled" /> @Html.DisplayNameFor(model => model.TwoFactorEnabled)
</label>
</div>
<div class="form-group">
<label asp-for="LockoutEnd" class="control-label"></label>
<input asp-for="LockoutEnd" class="form-control" />
<span asp-validation-for="LockoutEnd" class="text-danger"></span>
</div>
<div class="form-group form-check">
<label class="form-check-label">
<input class="form-check-input" asp-for="LockoutEnabled" /> @Html.DisplayNameFor(model => model.LockoutEnabled)
</label>
</div>
<div class="form-group">
<label asp-for="AccessFailedCount" class="control-label"></label>
<input asp-for="AccessFailedCount" class="form-control" />
<span asp-validation-for="AccessFailedCount" class="text-danger"></span>
</div>
<div class="form-group">
<input type="submit" value="Create" class="btn btn-primary" />
</div>
</form>
</div>
</div>
<div>
<a asp-action="Index">Back to List</a>
</div>
@section Scripts {
@{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
}

View File

@@ -0,0 +1,123 @@
@model Data.Entities.User
@{
ViewData["Title"] = "Delete";
}
<h1>Delete</h1>
<h3>Are you sure you want to delete this?</h3>
<div>
<h4>User</h4>
<hr />
<dl class="row">
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.FirstName)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.FirstName)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.LastName)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.LastName)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.PersonalNumber)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.PersonalNumber)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.UserName)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.UserName)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.NormalizedUserName)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.NormalizedUserName)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.Email)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.Email)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.NormalizedEmail)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.NormalizedEmail)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.EmailConfirmed)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.EmailConfirmed)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.PasswordHash)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.PasswordHash)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.SecurityStamp)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.SecurityStamp)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.ConcurrencyStamp)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.ConcurrencyStamp)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.PhoneNumber)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.PhoneNumber)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.PhoneNumberConfirmed)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.PhoneNumberConfirmed)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.TwoFactorEnabled)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.TwoFactorEnabled)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.LockoutEnd)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.LockoutEnd)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.LockoutEnabled)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.LockoutEnabled)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.AccessFailedCount)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.AccessFailedCount)
</dd>
</dl>
<form asp-action="Delete">
<input type="hidden" asp-for="Id" />
<input type="submit" value="Delete" class="btn btn-danger" /> |
<a asp-action="Index">Back to List</a>
</form>
</div>

View File

@@ -0,0 +1,120 @@
@model Data.Entities.User
@{
ViewData["Title"] = "Details";
}
<h1>Details</h1>
<div>
<h4>User</h4>
<hr />
<dl class="row">
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.FirstName)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.FirstName)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.LastName)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.LastName)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.PersonalNumber)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.PersonalNumber)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.UserName)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.UserName)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.NormalizedUserName)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.NormalizedUserName)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.Email)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.Email)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.NormalizedEmail)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.NormalizedEmail)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.EmailConfirmed)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.EmailConfirmed)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.PasswordHash)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.PasswordHash)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.SecurityStamp)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.SecurityStamp)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.ConcurrencyStamp)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.ConcurrencyStamp)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.PhoneNumber)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.PhoneNumber)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.PhoneNumberConfirmed)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.PhoneNumberConfirmed)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.TwoFactorEnabled)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.TwoFactorEnabled)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.LockoutEnd)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.LockoutEnd)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.LockoutEnabled)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.LockoutEnabled)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.AccessFailedCount)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.AccessFailedCount)
</dd>
</dl>
</div>
<div>
<a asp-action="Edit" asp-route-id="@Model.Id">Edit</a> |
<a asp-action="Index">Back to List</a>
</div>

View File

@@ -0,0 +1,114 @@
@model Data.Entities.User
@{
ViewData["Title"] = "Edit";
}
<h1>Edit</h1>
<h4>User</h4>
<hr />
<div class="row">
<div class="col-md-4">
<form asp-action="Edit">
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
<div class="form-group">
<label asp-for="FirstName" class="control-label"></label>
<input asp-for="FirstName" class="form-control" />
<span asp-validation-for="FirstName" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="LastName" class="control-label"></label>
<input asp-for="LastName" class="form-control" />
<span asp-validation-for="LastName" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="PersonalNumber" class="control-label"></label>
<input asp-for="PersonalNumber" class="form-control" />
<span asp-validation-for="PersonalNumber" class="text-danger"></span>
</div>
<input type="hidden" asp-for="Id" />
<div class="form-group">
<label asp-for="UserName" class="control-label"></label>
<input asp-for="UserName" class="form-control" />
<span asp-validation-for="UserName" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="NormalizedUserName" class="control-label"></label>
<input asp-for="NormalizedUserName" class="form-control" />
<span asp-validation-for="NormalizedUserName" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="Email" class="control-label"></label>
<input asp-for="Email" class="form-control" />
<span asp-validation-for="Email" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="NormalizedEmail" class="control-label"></label>
<input asp-for="NormalizedEmail" class="form-control" />
<span asp-validation-for="NormalizedEmail" class="text-danger"></span>
</div>
<div class="form-group form-check">
<label class="form-check-label">
<input class="form-check-input" asp-for="EmailConfirmed" /> @Html.DisplayNameFor(model => model.EmailConfirmed)
</label>
</div>
<div class="form-group">
<label asp-for="PasswordHash" class="control-label"></label>
<input asp-for="PasswordHash" class="form-control" />
<span asp-validation-for="PasswordHash" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="SecurityStamp" class="control-label"></label>
<input asp-for="SecurityStamp" class="form-control" />
<span asp-validation-for="SecurityStamp" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="ConcurrencyStamp" class="control-label"></label>
<input asp-for="ConcurrencyStamp" class="form-control" />
<span asp-validation-for="ConcurrencyStamp" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="PhoneNumber" class="control-label"></label>
<input asp-for="PhoneNumber" class="form-control" />
<span asp-validation-for="PhoneNumber" class="text-danger"></span>
</div>
<div class="form-group form-check">
<label class="form-check-label">
<input class="form-check-input" asp-for="PhoneNumberConfirmed" /> @Html.DisplayNameFor(model => model.PhoneNumberConfirmed)
</label>
</div>
<div class="form-group form-check">
<label class="form-check-label">
<input class="form-check-input" asp-for="TwoFactorEnabled" /> @Html.DisplayNameFor(model => model.TwoFactorEnabled)
</label>
</div>
<div class="form-group">
<label asp-for="LockoutEnd" class="control-label"></label>
<input asp-for="LockoutEnd" class="form-control" />
<span asp-validation-for="LockoutEnd" class="text-danger"></span>
</div>
<div class="form-group form-check">
<label class="form-check-label">
<input class="form-check-input" asp-for="LockoutEnabled" /> @Html.DisplayNameFor(model => model.LockoutEnabled)
</label>
</div>
<div class="form-group">
<label asp-for="AccessFailedCount" class="control-label"></label>
<input asp-for="AccessFailedCount" class="form-control" />
<span asp-validation-for="AccessFailedCount" class="text-danger"></span>
</div>
<div class="form-group">
<input type="submit" value="Save" class="btn btn-primary" />
</div>
</form>
</div>
</div>
<div>
<a asp-action="Index">Back to List</a>
</div>
@section Scripts {
@{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
}

View File

@@ -0,0 +1,131 @@
@model IEnumerable<Data.Entities.User>
@{
ViewData["Title"] = "Index";
}
<h1>Index</h1>
<p>
<a asp-action="Create">Create New</a>
</p>
<table class="table">
<thead>
<tr>
<th>
@Html.DisplayNameFor(model => model.FirstName)
</th>
<th>
@Html.DisplayNameFor(model => model.LastName)
</th>
<th>
@Html.DisplayNameFor(model => model.PersonalNumber)
</th>
<th>
@Html.DisplayNameFor(model => model.UserName)
</th>
<th>
@Html.DisplayNameFor(model => model.NormalizedUserName)
</th>
<th>
@Html.DisplayNameFor(model => model.Email)
</th>
<th>
@Html.DisplayNameFor(model => model.NormalizedEmail)
</th>
<th>
@Html.DisplayNameFor(model => model.EmailConfirmed)
</th>
<th>
@Html.DisplayNameFor(model => model.PasswordHash)
</th>
<th>
@Html.DisplayNameFor(model => model.SecurityStamp)
</th>
<th>
@Html.DisplayNameFor(model => model.ConcurrencyStamp)
</th>
<th>
@Html.DisplayNameFor(model => model.PhoneNumber)
</th>
<th>
@Html.DisplayNameFor(model => model.PhoneNumberConfirmed)
</th>
<th>
@Html.DisplayNameFor(model => model.TwoFactorEnabled)
</th>
<th>
@Html.DisplayNameFor(model => model.LockoutEnd)
</th>
<th>
@Html.DisplayNameFor(model => model.LockoutEnabled)
</th>
<th>
@Html.DisplayNameFor(model => model.AccessFailedCount)
</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach (var item in Model) {
<tr>
<td>
@Html.DisplayFor(modelItem => item.FirstName)
</td>
<td>
@Html.DisplayFor(modelItem => item.LastName)
</td>
<td>
@Html.DisplayFor(modelItem => item.PersonalNumber)
</td>
<td>
@Html.DisplayFor(modelItem => item.UserName)
</td>
<td>
@Html.DisplayFor(modelItem => item.NormalizedUserName)
</td>
<td>
@Html.DisplayFor(modelItem => item.Email)
</td>
<td>
@Html.DisplayFor(modelItem => item.NormalizedEmail)
</td>
<td>
@Html.DisplayFor(modelItem => item.EmailConfirmed)
</td>
<td>
@Html.DisplayFor(modelItem => item.PasswordHash)
</td>
<td>
@Html.DisplayFor(modelItem => item.SecurityStamp)
</td>
<td>
@Html.DisplayFor(modelItem => item.ConcurrencyStamp)
</td>
<td>
@Html.DisplayFor(modelItem => item.PhoneNumber)
</td>
<td>
@Html.DisplayFor(modelItem => item.PhoneNumberConfirmed)
</td>
<td>
@Html.DisplayFor(modelItem => item.TwoFactorEnabled)
</td>
<td>
@Html.DisplayFor(modelItem => item.LockoutEnd)
</td>
<td>
@Html.DisplayFor(modelItem => item.LockoutEnabled)
</td>
<td>
@Html.DisplayFor(modelItem => item.AccessFailedCount)
</td>
<td>
<a asp-action="Edit" asp-route-id="@item.Id">Edit</a> |
<a asp-action="Details" asp-route-id="@item.Id">Details</a> |
<a asp-action="Delete" asp-route-id="@item.Id">Delete</a>
</td>
</tr>
}
</tbody>
</table>