@using FHT.Agency.CommonTypes @using FHT.Utilities @model FHT.Agency.UI.InputModels.UpdateUserInputModel @{ ViewBag.Title = "修改用户信息"; var fhtUserRoleTypes = EnumHelpers.Enum2Dictionary().OrderBy(m => m.Key); var userRoleTypes = fhtUserRoleTypes.Select(r => new SelectListItem { Value = r.Key.ToInt().ToString(), Text = r.Value, }); } @using (Html.BeginForm("UpdateUser", "Authorization", null, FormMethod.Post, new { @class = "form-horizontal", role = "form" })) { @Html.AntiForgeryToken() @Html.ValidationSummary(false, "", new { @class = "text-danger" }) @Html.HiddenFor(m => m.UserId) @Html.HiddenFor(m => m.Role)
@Html.RequiredLabelFor(m => m.Role, new { @class = "col-md-2 control-label" })
@Html.DropDownListFor(m => m.Role, userRoleTypes, new {@class = "form-control ", style = "padding-left:10px;", @disabled = "disabled"}) @Html.ValidationMessageFor(m => m.Role)
@Html.RequiredLabelFor(m => m.DescriptiveName, new { @class = "col-md-2 control-label" })
@Html.EditorFor(m => m.DescriptiveName) @Html.ValidationMessageFor(m => m.DescriptiveName)
@Html.RequiredLabelFor(m => m.Mobile, new { @class = "col-md-2 control-label" })
@Html.EditorFor(m => m.Mobile) @Html.ValidationMessageFor(m => m.Mobile)
@Html.RequiredLabelFor(m => m.Telephone, new { @class = "col-md-2 control-label" })
@Html.EditorFor(m => m.Telephone) @Html.ValidationMessageFor(m => m.Telephone)
if (Model.Role != FhtUserRoleType.Administrator) {
@Html.RequiredLabelFor(m => m.LockoutStatus, new { @class = "col-md-2 control-label" })
@Html.EditorFor(m => m.LockoutStatus) @Html.ValidationMessageFor(m => m.LockoutStatus)
} }