@using GBLab.Entities
@using GBLab.Common.Expand

@model T_User
@{
    // 模板视图
    Layout = "~/Areas/Manage/Views/DefaultSkin/Shared_Back/_Layout_ContentBase.cshtml";

    // 权限列表
    var actions = ViewData["actions"] as Dictionary<string, string>;

    // 树形链接
    string dataTreeUrl = ViewData["dataTreeUrl"].ToString();
    string dataDepartmentTreeUrl = ViewData["dataDepartmentTreeUrl"].ToString();
    string dataPostTreeUrl = ViewData["dataPostTreeUrl"].ToString();
}

@section Head{
}

@section JavaScript{
    @Html.Partial("~/Areas/Manage/Views/DefaultSkin/Shared_Back/_Layout_Head_Edit.cshtml")
}

<div data-options="region:'center',border:true">
    @using (Html.BeginForm("Action_Edit_Add", "User", new { action = "Post" }, FormMethod.Post, new { ID = "EditForm", name = "EditForm", fit = "true", style = "width:100%;height:100%;" }))
    {
        @*系统机制*@
        @Html.ValidationSummary()
        @Html.AntiForgeryToken()

        @*系统参数*@
        @Html.Hidden("IsNew", false)
        @Html.Hidden("ActionGUID", "")
        @Html.Hidden("Template", ViewData["Template"])
        @Html.Hidden("MvcMarkName", ViewData["MvcMarkName"])
        @Html.Hidden("MvcClassID", ViewData["MvcClassID"])

        @*字段隐藏*@
        @Html.HiddenFor(m => m.F_Id)
        @Html.HiddenFor(m => m.F_Guid)
        @Html.HiddenFor(m => m.F_MarkName)
        @Html.HiddenFor(m => m.F_TypeId)
        @Html.HiddenFor(m => m.F_TypeIds)
        @Html.HiddenFor(m => m.F_NameCard)

        @*视图展示*@
        <div class="easyui-tabs" data-options="border:false,fit:true,plain:true">
            <div title="基本信息" style="padding:6px;">
                <table class="table">
                    <tr>
                        <th class="tdright" style="width: 100px;">
                            ID GUID：<em></em>
                        </th>
                        <td colspan="5">
                            【@(Model.F_Id)】-【@(Model.F_Guid.ToString().ToUpper())】
                        </td>
                    </tr>
                    <tr>
                        <th class="tdright">
                            昵称：<em>*</em>
                        </th>
                        <td colspan="5">
                            @(Html.TextBoxFor(t => t.F_Name, new { @Class = "easyui-validatebox textbox w500 Title ", required = "true" }))
                        </td>
                    </tr>
                    <tr>
                        <th class="tdright">
                            信息状态：<em></em>
                        </th>
                        <td>
                            @Html.DropDownListFor(t => t.F_MarkStatus, GBLab.Common.Helper.SelectItem.GetSelectListItem(GBLab.Common.Utils.Dictionarys.IsStatus), new { @class = "easyui-combobox", @style = "width:120px;", @editable = "false" })
                        </td>
                    </tr>
                    @if (Model.F_Id <= 0)
                    {
                        <tr>
                            <th class="tdright">
                                账户：<em>*</em>
                            </th>
                            <td colspan="5">
                                @(Html.TextBoxFor(t => t.F_Account, new { @Class = "easyui-textbox w500 ", @data_options = "prompt:'请输入账户',readonly:false,disabled:false,validType:['length[0,30]']", required = "true" }))
                            </td>
                        </tr>
                    }
                    else
                    {
                        <tr>
                            <th class="tdright">
                                账户：<em>*</em>
                            </th>
                            <td colspan="5">
                                @(Html.TextBoxFor(t => t.F_Account, new { @Class = "easyui-textbox w500 ", @data_options = "prompt:'请输入账户',readonly:true,disabled:false,validType:['length[0,30]']", required = "true" }))
                            </td>
                        </tr>

                    }
                    @if (Model.F_Id <= 0)
                    {
                        <tr>
                            <th class="tdright">
                                密码：<em>*</em>
                            </th>
                            <td colspan="5">
                                @(Html.TextBoxFor(t => t.F_Password, new { @Class = "easyui-passwordbox w500 ", @data_options = "prompt:'请输入账户',readonly:false,disabled:false,validType:['length[0,30]']", required = "true" }))
                            </td>
                        </tr>
                    }
                    <tr>
                        <th class="tdright">
                            手机号码：<em>*</em>
                        </th>
                        <td colspan="5">
                            @(Html.TextBoxFor(t => t.F_Phone, new { Class = "easyui-textbox w500", @data_options = "prompt:'请输入手机号码',validType:['mobile']" }))
                        </td>
                    </tr>
                    <tr>
                        <th class="tdright">
                            固定电话：<em>*</em>
                        </th>
                        <td colspan="5">
                            @(Html.TextBoxFor(t => t.F_HomePhone, new { Class = "easyui-textbox w500", @data_options = "prompt:'请输入固定电话'" }))
                        </td>
                    </tr>
                    <tr>
                        <th class="tdright">
                            邮政编码：<em>*</em>
                        </th>
                        <td colspan="5">
                            @(Html.TextBoxFor(t => t.F_PostCode, new { Class = "easyui-textbox w500", @data_options = "prompt:'请输入邮政编码',validType:['zipCode']" }))
                        </td>
                    </tr>
                    <tr>
                        <th class="tdright">
                            邮箱：<em>*</em>
                        </th>
                        <td colspan="5">
                            @(Html.TextBoxFor(t => t.F_Email, new { Class = "easyui-textbox w500", @data_options = "prompt:'请输入邮箱',readonly:false,disabled:false,required:true,validType:['email','length[0,100]']" }))
                        </td>
                    </tr>
                    <tr>
                        <th class="tdright">
                            QQ：<em>*</em>
                        </th>
                        <td colspan="5">
                            @(Html.TextBoxFor(t => t.F_Qq, new { Class = "easyui-textbox w500" }))
                        </td>
                    </tr>
                    <tr>
                        <th class="tdright">
                            微信：<em>*</em>
                        </th>
                        <td colspan="5">
                            @(Html.TextBoxFor(t => t.F_WeiXin, new { Class = "easyui-textbox w500" }))
                        </td>
                    </tr>
                </table>
                <table class="table">
                    <tr>
                        <th class="tdright">
                            联系地址：<em>*</em>
                        </th>
                        <td>
                            @Html.TextBoxFor(t => t.F_HomeAddress, new { @class = "easyui-textbox", @data_options = "multiline:true,width:600,height:300" })
                            <p>
                                <span>剩余输入<b id="num_F_HomeAddress" style="color:#ff0000">160</b> 个字符</span>
                            </p>
                        </td>
                    </tr>
                    <tr>
                        <th class="tdright">
                            备注：<em>*</em>
                        </th>
                        <td>
                            @Html.TextBoxFor(m => m.F_Remark, new { @class = "easyui-textbox", @data_options = "multiline:true,width:600,height:300" })
                            <p>
                                <span>剩余输入<b id="num_F_Remark" style="color:#ff0000">160</b> 个字符</span>
                            </p>
                        </td>
                    </tr>
                </table>
            </div>
            <div title="配置信息" style="padding:6px;">
                <table class="table">
                    <tr>
                        <th class="tdright">
                            部门：<em>*</em>
                        </th>
                        <td colspan="5">
                            @(Html.TextBoxFor(t => t.F_DepartmentId, "", new { @class = "easyui-combotree textbox", @style = "width:300px;", @required = "false", @url = dataDepartmentTreeUrl }))
                            <script>$(function () { $('#F_DepartmentId').combotree('setValues', [@(Model.F_DepartmentId)]); });</script>
                            <span class="ico-Tree"></span>
                        </td>
                    </tr>
                    <tr>
                        <th class="tdright" style="width:200px;">
                            是否管理员：<em></em>
                        </th>
                        <td>
                            @Html.DropDownListFor(t => t.F_IsAdmin, GBLab.Common.Helper.SelectItem.GetSelectListItem(GBLab.Common.Utils.Dictionarys.TrueOrFalse), new { @class = "easyui-combobox", @style = "width:120px;", @editable = "false" })
                        </td>
                    </tr>
                    <tr>
                        <th class="tdright">
                            岗位：<em>*</em>
                        </th>
                        <td colspan="5">
                            @(Html.TextBoxFor(t => t.F_PostId, "", new { @class = "easyui-combotree textbox", @style = "width:300px;", @required = "false", @url = dataPostTreeUrl }))
                            <script>$(function () { $('#F_PostId').combotree('setValues', [@(Model.F_PostId)]); });</script>
                            <span class="ico-Tree"></span>
                        </td>
                    </tr>
                    <tr>
                        <th class="tdright" style="width:200px;">
                            是否部门管理员：<em></em>
                        </th>
                        <td>
                            @Html.DropDownListFor(t => t.F_IsDepartmentAdmin, GBLab.Common.Helper.SelectItem.GetSelectListItem(GBLab.Common.Utils.Dictionarys.TrueOrFalse), new { @class = "easyui-combobox", @style = "width:120px;", @editable = "false" })
                        </td>
                    </tr>
                </table>
                <table class="table">
                    <tr>
                        <th class="tdright" style="width:200px;">
                            是否创建HR档案：<em></em>
                        </th>
                        <td>
                            @Html.DropDownListFor(t => t.F_IsCreateHr, GBLab.Common.Helper.SelectItem.GetSelectListItem(GBLab.Common.Utils.Dictionarys.TrueOrFalse), new { @class = "easyui-combobox", @style = "width:120px;", @editable = "false" })
                        </td>
                    </tr>
                    <tr>
                        <th class="tdright" style="width:200px;">
                            是否后台添加：<em></em>
                        </th>
                        <td>
                            @Html.DropDownListFor(t => t.F_IsBackAdd, GBLab.Common.Helper.SelectItem.GetSelectListItem(GBLab.Common.Utils.Dictionarys.TrueOrFalse), new { @class = "easyui-combobox", @style = "width:120px;", @editable = "false" })
                        </td>
                    </tr>
                    <tr>
                        <th class="tdright" style="width:200px;">
                            允许登录：<em></em>
                        </th>
                        <td>
                            @Html.DropDownListFor(t => t.F_IsAllowLogin, GBLab.Common.Helper.SelectItem.GetSelectListItem(GBLab.Common.Utils.Dictionarys.TrueOrFalse), new { @class = "easyui-combobox", @style = "width:120px;", @editable = "false" })
                        </td>
                    </tr>
                </table>
            </div>
            <div title="个人相册" style="padding:6px;">
                <table class="table">
                    <tr>
                        <th class="tdright">
                            封面：<em></em>
                        </th>
                        <td>
                            @RenderPage("~/Areas/Manage/Views/DefaultSkin/Modules/00Common/Partial/_UploadImage.cshtml", new { ImgID = "F_Logo", ImgPath = Model.F_Logo.DefaultIsNullOrEmpty("").Replace("|", ""), ThumbnailsWidth = 240, ThumbnailsHeight = 180, ImgIsMultiple = 0, IsImageInclude = true })
                        </td>
                    </tr>
                    <tr>
                        <th class="tdright">
                            图片列表：<em></em>
                        </th>
                        <td>
                            @RenderPage("~/Areas/Manage/Views/DefaultSkin/Modules/00Common/Partial/_UploadImgs.cshtml", new { ImgID = "F_Imgs", ImgPath = Model.F_Imgs.DefaultIsNullOrEmpty("").Replace("|", ",") })
                        </td>
                    </tr>
                </table>
            </div>
            <div title="个人附件" style="padding:6px;">
                <table class="table">
                    <tr>
                        <th class="tdright" style="width: 100px;">
                            附件列表：<em></em>
                        </th>
                        <td colspan="5">
                            @RenderPage("~/Areas/Manage/Views/DefaultSkin/Modules/00Common/Partial/_UploadFiles.cshtml", new { FileID = "F_Files", FilePath = Model.F_Files.DefaultIsNullOrEmpty("").Replace("|", ",") })
                        </td>
                    </tr>
                </table>
            </div>
            <div title="注册登录" style="padding:6px;">

                <table class="table">
                    <tr>
                        <th class="tdright" style="width: 100px;">
                            注册日期：<em></em>
                        </th>
                        <td colspan="5">
                            @Html.TextBox("F_RegDate", Convert.ToDateTime(Model.F_RegDate).ToString("yyyy-MM-dd HH:mm:ss"), new { @class = "easyui-datetimebox textbox w160", @required = "true" })
                        </td>
                    </tr>
                    <tr>
                        <th class="tdright" style="width: 100px;">
                            注册IP：<em></em>
                        </th>
                        <td colspan="5">
                            @(Html.TextBoxFor(t => t.F_RegIp, new { Class = "easyui-textbox w500" }))
                        </td>
                    </tr>
                </table>

                <table class="table">
                    <tr>
                        <th class="tdright" style="width: 100px;">
                            最后登录日期：<em></em>
                        </th>
                        <td colspan="5">
                            @Html.TextBox("F_LastLoginDate", Convert.ToDateTime(Model.F_LastLoginDate).ToString("yyyy-MM-dd HH:mm:ss"), new { @class = "easyui-datetimebox textbox w160", @required = "true" })
                        </td>
                    </tr>
                    <tr>
                        <th class="tdright" style="width: 100px;">
                            最后登录Ip：<em></em>
                        </th>
                        <td colspan="5">
                            @(Html.TextBoxFor(t => t.F_LoginIp, new { Class = "easyui-textbox w500" }))
                        </td>
                    </tr>
                </table>

                <table class="table">
                    <tr>
                        <th class="tdright" style="width: 100px;">
                            登录次数：<em></em>
                        </th>
                        <td colspan="5">
                            @(Html.TextBoxFor(t => t.F_LoginNum, new { Class = "easyui-textbox w500" }))
                        </td>
                    </tr>
                    <tr>
                        <th class="tdright" style="width: 100px;">
                            禁止登录日期：<em></em>
                        </th>
                        <td colspan="5">
                            @Html.TextBox("F_LoginForbidDate", Convert.ToDateTime(Model.F_LastLoginDate).ToString("yyyy-MM-dd HH:mm:ss"), new { @class = "easyui-datetimebox textbox w160", @required = "true" })
                        </td>
                    </tr>
                </table>

                <table class="table">
                    <tr>
                        <th class="tdright" style="width: 100px;">
                            密码问题：<em></em>
                        </th>
                        <td colspan="5">
                            @(Html.TextBoxFor(t => t.F_PasswordQuestion, new { Class = "easyui-textbox w500" }))
                        </td>
                    </tr>
                    <tr>
                        <th class="tdright" style="width: 100px;">
                            密码答案：<em></em>
                        </th>
                        <td colspan="5">
                            @(Html.TextBoxFor(t => t.F_PasswordAnswer, new { Class = "easyui-textbox w500" }))
                        </td>
                    </tr>
                    <tr>
                        <th class="tdright" style="width: 100px;">
                            找回密码代码：<em></em>
                        </th>
                        <td colspan="5">
                            @(Html.TextBoxFor(t => t.F_PasswordCode, new { Class = "easyui-textbox w500" }))
                        </td>
                    </tr>
                    <tr>
                        <th class="tdright" style="width: 100px;">
                            密码录入错误次数：<em></em>
                        </th>
                        <td colspan="5">
                            @(Html.TextBoxFor(t => t.F_PasswordErrorNum, new { Class = "easyui-textbox w500" }))
                        </td>
                    </tr>
                </table>
            </div>
            <div title="辅助信息" style="padding:6px;">
                <table class="table">
                    <tr>
                        <th class="tdright" style="width: 100px;">
                            添加人：<em></em>
                        </th>
                        <td colspan="5">
                            @(Html.TextBox("F_AddUserId", Model.T_AddUser == null ? "" : Model.T_AddUser.F_Name, new { Class = "easyui-textbox w500", @readonly = "true" }))
                        </td>
                    </tr>
                    <tr>
                        <th class="tdright" style="width: 100px;">
                            添加日期：<em></em>
                        </th>
                        <td colspan="5">
                            @Html.TextBox("F_AddDate", Convert.ToDateTime(Model.F_AddDate).ToString("yyyy-MM-dd HH:mm:ss"), new { @class = "easyui-datetimebox textbox w160", @required = "true", @readonly = "true" })
                        </td>
                    </tr>
                    <tr>
                        <th class="tdright" style="width: 100px;">
                            更新人：<em></em>
                        </th>
                        <td colspan="5">
                            @(Html.TextBox("F_UpdateUserId", Model.T_UpdateUser == null ? "" : Model.T_UpdateUser.F_Name, new { Class = "easyui-textbox w500", @readonly = "true" }))
                        </td>
                    </tr>
                    <tr>
                        <th class="tdright" style="width: 100px;">
                            更新日期：<em></em>
                        </th>
                        <td colspan="5">
                            @Html.TextBox("F_UpdateDate", Convert.ToDateTime(Model.F_UpdateDate).ToString("yyyy-MM-dd HH:mm:ss"), new { @class = "easyui-datetimebox textbox w160", @required = "true", @readonly = "true" })
                        </td>
                    </tr>
                </table>
                <table class="table">
                    <tr>
                        <th class="tdright" style="width: 100px;">
                            浏览数量：<em></em>
                        </th>
                        <td colspan="5">
                            @(Html.TextBoxFor(t => t.F_ViewNum, new { Class = "easyui-textbox w500", @readonly = "true" }))
                        </td>
                    </tr>
                    <tr>
                        <th class="tdright" style="width: 100px;">
                            留言数量：<em></em>
                        </th>
                        <td colspan="5">
                            @(Html.TextBoxFor(t => t.F_GuestBookNum, new { Class = "easyui-textbox w500", @readonly = "true" }))
                        </td>
                    </tr>
                    <tr>
                        <th class="tdright" style="width: 100px;">
                            点赞数量：<em></em>
                        </th>
                        <td colspan="5">
                            @(Html.TextBoxFor(t => t.F_GoodNum, new { Class = "easyui-textbox w500", @readonly = "true" }))
                        </td>
                    </tr>
                    <tr>
                        <th class="tdright" style="width: 100px;">
                            差评数量：<em></em>
                        </th>
                        <td colspan="5">
                            @(Html.TextBoxFor(t => t.F_BadNum, new { Class = "easyui-textbox w500", @readonly = "true" }))
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    }
</div>

@*底部操作*@
<div class="dialog-button TextCenter" data-options="region:'south',border:false">
    @if (Model.F_Id != 0)
    {
        @Html.Raw(T_FunctionAction.Get_Action_Buttons(actions["Edit"]))
    }
    else
    {
        @Html.Raw(T_FunctionAction.Get_Action_Buttons(actions["Add"]))
    }
    <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-no'" onclick="return window.parent.cancel();">取消</a>
</div>