Mini.Crm/Mini.Web/Areas/Admin/Views/InnerUser/Edit.cshtml

175 lines
7.3 KiB
Plaintext

@model Air.Model.AirAdminViewModel.Bas_InnerUserEidtModel
@using Mini.Web.WebHelper;
@{
ViewBag.Title = "Edit";
Layout = "~/Areas/Admin/Views/Shared/_Index_LayoutEdit.cshtml";
}
<style>
fieldset {
margin: 10px;
width: inherit;
}
</style>
<script type="text/javascript">
$(function () {
$("#btnSave").click(function () {
if ($("#CreateForm").valid()) {
$.r_ajax({
url: "Edit",
type: "Post",
data: $("#CreateForm").serialize(),
dataType: "json",
loading: true,
success: function (data) {
if (data.type == 1) {
window.parent.frameReturnByMes(data.message);
window.parent.frameReturnByReload(true);
window.parent.frameReturnByClose()
}
else {
window.parent.frameReturnByMes(data.message);
}
}
});
}
return false;
});
});
function SaveChild() {
$("#btnSave").click();
}
</script>
<div style="border: 1px #cccccc solid;width:100%;height:100%;">
<div class="mvctool bgb">
@Html.ToolButtonPlain("btnSave", "icon-save", "保存", false, "")
@Html.ToolButtonPlain("btnClose", "icon-remove", "关闭", false, "onClick='window.parent.frameReturnByClose()'")
</div>
<div style=" height: 80%; width: 100%;overflow-y: auto">
<form id="CreateForm">
@Html.ValidationSummary(true)
<fieldset>
<legend>员工基本信息</legend>
<table class="fromEditTable setTextWidth300">
<tbody>
<tr>
<td width="60px" style="width: 100px;">
姓名
</td>
<td style="width: 310px">
@Html.TextBoxFor(m => m.uname)
@Html.HiddenFor(m => m.uid)
</td>
<td width="120px">
@Html.ValidationMessageFor(m => m.uname)
</td>
</tr>
<tr>
<td width="60px" style="width:100px;">
账号
</td>
<td style="width: 310px">
@if (Model.uid == 0)
{
@Html.TextBoxFor(m => m.eid)
}
else
{
@Html.DisplayTextFor(m => m.eid)
@Html.HiddenFor(m => m.eid)
}
</td>
<td width="120px">
@Html.ValidationMessageFor(m => m.eid)
</td>
</tr>
<tr>
<td width="60px" style="width:100px;">
性别
</td>
<td style="width:310px">
@Html.RadioButtonFor(m => m.gender, "m")
@Html.RadioButtonFor(m => m.gender, "f")
</td>
<td width="120px">
@Html.ValidationMessageFor(m => m.gender)
</td>
</tr>
<tr>
<td width="60px" style="width:100px;">
生日
</td>
<td style="width:310px">
@Html.TextBoxFor(m => m.birthday, new
{
Value = (Model.birthday == DateTime.MinValue ? DateTime.Now.ToString("yyyy-MM-dd") : Model.birthday.Value.ToString("yyyy-MM-dd")),
ControlToValidate = "BIRTHDAY",
ErrorMessage = "*日期格式不对",
ValidationExpression = "\\d{4}-\\d{1,2}-\\d{1,2}",
onclick = "WdatePicker()",
@class = "Wdate"
})
</td>
<td width="120px">
@Html.ValidationMessageFor(m => m.birthday)
</td>
</tr>
<tr>
<td width="60px" style="width:100px;">
密码
</td>
<td style="width:310px">
@if (Model.uid == 0)
{
@Html.PasswordFor(m => m.passwd, new { style = "width:300px;" })
}
else
{
@Html.PasswordFor(m => m.passwd, new { style = "width:300px;" })
}
</td>
<td width="120px">
@if (Model.uid == 0)
{
@Html.ValidationMessageFor(m => m.passwd)
}
else
{
@Html.ValidationMessageFor(m => m.passwd)
}
</td>
</tr>
<tr>
<td width="60px" style="width:100px;">
重复输入密码
</td>
<td style="width:310px">
@if (Model.uid == 0)
{
@Html.PasswordFor(m => m.passwd2, new { style = "width:300px;" })
}
else
{
@Html.PasswordFor(m => m.passwd2, new { style = "width:300px;" })
}
</td>
<td width="120px">
@if (Model.uid == 0)
{
@Html.ValidationMessageFor(m => m.passwd2)
}
else
{
@Html.ValidationMessageFor(m => m.passwd2)
}
</td>
</tr>
</tbody>
</table>
</fieldset>
</form>
</div>
</div>