<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="AfficheList.aspx.cs" Inherits="Affiche_AfficheList" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolderToolbar" Runat="Server">
    &nbsp;<table id="__tblSubmitImage" height="100%" style="display: none" width="100%">
        <tr>
            <td align="center">
               <img src="../Images/Sumiting.gif" />
            </td>
        </tr>
    </table>
    <table cellpadding="5" cellspacing="0" class="Navigator" width="100%">
        <tr>
            <td nowrap="nowrap" width="80">
                &nbsp;您的位置：</td>
            <td align="left">
                <font class="NavigatorTitle">公告管理-&gt;公告信息管理</font></td>
            <td width="150">
            </td>
        </tr>
    </table>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderList" Runat="Server">
          <div>
        <table cellspacing="0" cellpadding="5" align="center" runat="server" id="tblQuery" >
        <tr>
            <td>
                共
                <asp:Label ID="lblRecordCount" runat="server" ForeColor="Red"></asp:Label>条记录，分
                <asp:Label ID="lblPageCount" runat="server" ForeColor="Red"></asp:Label>页显示，每页显示
                <asp:TextBox ID="txtPageSize" runat="server" Width="32px" CssClass="treemenu" Text="10"></asp:TextBox><asp:RequiredFieldValidator
                    ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtPageSize" Display="None"
                    EnableViewState="False" ErrorMessage="请填写每页显示数量！">*</asp:RequiredFieldValidator><asp:RangeValidator
                        ID="RangeValidator1" runat="server" ErrorMessage="每页显示数量必须为正整数！" Type="Integer"
                        MinimumValue="0" MaximumValue="100000000" Display="None" ControlToValidate="txtPageSize"
                        EnableViewState="False">*</asp:RangeValidator>条，当前为
                <asp:TextBox ID="txtCurrentPage" runat="server" Width="32px" CssClass="textboxmoney">1</asp:TextBox><asp:RequiredFieldValidator
                    ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtCurrentPage"
                    Display="None" EnableViewState="False" ErrorMessage="请填写页码！">*</asp:RequiredFieldValidator><asp:RangeValidator
                        ID="RangeValidator2" runat="server" ErrorMessage="非法的页码" Type="Integer" MinimumValue="0"
                        MaximumValue="100000000" Display="None" ControlToValidate="txtCurrentPage" EnableViewState="False">*</asp:RangeValidator>页
                <asp:Button ID="btnGo" runat="server" Text="Go..." EnableViewState="False" OnClick="btnGo_Click">
                </asp:Button>
                <INPUT type="button" value="新增" onclick="location.href='AfficheEdit.aspx'" />
                <asp:ValidationSummary ID="pageValidation" runat="server" ShowSummary="False" ShowMessageBox="True"
                    EnableViewState="False"></asp:ValidationSummary>
            </td>
        </tr>
    </table>
    </div>
    <div style="width: 100%">
        <asp:GridView ID="dgvAffiche" runat="server" AutoGenerateColumns="False" AllowPaging="True"
            Width="100%" AllowSorting="True" onrowdatabound="dgvAffiche_RowDataBound" 
            onsorting="dgvAffiche_Sorting" onrowcommand="dgvAffiche_RowCommand" OnRowDeleting="dgvAffiche_RowDeleting">
            <Columns>
                    <asp:TemplateField HeaderText="標題">
                    <ItemTemplate>
                        <asp:HyperLink ID="btnCaption" runat="server" 
                            NavigateUrl='<%# "AfficheShow.aspx?AfficheID="+DataBinder.Eval(Container.DataItem, "AfficheID")+""%>'><%# DataBinder.Eval(Container.DataItem, "Caption")%> </asp:HyperLink>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                </asp:TemplateField>
                <asp:BoundField DataField="IssuanceDate" HeaderText="發布日期" />
                <asp:BoundField DataField="CreateUser" HeaderText="發布者" />
                <asp:TemplateField HeaderText="操作">
                    <ItemTemplate>
                        <a  href='AfficheEdit.aspx?AfficheID=<%# DataBinder.Eval(Container.DataItem, "AfficheID")%>'>查看公告</a>
                        <asp:HyperLink ID="btnEdit" runat="server" 
                         Visible='<%# CheckRight("AfficheAdmin") %>'    NavigateUrl='<%# "AfficheEdit.aspx?AfficheID="+DataBinder.Eval(Container.DataItem, "AfficheID")+"&Action=Edit"%>'>编辑</asp:HyperLink>
                        <asp:LinkButton ID="btnDelte"    Visible='<%# CheckRight("AfficheAdmin") %>'   OnClientClick="return confirm('你确定要删除吗？')" CommandName="Delete" CommandArgument='<%# DataBinder.Eval(Container.DataItem,"AfficheID") %>' runat="server">删除</asp:LinkButton>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                </asp:TemplateField>        
            </Columns>
            <PagerTemplate>
            </PagerTemplate>
            <SelectedRowStyle BackColor="#FFFFC0" BorderColor="#C0C0FF" BorderStyle="Dotted" />
        </asp:GridView>
    </div>          
    <table align="center" bgcolor="#e9e9e9" width="100%">
                    <tr>
                        <td style="text-align: right">
                            <asp:LinkButton ID="lbtnFirst" runat="server" Text="首页" 
                                onclick="lbtnFirst_Click"></asp:LinkButton>
                            <asp:LinkButton ID="lbtnPrevious" runat="server" Text="上一页" 
                                onclick="lbtnPrevious_Click"></asp:LinkButton>
                            <asp:LinkButton ID="lbtnNext" runat="server" Text="下一页" 
                                onclick="lbtnNext_Click"></asp:LinkButton>
                            <asp:LinkButton ID="lbtnLast" runat="server" Text="末页" onclick="lbtnLast_Click"></asp:LinkButton>
                        </td>
                    </tr>
                </table>
</asp:Content>

