<%@ Page Language="C#" MasterPageFile="Admin.Master" AutoEventWireup="true" CodeBehind="List.aspx.cs"
    Inherits="Aspx1.Admin.List" Title="无标题页" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

    <script type="text/javascript">
function CheckAll(obj)
{
var allcheck = document.getElementsByName("productid");
for(i=0;i<allcheck.length;i++)
{
allcheck[i].checked = obj.checked;
}
}
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table class="tableBorder" border="0" cellpadding="0" cellspacing="1">
        <tr>
            <th colspan="9">
                <table width="100%" border="0">
                    <tr>
                        <td>
                            <table border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td width="80" style="color: #990000;">
                                        筛选：
                                    </td>
                                    <td width="100">
                                        <asp:DropDownList AutoPostBack="true" ID="ddlCategory" runat="server" DataSourceID="ObjectDataSource1"
                                            onchange="if(this.value=='0') return false;" DataTextField="CategoryName" DataValueField="CategoryID"
                                            OnSelectedIndexChanged="ddlCategory_SelectedIndexChanged">
                                        </asp:DropDownList>
                                    </td>
                                    <td width="90">
                                        <asp:DropDownList ID="ddlStatus" runat="server" AutoPostBack="true" onchange="if(this.value=='-2') return false;"
                                            OnSelectedIndexChanged="ddlStatus_SelectedIndexChanged">
                                            <asp:ListItem Text="按属性" Value="-2" Selected="True"></asp:ListItem>
                                            <asp:ListItem Text="待审" Value="-1"></asp:ListItem>
                                            <asp:ListItem Text="已审" Value="0"></asp:ListItem>
                                            <asp:ListItem Text="文字推荐" Value="1"></asp:ListItem>
                                            <asp:ListItem Text="图片推荐" Value="2"></asp:ListItem>
                                        </asp:DropDownList>
                                    </td>
                                    <td width="90">
                                        <asp:DropDownList ID="ddlOrder" runat="server" AutoPostBack="true" onchange="if(this.value=='-1') return false;"
                                            OnSelectedIndexChanged="ddlOrder_SelectedIndexChanged">
                                            <asp:ListItem Text="排序方式" Value="-1" Selected="True"></asp:ListItem>
                                            <asp:ListItem Text="按 ID" Value="0"></asp:ListItem>
                                            <asp:ListItem Text="发布时间" Value="1"></asp:ListItem>
                                            <asp:ListItem Text="更新时间" Value="2"></asp:ListItem>
                                            <asp:ListItem Text="浏览人数" Value="3"></asp:ListItem>
                                            <asp:ListItem Text="购买意向" Value="4"></asp:ListItem>
                                        </asp:DropDownList>
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <td>
                            <table border="0" align="right" cellpadding="0" cellspacing="0">
                                <tr>
                                    <td width="80" style="color: #990000; text-align: right;">
                                        搜索：
                                    </td>
                                    <td width="80">
                                        <asp:DropDownList ID="ddlSearchType" runat="server">
                                            <asp:ListItem Text="商品名称" Value="0"></asp:ListItem>
                                            <asp:ListItem Text="发布者" Value="1"></asp:ListItem>
                                        </asp:DropDownList>
                                    </td>
                                    <td width="80">
                                        <asp:DropDownList ID="ddlSearchKey" runat="server" DataSourceID="ObjectDataSource1"
                                            DataTextField="CategoryName" DataValueField="CategoryID">
                                        </asp:DropDownList>
                                    </td>
                                    <td width="90px">
                                        <asp:TextBox ID="txtKeyWords" runat="server" Text="关键字" Style="width: 150px; text-align: left"
                                            onfocus="if(this.value=='关键字')this.value='';"></asp:TextBox>
                                    </td>
                                    <td width="60px">
                                        <asp:Button ID="Button4" runat="server" Text=" 提交 " OnClick="Button4_Click" />
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </th>
        </tr>
        <tr>
            <td width="30" class="td2">
                选中
            </td>
            <td class="td2">
                商品名称
            </td>
            <td width="60" class="td2">
                演示地址
            </td>
            <td width="30" class="td2">
                订单
            </td>
            <td width="30" class="td2">
                查看
            </td>
            <td width="70" class="td2">
                价格
            </td>
            <td width="40" class="td2">
                发布者
            </td>
            <td width="40" class="td2">
                状态
            </td>
            <td width="80px" class="td2">
                信息常规操作
            </td>
        </tr>
        <asp:Repeater ID="Repeater1" runat="server">
            <ItemTemplate>
                <tr bgcolor="#FFFFFF" onmouseover="javascript:this.bgColor='#E3E1D7'" onmouseout="javascript:this.bgColor='#FFFFFF'"
                    style="text-align: center; height: 27">
                    <td>
                        <input name='productid' type='checkbox' value='<%#Eval("ProductID") %>' style="border: none" />
                    </td>
                    <td style="text-align: left;">
                       <a href="<%# Eval("Status").ToString()=="-1"?("/show.aspx?i="+Eval("ProductID")):Eval("PathURL")%>" target="_blank"><%# Eval("Title") %></a>
                    </td>
                    <td>
                        <a href="<%#Eval("DemoURL") %>" target="_blank">演示地址</a>
                    </td>
                    <td>
                        <%#Eval("PurchaseIntentNum")%>
                    </td>
                    <td>
                        <%#Eval("Hits") %>
                    </td>
                    <td>
                        <%#Eval("Price") %>元
                    </td>
                    <td>
                        <%#Eval("UserName") %>
                    </td>
                    <td>
                        <%#Eval("Status").ToString()=="-1"?"未审核":"已审核"%>
                    </td>
                    <td>
                        <a href="Edit.aspx?i=<%# Eval("ProductID") %>">修改</a> |
                        <asp:LinkButton ID="btnDel" runat="server" OnClick="btnDel_Click" CommandArgument='<%# Eval("ProductID")%>'
                            OnClientClick="return confirm('删除后无法恢复，您是否确定删除？');">删除</asp:LinkButton>
                    </td>
                </tr>
            </ItemTemplate>
        </asp:Repeater>
        <tr>
            <td colspan="9" class="td2" style="text-align: left; height: 30px;">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td width="180">
                            <input name='chkAll' type='checkbox' id='chkAll' onclick='CheckAll(this)' value='checkbox'
                                style="border: none" />选中本页显示的所有商品
                        </td>
                        <td>
                            <asp:Button ID="Button1" runat="server" Text="批量审核" OnClick="ButtonClick" CommandArgument="0" />&nbsp;
                            <asp:Button ID="Button2" runat="server" Text="取消审核" OnClick="ButtonClick" CommandArgument="-1" />&nbsp;
                            <asp:Button ID="Button3" runat="server" Text="文字推荐" OnClick="ButtonClick" CommandArgument="1" />&nbsp;
                            <asp:Button ID="Button5" runat="server" Text="图片推荐" OnClick="ButtonClick" CommandArgument="2" />&nbsp;
                            <asp:Button ID="Button6" runat="server" Text="取消推荐" OnClick="ButtonClick" CommandArgument="3" />&nbsp;
                            <asp:Button ID="Button7" runat="server" Text="批量删除" OnClick="ButtonClick" CommandArgument="4"
                                OnClientClick="return confirm('删除后无法恢复，您是否确定删除？');" />&nbsp;
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <th colspan="9" style="text-align: center;">
                <div id="tnt_pagination">
                    <%= PageStr%></div>
                <div class="ym12_mian_y">
                </div>
            </th>
        </tr>
    </table>
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetAllList"
        TypeName="Aspx1.BLL.ProductCategory"></asp:ObjectDataSource>
</asp:Content>
