<%@ Page Title="" Language="C#" MasterPageFile="~/Dialog/DialogMaster.Master" AutoEventWireup="true" 
    CodeBehind="BaseAnnounceTypeList.aspx.cs" Inherits="OAWeb.Announce.BaseAnnounceTypeList" EnableViewState="true" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script type="text/javascript">
        $(document).ready(function () {
            $("#aspnetForm").validate({
                /*验证规则*/
                rules: {
                    '<%=txtTitle.UniqueID %>': {
                        required: true
                    }
                },
                messages: {
                    '<%=txtTitle.UniqueID %>': {
                        required: "请输入类型名称"
                    }
                },
                /*重写错误显示消息方法,以alert方式弹出错误消息*/
                showErrors: function (errorMap, errorList) {
                    var msg = "";
                    $.each(errorList, function (i, v) {
                        msg += (v.message + "\r\n");
                    });
                    if (msg != "") alert(msg);
                },
                /* 失去焦点时不验证 */
                onkeyup: false,
                onfocusout: false
            });
        });
    </script>
    <div class="page_content" style="width: 300px; margin-top:10px;">
        <table class="data_title" cellspacing="3">
            <tr>
                <td class="data_field">
                    类型名称：<asp:TextBox ID="txtTitle" runat="server" CssClass="text_box"></asp:TextBox>
                    <asp:Button ID="btnSave" runat="server" Text=" 保 存 " CssClass="btn_77px" OnClick="btnSave_Click" />
                </td>
            </tr>
        </table>
        <div class="list">
            <asp:GridView ID="gvData" runat="server" AutoGenerateColumns="False" DataKeyNames="Id"
                GridLines="None" CellPadding="0" CssClass="table_list"
                EnableModelValidation="True" onrowcancelingedit="gvData_RowCancelingEdit" 
                onrowdeleting="gvData_RowDeleting" onrowediting="gvData_RowEditing" 
                onrowupdating="gvData_RowUpdating">
                <RowStyle HorizontalAlign="Left" />
                <Columns>
                    <asp:TemplateField HeaderText="名称">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("TypeName") %>' CssClass="text_box"></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("TypeName") %>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Left" />
                        <ItemStyle HorizontalAlign="Left" />
                    </asp:TemplateField>
                    <asp:CommandField HeaderText="操作" ShowDeleteButton="True" 
                        ShowEditButton="True" />
                </Columns>
            </asp:GridView>
            <div class="pager-bar">
                <webdiyer:AspNetPager ID="pager" runat="server" CssClass="anpager" currentpagebuttonclass="cpb"
                    PageSize="20" NextPageText="下一页" LastPageText="页 尾" FirstPageText="第一页" PrevPageText="上一页"
                    ShowBoxThreshold="10" SubmitButtonText="跳 转" OnPageChanged="pager_PageChanged">
                </webdiyer:AspNetPager>
            </div>
        </div>
    </div>
</asp:Content>
