add edit users for admin

This commit is contained in:
2024-08-10 17:10:45 +03:30
parent f71b11c131
commit 4ffc4197aa
15 changed files with 116 additions and 25 deletions

View File

@ -0,0 +1,49 @@
@model WebApplication1.Models.user
@{
ViewBag.Title = "Edituser";
}
<h2>Edituser</h2>
@using (Html.BeginForm())
{
@Html.AntiForgeryToken()
<div class="form-horizontal">
<h4>user</h4>
<hr />
@Html.ValidationSummary(true, "", new { @class = "text-danger" })
@Html.HiddenFor(model => model.ID)
<div class="form-group">
@Html.LabelFor(model => model.displayname, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.displayname, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.displayname, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.role, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
<select name="role" class="form-control">
<option value="0">User</option>
<option value="2">Admin</option>
</select>
@Html.ValidationMessageFor(model => model.role, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
<div class="col-md-offset-2 col-md-10">
<input type="submit" value="Save" class="btn btn-default" />
</div>
</div>
</div>
}
<div>
@Html.ActionLink("Back to List", "Index")
</div>