@model System.Collections.Generic.List<Com._9pm2.ClientWeb.Database.AccountTitle>
    @{
        ViewBag.Title = "科目管理";
    }

    <script src="../../Scripts/accounttitle.js?vn=20180813"></script>
    <div>
        <button id="btnNew" type="button" class="btn btn-default">新增</button>
    </div>
    <div class="list">

        <table id="tAccountTitle">
            <thead>
                <tr>
                    <th>科目名称</th>
                    <th>科目类型</th>
                    <th>状态</th>
                    <th>备注</th>
                    @* <th>修改记录</th>*@
                    <th style="width:100px">操作</th>
                </tr>
            </thead>
            <tbody>
                @foreach (var item in Model)
                {
                    <tr id="@item.AccountTitleNo">
                        <td>
                            @Html.DisplayFor(modelItem => item.AccountTitleName)
                        </td>
                        <td>
                            @if (item.AccountTitleType == "1")
                            {<span>收入</span>}
                            else
                            {<span>支出</span>}
                        </td>
                        <td>
                            @if (item.IsActive)
                            {<span>启用</span>}
                            else
                            {<span>禁用</span>}
                        </td>
                        <td>@Html.DisplayFor(modelItem => item.Memo)</td>
                        @* <td>@Html.Raw(item.AutoMemo)</td>     *@
                        <td>


                            <div class="operation-btns">
                                <div>
                                    <button id="select">&nbsp;</button>
                                </div>
                                <ul>
                                    <li><a href="javascript:void(0);" onclick="EditAccountTitle('@item.AccountTitleNo');">编辑 </a></li>
                                    <li><a href="javascript:void(0);" onclick="DeleteAccountTitle('@item.AccountTitleNo','@item.AccountTitleName');">删除</a></li>

                                </ul>
                            </div>

 
                        </td>
                    </tr>
                }
            </tbody>
        </table>
    </div>


    <div id="divAccountTitle" title="科目信息" style="display:none">
        <div id="divAccountTitleContent" style="overflow-y: auto; height: 220px;">
            @using (Html.BeginForm())
            {
                <table class="font85 tableEdit">
                    <tr>
                        <td class="label">科目名称</td>
                        <td>
                            @Html.TextBox("AccountTitleName", null, new { maxlength = "50" })&nbsp;<span class="redStar">*</span>
                        </td>
                    </tr>
                    <tr>
                        <td class="label">收支类型</td>
                        <td>
                            @Html.RadioButton("AccountTitleType", "1", false, new { @id = "ATT1" }) 收入 @Html.RadioButton("AccountTitleType", "2", true, new { @id = "ATT2" }) 支出
                        </td>
                    </tr>
                    <tr>
                        <td class="label">科目状态</td>
                        <td>
                            @Html.RadioButton("IsActive", true, true, new { @id = "IA1" }) 启用 @Html.RadioButton("IsActive", false, false, new { @id = "IA2" }) 禁用
                        </td>
                    </tr>
                    <tr>
                        <td class="label">备注</td>
                        <td>
                            @Html.TextArea("Memo", null, new { maxlength = "200", @style = "height:80px;width:90%" })
                            @Html.Hidden("AccountTitleNo")
                        </td>

                    </tr>
                </table>
            }
        </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>
