@using FHT.Agency.CommonTypes @using FHT.Agency.UI.InputModels.Search @using FHT.Utilities @using FHT.Agency.Web.Extensions @using FHT.Agency.UI.ViewModels @model SearchUserInputModel @{ ViewBag.Title = "用户管理"; var users = (FHT.DDD.QueryResult)ViewBag.Users; var userRoleTypes = EnumHelpers.Enum2Dictionary ().OrderBy(m => m.Key).Select(r => new SelectListItem { Value = r.Key.ToInt().ToString(), Text = r.Value, Selected = Model.Role.HasValue && Model.Role.Value == r.Key }).ToList(); userRoleTypes.InsertDefault(); }
@using (Html.BeginForm("Users", "Authorization", FormMethod.Get, new { role = "form" })) {
@Html.RequiredLabelFor(m=>m.Role,new{@class="pull-left fht-control-label"})
@Html.DropDownListFor(m => m.Role, userRoleTypes, new { @class = "form-control" })
@Html.RequiredLabelFor(m => m.UserName,new{@class="pull-left fht-control-label"})
@Html.TextBoxFor(m => m.UserName, new { @class = "form-control" })
}
@foreach (var user in users.Data) { }
编号 账号 姓名 代理商名称 角色 联系电话 锁定 操作
@user.UserId @user.UserName @user.DescriptiveName @(!string.IsNullOrEmpty(user.OrganizationName)? user.OrganizationName : "/") @user.Role.GetEnumDescription() @user.Mobile @if (user.AccountLockoutStatus == AccountLockoutStatus.UnLock) { @AccountLockoutStatus.UnLock.GetEnumDescription() } else { @AccountLockoutStatus.Lock.GetEnumDescription() } @* @user.AccountLockoutStatus*@ @if (User.UserRole() == FhtUserRoleType.Administrator) { @Html.ActionableAction("重置密码", "ResetPwdAsync", "Account", new { userId = user.UserId }, new ActionableOptions { AdditionalClasses = new[] { "btn-info "," btn-sm"," btn-warning" }, ConfirmTip = "确定重置此账号密码吗?" }) } 修改
@if ((users.TotalCount - 1) / Model.Limit > 0) { @Html.Pager(Model.Limit, Model.CurrPage, (int)users.TotalCount).Options(opt => { opt.Action("Users") .PageRouteValueKey("CurrPage") .AddRouteValue("UserName", Model.UserName) .AddRouteValue("Role", Model.Role.HasValue? Model.Role.ToInt().ToString():"") .SetNextPageText(">") .DisplayTemplate("BootstrapPagination") .SetPreviousPageText("<"); }) }