@using FHT.Utilities @model FHT.Agency.UI.InputModels.CreateAccountInputModel @{ ViewBag.Title = "新增人员"; Layout = "~/Views/Shared/_Layout.cshtml"; } @using (Html.BeginForm("CreateChannelUser", "Authorization", null, FormMethod.Post, new { @class = "form-horizontal", role = "form" })) {
@Html.AntiForgeryToken()
@Html.RequiredLabelFor(l => l.UserName, new { @class = "col-md-2 control-label" })
@Html.TextBoxFor(m => m.UserName,new { @class = "form-control" }) @Html.ValidationMessageFor(m => m.UserName)
@Html.RequiredLabelFor(l => l.Password, new { @class = "col-md-2 control-label" })
@Html.EditorFor(m => m.Password) @Html.ValidationMessageFor(m => m.Password)
@Html.RequiredLabelFor(l => l.Role, new { @class = "col-md-2 control-label" })
@{ var roles = ((IEnumerable)ViewBag.Roles).ToList(); roles.Insert(0, new SelectListItem { Text = "选择用户角色", Disabled = true, }); } @Html.DropDownList("Role", roles, new { @class = "form-control select2 ", style = "padding-left:10px;" })
@Html.CascadingDropDownListFor( expression: m => m.ParentId, triggeredByProperty: m => m.Role, //Parent property that trigers dropdown data loading url: Url.Action("GetUsersOfRole", "Authorization"), //Url of action that returns dropdown data parentIdParameterName: "role", //Parameter name for the selected parent value that url action receives optionLabel: "所属上级", // Option label disabledWhenParentNotSelected: false, //If true, disables dropdown until parrent dropdown selected htmlAttributes: new { @class = "form-control select2 ", style = "padding-left:10px;" }) @Html.ValidationMessageFor(e => e.ParentId)
@Html.RequiredLabelFor(l => l.DescriptiveName, new { @class = "col-md-2 control-label" })
@Html.TextBoxFor(m => m.DescriptiveName, new { @class= "form-control" }) @Html.ValidationMessageFor(m => m.DescriptiveName)
@Html.RequiredLabelFor(l => l.Mobile, new { @class = "col-md-2 control-label" })
@Html.EditorFor(m => m.Mobile, new { htmlAttributes = new { @readonly = "readonly" } }) @Html.ValidationMessageFor(m => m.Mobile)
@Html.RequiredLabelFor(l => l.Telephone, new { @class = "col-md-2 control-label" })
@Html.EditorFor(m => m.Telephone, new { htmlAttributes = new { @readonly = "readonly" } }) @Html.ValidationMessageFor(m => m.Telephone)
}