@model List<Com._9pm2.ClientWeb.Database.Department>
@{
    ViewBag.Title = "部门管理";
}
<script src="../../Scripts/department.js?vn=20180813"></script>

<div>
    <button id="btnNew" type="button" class="btn btn-default">新增</button>
</div>
<div class="error-msg"></div>
<div class="list">
    <table id="tDepartment">
        <thead>
            <tr>
                <th>名称</th>
                <th>备注</th>
                <th style="width:120px">操作</th>
            </tr>
        </thead>
        <tbody>
            @foreach (var item in Model)
            {
                <tr id="@item.Id">
                    <td>@item.DepartmentName                    </td>
                    <td>@item.Memo</td>

                    <td>
                        <div class="operation-btns">
                            <div>
                                <button id="select">&nbsp;</button>
                            </div>
                            <ul>
                                <li><a href="javascript:void(0);" onclick="EditDepartment('@item.Id');">编辑 </a></li>
                                <li><a href="javascript:void(0);" onclick="DeleteDepartment('@item.Id');">删除</a></li>
                            </ul>
                        </div>
                    </td>
                </tr>
            }
        </tbody>
    </table>
</div>

<div id="divDepartment" title="部门信息" style="display:none">
    <div id="divDepartmentContent">
        @using (Html.BeginForm())
        {
            <table class="font85 tableEdit">
                <tr>
                    <td class="label">部门名称</td>
                    <td>
                        @Html.TextBox("DepartmentName")&nbsp;<span class="redStar">*</span>
                        @Html.Hidden("Id")
                    </td>
                </tr>

                <tr>
                    <td class="label">备注</td>
                    <td>
                        @Html.TextArea("Memo", null, new { maxlength = "1000", style = "width:90%;" })
                    </td>
                </tr>

            </table>
            <br />
        }
    </div>
    <div style="text-align:right;">
        <div class="error-msg"></div>
        <button class="btn btn-primary" type="button" id="btnSave">保存</button>
        <button class="btn btn-default" type="button" id="btnCancel">取消</button>
    </div>
</div>
