<%@ page language="C#" masterpagefile="AdminIndexMaster.master" autoeventwireup="true" inherits="Admin_Admin_ManageAd, mallz" title="广告管理" debug="true" enableEventValidation="false" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script type="text/javascript" src="JS/mouse.js" ></script>
        
      <table class="nick"><tr><td class="tit" colspan="4">快速搜索</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>

      <asp:GridView ID="GridView1" runat="server"  AutoGenerateColumns="False" DataSourceID="AdDatasource" OnRowDataBound="GridView1_RowDataBound" AllowPaging="True" CssClass="adminlist">
          <Columns>
            <asp:TemplateField HeaderStyle-Width="4%">
                <ItemTemplate>
                    <input id="ids" name="ids" type="checkbox" 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="ZoneID" HeaderStyle-Width="6%" HeaderText="广告位" />
            <asp:TemplateField  HeaderText="类型" HeaderStyle-Width="6%">
                <ItemTemplate>
                    <asp:Literal ID="Literal1" runat="server" Text='<%# GetType(Eval("adtype").ToString(),Eval("ImgUrl").ToString(),Convert.ToInt32(Eval("ImgWidth")),Convert.ToInt32(Eval("ImgHeight"))) %>' />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="Views" HeaderText="浏览次数" HeaderStyle-Width="6%" />
            <asp:BoundField DataField="clicks" HeaderText="点击次数" HeaderStyle-Width="6%" />
            <asp:BoundField DataField="EndTime" HeaderText="结束时间" HeaderStyle-Width="15%" />
            <asp:CheckBoxField DataField="passed" HeaderText="审核" ReadOnly="True" HeaderStyle-Width="5%" />
            <asp:TemplateField HeaderText="操作" HeaderStyle-Width="10%">
              <ItemTemplate>
                <asp:HyperLink ID="f" runat="server" NavigateUrl='<%# "Admin_UpdateAd.aspx?UpdateAdID=" + Eval("ADID") %>' Text="修改"  />
                <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="批量删除" />
         <input type="button" value="取消返回" onclick="history.back()" />
      </div>
  
    <asp:ObjectDataSource ID="AdDatasource" runat="server" DeleteMethod="DeleteAd" SelectMethod="GetAdByNameIntro"
        TypeName="MallZ.Data.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>

