<%@ page language="C#" autoeventwireup="true" inherits="Admin_Ad_List, ShopNum1Deploy" %>

<%@ Register assembly="ShopNum1.Control" namespace="ShopNum1.Control" tagprefix="cc1" %>
<%@ Register src="UserControl/MessageShow.ascx" tagname="MessageShow" tagprefix="ShopNum1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Untitled Page</title>
    <link type="text/css" rel="Stylesheet" href="css/index.css" /> 
    <script type="text/javascript" language="javascript" src="../js/CommonJS.js"></script>
</head>
<body style="padding:0; background-image: url(images/Bg_right.gif); background-repeat:repeat;">
    <form id="form1" runat="server">
    <div class="navigator">【 广告列表 】</div>
    
    <table style="width:100%">
        <tr>
        <td style="width:100%" align="left"><div class="query">
        <table cellpadding="0" cellspacing="0" border="0" with="100%">
        <tr><td width="20%" align="right"> <asp:Label ID="LabelName" runat="server" Text="广告名称：" Font-Bold="False"></asp:Label></td>
        <td><asp:TextBox ID="TextBoxName" runat="server"  CssClass="input1"></asp:TextBox></td>
        <td align="right" width="20%"><asp:Label ID="LabelIsOpen" runat="server" Text="是否开启：" Font-Bold="False"></asp:Label></td>
        <td> <asp:DropDownList ID="DropDownListIsOpen" runat="server" CssClass="select1">
                 <asp:ListItem Value="-1">-全部-</asp:ListItem>
                 <asp:ListItem Value="0">未开启</asp:ListItem>
                 <asp:ListItem Value="1">已开启</asp:ListItem>
             </asp:DropDownList></td>
         <td style="padding-left:10%">
             <asp:Button ID="ButtonSearch" runat="server" onclick="ButtonSearch_Click" 
                 Text="查询"  CssClass="bt2" CausesValidation="False" /></td>
        </tr>
        
        </table>
        </div>
            
        
            

        </td>
        </tr>
          <tr>
        <td style="width:100%" align="left">
               
        <cc1:Num1GridView ID="Num1GridviewShow" runat="server" AllowPaging="True" 
            AllowSorting="True" AutoGenerateColumns="False"  
            Width="100%" AscendingImageUrl="~/images/SortAsc.gif" 
            DescendingImageUrl="~/images/SortDesc.gif" Font-Size="Small" 
            Font-Bold="False" AddSequenceColumn="False" AllowMultiColumnSorting="False" 
                BorderColor="#CCDDEF" BorderStyle="Solid" BorderWidth="1px" CellPadding="4" 
                Del="False" DeletePromptText="确实要删除指定的记录吗？" Edit="False" FixHeader="False" 
                GridViewSortDirection="Ascending" PagingStyle="None" style="margin-left: 2px;" 
                TableName="" DataSourceID="ObjectDataSourceData">
<HeaderStyle HorizontalAlign="Center" BackColor="#6699CC" Font-Bold="True" ForeColor="#FFFFFF"></HeaderStyle>

<PagerStyle HorizontalAlign="Left" BackColor="#EEEEEE" ForeColor="#6699CC"></PagerStyle>
            <Columns>
                   <asp:TemplateField>
                    <HeaderTemplate>
                       <input ID="checkboxAll" onclick="javascript:SelectAllCheckboxes(this);" 
                            type="checkbox"  />
                    </HeaderTemplate>
                    
                       <ItemTemplate>
                           <input ID="checkboxItem" type="checkbox" Value='<%# Eval("Guid") %>' />
                       </ItemTemplate>
                    
                       <ItemStyle HorizontalAlign="Center" Width="30px" />
                    
                </asp:TemplateField>
                <asp:BoundField DataField="Guid" HeaderText="Guid" Visible="False" 
                       SortExpression="Guid" />
                <asp:BoundField DataField="Name" HeaderText="广告名称" SortExpression="Name" >
                    <ItemStyle HorizontalAlign="Center" />
                   </asp:BoundField>
                <asp:BoundField DataField="AdPositionName" HeaderText="广告位置" 
                       SortExpression="AdPositionName" >
                    <ItemStyle HorizontalAlign="Center" />
                   </asp:BoundField>
                   <asp:TemplateField HeaderText="广告类型" SortExpression="Type">
                       <ItemTemplate>
                           <asp:Label ID="Label1" runat="server" Text='<%# ChangeAdType(DataBinder.Eval(Container, "DataItem(Type)","{0}")) %>'></asp:Label>
                       </ItemTemplate>
                       <ItemStyle HorizontalAlign="Center" />
                   </asp:TemplateField>
                <asp:BoundField DataField="StartTime" HeaderText="开始时间" 
                       SortExpression="StartTime" >
                    <ItemStyle HorizontalAlign="Center" />
                   </asp:BoundField>
                   <asp:BoundField HeaderText="结束时间" DataField="EndTime" SortExpression="EndTime">
                       <ItemStyle HorizontalAlign="Center" />
                   </asp:BoundField>
                   <asp:BoundField HeaderText="点击数" DataField="Count" SortExpression="Count">
                       <ItemStyle HorizontalAlign="Center" />
                   </asp:BoundField>
                   <asp:TemplateField HeaderText="是否开启" SortExpression="IsOpen">
                       <ItemTemplate>
                           <asp:Label ID="Label2" runat="server" Text='<%# ChangeIsOpen(DataBinder.Eval(Container, "DataItem(IsOpen)","{0}")) %>'></asp:Label>
                       </ItemTemplate>
                       <ItemStyle HorizontalAlign="Center" />
                   </asp:TemplateField>
            </Columns>
        </cc1:Num1GridView>
        </td>
        </tr>
          <tr>
        <td style="width:100%" align="left">
        <div class="vote">
           <asp:Button ID="ButtonAdd" runat="server" onclick="ButtonAdd_Click" Text="添加" 
            onclientclick="GetCheckedBoxValues()" CssClass="bt2"/>
        <asp:Button ID="ButtonEdit" runat="server" onclick="ButtonEdit_Click" 
            onclientclick="return EditButton()" Text="编辑" CssClass="bt2"/>
        <asp:Button ID="ButtonDelete" runat="server" Text="删除" 
            onclientclick="return DeleteButton()" 
            onclick="ButtonDelete_Click" CssClass="bt2"/>
    
        <ShopNum1:MessageShow ID="MessageShow" runat="server" Visible="False" />
        <asp:Button ID="ButtonCreateJS" runat="server" onclick="ButtonCreateJS_Click" 
            onclientclick="return EditButton()" Text="生成JS代码" CssClass="bt3"/>
            </div>
    
        </td>
        </tr>
    </table>
    <asp:HiddenField ID="CheckGuid" runat="server" Value="0" />
        
    <asp:ObjectDataSource ID="ObjectDataSourceData" runat="server" 
        SelectMethod="Search" TypeName="ShopNum1.BusinessLogic.ShopNum1_Ad_Action" 
        >
        <SelectParameters>
            <asp:ControlParameter ControlID="TextBoxName" Name="name" PropertyName="Text" 
                Type="String" />
            <asp:ControlParameter ControlID="DropDownListIsOpen" DefaultValue="-1" 
                Name="isOpen" PropertyName="SelectedValue" Type="Int32" />
            <asp:Parameter Name="isDeleted" Type="Int32" DefaultValue="0" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <asp:TextBox ID="TextBoxJsFile" runat="server" Height="88px" 
        TextMode="MultiLine" Width="318px"></asp:TextBox>
    </form>
</body>
</html>
