<%@ page language="C#" masterpagefile="AdminIndexMaster.master" autoeventwireup="true" inherits="HL_Admin_Admin_ShopProduct, HoWaveVGO" title="商城商品管理" enableEventValidation="false" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true"/>
<script src="Js/Function.js" type="text/javascript"></script> 

 <table class="adminheading">
       <tr>
          <th valign="middle" class="cpane" >商城商品管理</th>
           <td align="right">
            </td>
            <td class="rtdw"></td>
     </tr>
  </table> 

 <table class="nick"><tr><td colspan="4" class="tit" style="height: 25px">快速查找</td></tr>
    <tr><td class="ltd">快速查找：</td><td class="rtd" style="width:33%"><asp:DropDownList ID="QuickSearch" runat="server" Width="117px" AutoPostBack="true" OnSelectedIndexChanged="QuickSearch_SelectedIndexChanged">          
           <asp:ListItem Text="请选择" Value="-1" />
          <asp:ListItem  Text="所有商品" Value="all_product" />
          <asp:ListItem Text="上架商品" Value="on_sale" />
          <asp:ListItem Text="停止销售的商品" Value="stop_sale" />
          <asp:ListItem Text="仓库商品" Value="on_stock" />
          <asp:ListItem Text="商城推荐的商品" Value="on_top" />
          <asp:ListItem Text="卖家推荐的商品" Value="saler_recommend" />          
       </asp:DropDownList></td>
        <td class="ltd">高级查找：</td><td class="rtd" style="width:35%"><asp:DropDownList ID="DetailSearchType" runat="server" width="119px" AppendDataBoundItems="True">
         <asp:ListItem Selected="True" Value="product_name" Text="商品名称"/>
         <asp:ListItem Value="saler_name" Text="卖家名称"/>
         <asp:ListItem Value="product_class" Text="商品分类"/>
         <asp:ListItem Value="product_place" Text="商品所在地" /> 
       </asp:DropDownList>
      <asp:TextBox ID="DetailSearchName" runat="server"  Width="100px"/></td></tr>
       <tr><td class="ltd">排序方式：</td><td class="rtd" style="width:33%">      <asp:DropDownList ID="show_type" runat="server" Width="113px">
         <asp:ListItem Text="选择排序方式" Value="ProductID" Selected="True" />
         <asp:ListItem Text="上架时间" Value="BeginDate" />
         <asp:ListItem Text="价格" Value="StandPrice" />
         <asp:ListItem Text="浏览量" Value="Hits" />
         <asp:ListItem Text="库存" Value="Stocks" />
      </asp:DropDownList>&nbsp;<asp:CheckBox ID="CheckBox1" runat="server" Text="降序" /></td><td class="ltd"></td><td class="rtd" style="width:35%"></td></tr>
       <tr><td colspan="4"><div align="center"><asp:Button ID="AdminSearch" Text="查询" runat="server" OnClick="AdminSearch_Click" Width="40"/></div></td></tr>
        </table><br /> 
 <div id="product_history">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
<asp:GridView id="GridView1" runat="server" OnDataBound="GridView1_DataBound" OnRowDataBound="GridView1_RowDataBound" HeaderStyle-HorizontalAlign="Center" CssClass="adminlist" AllowSorting="True" DataKeyNames="ProductID" RowStyle-HorizontalAlign="Center" AutoGenerateColumns="False"><Columns>
<asp:TemplateField HeaderText="选中"><HeaderTemplate>
                   <input id="chkAll" onclick="SelectAllCheckboxes(this);" runat="server" type="checkbox" />全选
                 
</HeaderTemplate>

