
@{
    ViewData["Title"] = "角色详情";
    Layout = "~/Pages/Shared/_MainLayout2.cshtml";
    ViewBag.Nav = new string[] { "系统设置", "角色管理", "角色详情" };
    ViewBag.showClose = false;
}

<div style="background:#fff;padding:8px;margin:-15px;">
    <h3>基本信息</h3>
    <div class="fixed-table-container bootstrap-table">
        <table class="table table-hover">
            <tr>
                <td>角色名称<span style="color:red;">*</span>:</td>
                <td><input id="name" name="name" class="form-control" value="@ViewBag.m.name" /></td>
            </tr>
            <tr>
                <td>备注:</td>
                <td><input id="note" name="note" class="form-control" value="@ViewBag.m.note" /></td>
            </tr>
        </table>
    </div>
    <input id="id" name="id" type="hidden" value="@ViewBag.m.id" />
</div>

@section buttons{
    <button type="button" class="btn btn-success btn-operation" onclick="Save();">提交</button>
}

@section scripts{
    <script type="text/javascript">

        function Save() {
            var n = $('#name').val();
            var note = $('#note').val();

            if (n == '') {
                layer.msg('角色名称不能为空！');
                return false;
            }

            $.submit({
                url: '@Url.Content("~/Users/Home/SaveUserRole")',
                type:'POST',
                paramData: 'id=@(ViewBag.m.id)' + '&name=' + n + '&note=' + note,
                success: function (result) {
                    if (result.success) {
                        layer.msg('提交成功！');
                        window.location = window.location;
                        //layer_close();
                    }
                    else {
                        layer.msg(result.msg);
                    }
                }
            })

        }

    </script>

}