<%@ page language="C#" masterpagefile="~/HL_Admin/AdminIndexMaster.master" autoeventwireup="true" inherits="HL_Admin_Admin_ManageAd, HoWaveVGO" title="广告管理" debug="true" enableEventValidation="false" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script src="Js/Function.js" type="text/javascript"></script> 
      <table class="adminheading">
         <tr>
            <th>网站广告管理</th>                  
            <td align="right">
            <div style="width:590px">
                <a href="Admin_manageadzone.aspx">管理广告版位</a>&nbsp;|&nbsp;
                <a href="Admin_updateadzone.aspx?add=1">增加广告版位</a>&nbsp;|&nbsp;
                <a href="Admin_managead.aspx">管理广告</a>&nbsp;|&nbsp;
                <a href="Admin_updateAd.aspx">添加新广告</a>&nbsp;|&nbsp;
                <a  href="Admin_Managejs.aspx">js模板管理</a>&nbsp;|&nbsp;
                <a href="Admin_ManageUploadFile.aspx">广告上传文件管理</a>
             </div>
             </td>
             <td class="rtdw"></td> 
         </tr>
   </table>  
        
      <div style="width:100%;">
      <table class="nick">
        <tr><td colspan="4" class="tit">快速查找</td></tr>
        <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>
      </div>
      <br />
      <div style="width:100%">
          <asp:GridView ID="GridView1" runat="server"  AutoGenerateColumns="False" DataSourceID="AdDatasource" OnDataBound="GridView1_DataBound" OnRowDataBound="GridView1_RowDataBound" Width="100%" AllowPaging="True" CssClass="adminlist">
        <Columns>
           <asp:TemplateField HeaderText="选择">
                <ItemTemplate>
                    <asp:CheckBox ID="CheckBox1" runat="server" Text="" />
                </ItemTemplate>
                <HeaderTemplate>
                   <input id="chkAll" onclick="SelectAllCheckboxes(this);" runat="server" type="checkbox" /> 全选
                </HeaderTemplate>
            </asp:TemplateField>            
            <asp:BoundField DataField="ADID" HeaderText="ID" />
            <asp:BoundField DataField="adname" HeaderText="名称" />
            <asp:BoundField DataField="adtype" HeaderText="类型" />
            <asp:BoundField DataField="priority" 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="删除">
              <ItemTemplate>
                <asp:LinkButton ID="cl" runat="server" Text="删除" CommandArgument='<%#Eval("ADID") %>' OnClientClick="{if(confirm('确定删除吗？')) return true;return false;}" OnCommand="GridView1_SelectedIndexChanged" />
              </ItemTemplate>
            </asp:TemplateField>
            <asp:HyperLinkField DataNavigateUrlFields="ADID" DataNavigateUrlFormatString="Admin_UpdateAd.aspx?UpdateAdID={0}"
                HeaderText="修改" Text="修改" />
        </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>
      <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="Ad" 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>