<HeaderStyle Width="10%"></HeaderStyle>
<ItemTemplate>
                     <asp:CheckBox ID="Product_Select" runat="server" />
                 
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="商品名称">
<HeaderStyle Width="15%"></HeaderStyle>
<ItemTemplate>
                  <asp:HyperLink Target="_blank" ID="ProductNameUrl" runat="server" Text='<%# Bind("ProductName") %>' NavigateUrl='<%#"../Shop/Auction/Auction.aspx?ProductID="+Eval("ProductID") %>'/>
                 
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="卖家名称">
<HeaderStyle Width="10%"></HeaderStyle>
<ItemTemplate>
                    <asp:HyperLink ID="Saler" runat="server" Text='<%# Bind("SalerId") %>' NavigateUrl='<%#"Admin_UserDetail.aspx?UserID="+Eval("SalerID") %>'/>
                 
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="ProductType" HeaderText="类型">
<HeaderStyle Width="10%"></HeaderStyle>
</asp:BoundField>
<asp:BoundField DataField="StandPrice" HeaderText="价格">
<HeaderStyle Width="10%"></HeaderStyle>
</asp:BoundField>
<asp:BoundField DataField="Stocks" HeaderText="库存">
<HeaderStyle Width="10%"></HeaderStyle>
</asp:BoundField>
<asp:TemplateField HeaderText="人气值">
<HeaderStyle Width="10%"></HeaderStyle>
<ItemTemplate>
                     <asp:Literal ID="Bid_Times_Or_Hits" runat="server" Text='<%#Eval("BidTimes")+"/"+Eval("Hits") %>'/>
                 
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="商品属性">
<HeaderStyle Width="15%"></HeaderStyle>
<ItemTemplate>
                     <asp:Literal ID="OnTop" runat="server" Text='<%# Eval("OnTop") %>'/>
                     <asp:Literal ID="IsHot" runat="server" Text='<%# Eval("IsHot") %>'/>
                     <asp:Literal ID="IsElite" runat="server" Text='<%# Eval("IsElite") %>'/>
                     <asp:HiddenField ID="ImgUrl" runat="server" Value='<%# Eval("ProductImageUrl") %>' />
                     <asp:Literal ID="HavePic" runat="server"/>
                 
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="销售中">
<HeaderStyle Width="10%"></HeaderStyle>
<ItemTemplate>
                     <asp:Literal ID="ProductOnSale" runat="server" Text='<%# Eval("EnableSingleSell") %>'/>
                  <asp:HiddenField ID="ProductOnShopSale" runat="server" Value='<%# Eval("EnableSale") %>' />
</ItemTemplate>
</asp:TemplateField>
</Columns>

<RowStyle HorizontalAlign="Center"></RowStyle>
<EmptyDataTemplate>
                <tr>
                    <th>选中</th>
                    <th>商品名称</th>
                    <th>卖家名称</th>
                    <th>类型</th>
                    <th>价格</th>
                    <th>库存</th>
                    <th>人气值</th>
                    <th>商品属性</th>
                    <th>销售中</th>
                    <th>操作</th>
                </tr>
                <tr><td>暂无商品！</td></tr>       
        
</EmptyDataTemplate>

<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
</asp:GridView> 
</ContentTemplate>
        <Triggers>
<asp:AsyncPostBackTrigger ControlID="QuickSearch" EventName="SelectedIndexChanged"></asp:AsyncPostBackTrigger>
</Triggers>
    </asp:UpdatePanel>
 </div>

 <div class="div_btm">
     <asp:Button ID="AllowSale_Button" runat="server" Text="设为上架"  CommandName="EnableSale" OnCommand="Button_Command" />
     <asp:Button ID="StopSale" runat="server" Text="暂时下架"  CommandName="StopSale" OnCommand="Button_Command" />
     <asp:Button ID="DisableSale" runat="server" Text="停止上架"  CommandName="DisableSale" OnCommand="Button_Command" />
     <asp:Button ID="Elite_Button" runat="server" Text="设为首页推荐" CommandName="ShopElite" OnCommand="Button_Command" />
     <asp:Button ID="CancleElite" runat="server" Text="取消首页推荐" CommandName="CancleShopElite" OnCommand="Button_Command" />
     <asp:Button ID="Button1" runat="server" Text="设为热卖" CommandName="IsHot" OnCommand="Button_Command" />
     <asp:Button ID="Button2" runat="server" Text="取消热卖" CommandName="CancleIsHot" OnCommand="Button_Command" />
          <asp:Button ID="Button3" runat="server" Text="设为置顶" CommandName="OnTop" OnCommand="Button_Command" />
     <asp:Button ID="Button4" runat="server" Text="取消置顶" CommandName="CancleOnTop" OnCommand="Button_Command" />
     <asp:Button ID="Delete_Button" runat="server" Text="批量删除" CommandName="Delete" OnCommand="Button_Command"  OnClientClick="return confirm('您确定要删除吗？此操作将删除所有跟删除商品相关联的数据，并且删除后不能恢复?')"/>
 </div>
 <div style="padding:10px;" align="center">
     <asp:Literal ID="CurrentPage" runat="server" />
        <asp:HiddenField ID="H_CurrentPage" runat="server" Value="0"/>
        <asp:LinkButton ID="First" runat="server" CommandArgument="first" OnClick="PagerButton_Click">首 页</asp:LinkButton>
        <asp:LinkButton ID="Prev" runat="server" CommandArgument="prev" OnClick="PagerButton_Click">上一页</asp:LinkButton>
        <asp:LinkButton ID="Next" runat="server" CommandArgument="next" OnClick="PagerButton_Click">下一页</asp:LinkButton>
        <asp:LinkButton ID="Last" runat="server" CommandArgument="last" OnClick="PagerButton_Click">尾 页</asp:LinkButton>

              到第<asp:TextBox ID="GoToPage" Width="20px" runat="server" />页<asp:Button ID="GoPageBtn" Text="确定" runat="server" OnClick="GoToPageBtn_Click" />&nbsp;
 </div>
   
</asp:Content>

