<%@ page language="C#" masterpagefile="AdminIndexMaster.master" autoeventwireup="true" inherits="Admin_Admin_Announce, mallz" title="网站公告管理" enableEventValidation="false" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">


<asp:GridView id="GridView1" runat="server" CssClass="adminlist" OnRowDataBound="GridView1_RowDataBound" DataSourceID="ObjectDataSource1" RowStyle-HorizontalAlign="Center" DataKeyNames="AnnounceID" AutoGenerateColumns="False" AllowPaging="True" PageSize="10">
  <Columns>
    <asp:BoundField DataField="AnnounceID" InsertVisible="False" HeaderText="ID" HeaderStyle-Width="4%"/>
    <asp:HyperLinkField DataTextField="AnnounceTitle" DataNavigateUrlFields="AnnounceID" DataNavigateUrlFormatString="Admin_AddAnnounce.aspx?AnnounceID={0}" HeaderText="公告标题" ItemStyle-HorizontalAlign="Left" ItemStyle-Font-Bold="true"/>
    <asp:BoundField DataField="AnnounceOwner" HeaderText="发布人" HeaderStyle-Width="13%"/>
    <asp:BoundField DataField="AnnounceReadCount" HeaderText="浏览量" HeaderStyle-Width="8%" />
    <asp:TemplateField HeaderText="公告类型" HeaderStyle-Width="8%">
        <ItemTemplate>
            <asp:Literal ID="AnnounceType" runat="server" Text='<%# GetType(Eval("AnnounceType").ToString()) %>' />
        </ItemTemplate>
    </asp:TemplateField>
    <asp:TemplateField HeaderText="公告等级" HeaderStyle-Width="8%">
        <ItemTemplate>
            <asp:Literal ID="AnnounceImportant" runat="server" Text='<%# GetImportant(Eval("AnnounceImportant").ToString()) %>' />
        </ItemTemplate>
    </asp:TemplateField>
    <asp:BoundField HtmlEncode="False" DataFormatString="{0:d}" DataField="AnnounceBegin" HeaderText="发布日期" HeaderStyle-Width="11%"/>
    <asp:BoundField HtmlEncode="False" DataFormatString="{0:d}" DataField="AnnounceEnd" HeaderText="结束日期" HeaderStyle-Width="11%" />
    <asp:TemplateField HeaderText="操作" HeaderStyle-Width="8%">
        <ItemTemplate>
            <asp:HyperLink ID="LinkButton1" runat="server" NavigateUrl='<%# "Admin_AddAnnounce.aspx?AnnounceID=" + Eval("AnnounceID") %>' Text="修改"/>
            <asp:LinkButton ID="cl" runat="server" CommandName="Delete" OnClientClick="{if(confirm('确定删除吗？')) return true;return false;}" Text="删除"/>
        </ItemTemplate>
    </asp:TemplateField>
  </Columns>
    <EmptyDataTemplate>
        <tr>
          <th scope="col">公告编号</th><th scope="col">公告标题</th><th scope="col">公告类型</th><th scope="col">公告等级</th><th scope="col">发布人</th><th scope="col">公告发布日期</th><th scope="col">公告结束日期</th><th scope="col">内容</th><th scope="col">浏览量</th><th scope="col">修改</th><th scope="col">删除</th>
        </tr>
        <tr>
          <td colspan="11">暂无公告！</td>
        </tr>
    </EmptyDataTemplate>
    <RowStyle HorizontalAlign="Center"></RowStyle>
</asp:GridView>

	<div class="help_intro" >
	<h1 onclick="AnnouncePanel.style.display='block'" style="cursor:pointer">调用JS代码：</h1>
        <div id="AnnouncePanel" style="display:;">
          <asp:Literal ID="announce_js_code" runat="server" />
	</div>
	</div>

          <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" DeleteMethod="DeleteAnnounce" SelectMethod="GetAnnounces" TypeName="MallZ.Data.AnnounceBll" OldValuesParameterFormatString="{0}">
              <DeleteParameters>
                  <asp:Parameter Name="AnnounceID" Type="Int32" />
              </DeleteParameters>
          </asp:ObjectDataSource>
 
</asp:Content>

