<%@ page language="C#" validaterequest="false" enableeventvalidation="false" masterpagefile="~/HL_Admin/AdminIndexMaster.master" autoeventwireup="true" inherits="HL_Admin_Admin_ManageAdZone, HoWaveVGO" title="广告模板管理" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script src="Js/Function.js" type="text/javascript"></script> 
<script type="text/javascript">
function SelectCheckboxes(){
  var spanChk = document.getElementById("ctl00_ContentPlaceHolder1_GridView1_ctl01_chkAll");
　var oItem = spanChk.children;
　var theBox=(spanChk.type=="checkbox")?spanChk:spanChk.children.item[0];
　xState=theBox.checked;
　elm=theBox.form.elements;
　for(i=0;i<elm.length;i++)
　if(elm[i].type=="checkbox" && elm[i].id!=theBox.id)
　{
　　elm[i].checked = !elm[i].checked;
　}
}
</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"/></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" AllowPaging="True" AutoGenerateColumns="False"
              DataSourceID="AdZoneDatasource" Width="100%" OnDataBound="GridView1_DataBound" 
              DataKeyNames="zoneid" OnRowDataBound="GridView1_RowDataBound" CssClass="adminlist">
                    <Columns>
                        <asp:TemplateField HeaderText="选择">
                            <ItemTemplate>
                                <asp:CheckBox ID="CheckBox1" runat="server" Text='<%# Eval("ZoneID") %>' Font-Size="0"/>
                            </ItemTemplate>
                            <HeaderTemplate>
                               <input id="chkAll" onclick="SelectAllCheckboxes(this);" runat="server" type="checkbox" /> 全选
                            </HeaderTemplate>
                        </asp:TemplateField>                        
                        <asp:BoundField DataField="ZoneID" HeaderText="ID" />
                        <asp:BoundField DataField="Zonename" HeaderText="名称" />
                        <asp:BoundField DataField="Zonetype" HeaderText="类型" />
                        <%--<asp:BoundField DataField="ChannelName" HeaderText="频道" />--%>
                        <asp:BoundField DataField="ShowType" HeaderText="显示" />
                        <asp:BoundField DataField="zoneWidth" HeaderText="长" />
                        <asp:BoundField DataField="zoneHeight" HeaderText="宽" />
                        <asp:BoundField DataField="Active" HeaderText="活动" />
                        <asp:TemplateField HeaderText="删除">
                          <ItemTemplate>
                             <asp:LinkButton ID="cl" runat="server" Text="删除"  CommandName='<%#Eval("ZoneID") %>' OnClientClick="{if(confirm('确定删除吗？')) return true;return false;}" OnCommand="GridView1_SelectedIndexChanged" />
                          </ItemTemplate>
                        </asp:TemplateField>
                        <asp:HyperLinkField DataNavigateUrlFields="ZoneID" DataNavigateUrlFormatString="Admin_UpdateAdzone.aspx?UpdateZoneID={0}"
                            HeaderText="修改" Text="修改" />
                        <asp:HyperLinkField DataNavigateUrlFields="zoneid" DataNavigateUrlFormatString="?zoneid={0}"
                            HeaderText="调用代码" Text="调用代码" />
                        <asp:TemplateField HeaderText="预览">
                            <ItemTemplate> 
                            <asp:HyperLink ID="PreviewAD" runat="server" NavigateUrl='<%#"../IMS_AD/admin_adprevrew.aspx?js="+Eval("zoneJSName") %>' Text='预览' target="_blank"/>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <EmptyDataTemplate>
                    <tr>
                      <th>全选</th><th>ID</th><th>名称</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">
                <input type="button" value="反选" name="ddd" onclick="return SelectCheckboxes()" />
                <asp:Button ID="Button3" runat="server" OnClientClick="{if(confirm('确定删除吗？')) return true;return false;}" OnClick="Button3_Click" Text="删除" />
                &nbsp;<%--<asp:Button ID="Button4" runat="server" OnClick="Button4_Click" Text="设为活动版位" />
                &nbsp;
                <asp:Button ID="Button7" runat="server" OnClick="Button7_Click" Text="设为暂停版位" />--%>
                <%--<asp:Button ID="Button6" runat="server" OnClick="Button6_Click" Text="移动频道" />=&gt;<asp:DropDownList ID="ChannelID" runat="server" DataSourceID="ObjectDataSource1"
                    DataTextField="channelname" DataValueField="channelid" Width="112px">
                </asp:DropDownList> --%>
            </div>
            <asp:Panel ID="Panel1" runat="server" Height="89px" Visible="False" Width="100%">
                <asp:TextBox ID="TxtCode" runat="server" Height="72px" Width="100%"/>
                <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="Admin_ManageAdZone.aspx" Text="关闭" />
             </asp:Panel>
        </div>

    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server"  SelectMethod="GetChannels" TypeName="ChannelBLL"/> 
    <asp:ObjectDataSource ID="AdZoneDatasource" runat="server" DeleteMethod="DelectAdZone"
        SelectMethod="GetAdZoneByNameIntro" TypeName="AdZone" UpdateMethod="GetAdZoneByNameIntro" OldValuesParameterFormatString="original_{0}">
        <DeleteParameters>
            <asp:Parameter Name="AdZoneID" Type="Int32" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="ZoneName" Type="String" />
            <asp:Parameter Name="ZoneIntro" Type="String" />
        </UpdateParameters>
        <SelectParameters>
            <asp:ControlParameter ControlID="TextBox1" Name="ZoneName" PropertyName="Text" Type="String" />
            <asp:ControlParameter ControlID="TextBox2" Name="ZoneIntro" PropertyName="Text" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>    
</asp:Content>

