<%@ page language="C#" masterpagefile="AdminIndexMaster.master" autoeventwireup="true" inherits="HL_Admin_Admin_ManageAd, WebApp_deploy" title="广告管理" debug="true" enableEventValidation="false" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script src="Js/Function.js" type="text/javascript"></script> 
<script type="text/javascript" src="JS/mouse.js" ></script>
        
      <table class="nick">
        <tr><td class="ltd">广告名称：</td><td class="rtd" style="width: 35%;">
        <asp:TextBox ID="TextBox1" runat="server" AutoPostBack="True" Width="100px"/></td>
        <td class="ltd">广告描述：</td><td class="rtd" style="width: 35%;">
        <asp:TextBox ID="TextBox2" runat="server" AutoPostBack="True" Width="100px"/></td>
        </tr>
      </table>

          <asp:GridView ID="GridView1" runat="server"  AutoGenerateColumns="False" DataSourceID="AdDatasource" OnDataBound="GridView1_DataBound" OnRowDataBound="GridView1_RowDataBound" AllowPaging="True" CssClass="adminlist">
          <Columns>
           <asp:TemplateField>
                <ItemTemplate>
                    <asp:CheckBox ID="CheckBox1" runat="server" Text=""  />
                    <asp:HiddenField ID="hfId" runat="Server" Value='<%#Eval("ADID") %>' />
                </ItemTemplate>
                <HeaderTemplate>
                   <input id="chkAll" onclick="SelectAllCheckboxes(this);" runat="server" type="checkbox" />
                </HeaderTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="adname" HeaderText="名称" ItemStyle-HorizontalAlign="Left" />
            <asp:BoundField DataField="adtype" HeaderText="类型" />
            <asp:BoundField DataField="ZoneID" HeaderText="所属版位" />
            <asp:BoundField DataField="Views" HeaderText="浏览次数" />
            <asp:BoundField DataField="clicks" HeaderText="点击次数" />
            <asp:BoundField HeaderText="点击率" />
            <asp:BoundField DataField="EndTime" HeaderText="结束时间" />
            <asp:CheckBoxField DataField="passed" HeaderText="审核" ReadOnly="True" />
            <asp:TemplateField HeaderText="操作" HeaderStyle-Width="10%">
              <ItemTemplate>
                <asp:HyperLink ID="f" runat="server" NavigateUrl='<%# "Admin_UpdateAd.aspx?UpdateAdID=" + Eval("ADID") %>' Text="修改"  />
                <asp:HiddenField ID="H_Img" runat="server" Value='<%# Eval("ImgUrl") %>' />
                <asp:LinkButton ID="cl" runat="server" Text="删除" CommandArgument='<%#Eval("ADID") %>' OnClientClick="{if(confirm('确定删除吗？')) return true;return false;}" OnCommand="GridView1_SelectedIndexChanged" />
              </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <EmptyDataTemplate>
                    <tr>
                      <th>全选</th><th scope="col">ID</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="12">暂无广告！</td>
		            </tr>
        </EmptyDataTemplate>
    </asp:GridView>

      <div class="div_btm">
         <asp:Button ID="Button1" runat="server" Text="通过审核" OnClick="Button1_Click" />
         <asp:Button ID="Button2" runat="server" Text="取消审核" OnClick="Button2_Click" />&nbsp;
         <asp:Button ID="Button3" runat="server" OnClientClick="{if(confirm('确定删除吗？')) return true;return false;}" OnClick="Button3_Click" Text="批量删除" />
      </div>
  
    <asp:ObjectDataSource ID="AdDatasource" runat="server" DeleteMethod="DeleteAd" SelectMethod="GetAdByNameIntro"
        TypeName="HoWave.Web.AdBll" UpdateMethod="GetAdByNameIntro" OldValuesParameterFormatString="original_{0}">
        <DeleteParameters>
            <asp:Parameter Name="ADID" Type="Int32" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="AdName" Type="String" />
            <asp:Parameter Name="AdIntro" Type="String" />
        </UpdateParameters>
        <SelectParameters>
            <asp:ControlParameter ControlID="TextBox1" Name="AdName" PropertyName="Text" Type="String" />
            <asp:ControlParameter ControlID="TextBox2" Name="AdIntro" PropertyName="Text" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
</asp:Content>

