<%@ page language="C#" masterpagefile="../ShopMasterPage/MyShopMasterPage.master" autoeventwireup="true" inherits="Shop_Member_ShopProductSale, HoWaveVGO" title="出售中的商品" enableEventValidation="false" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script language="javascript" type="text/javascript" src="../Js/howave_time.js"></script> 
 <div class="pageTitle">出售中的商品</div>
 <br />
 <table class="SearchTableStyle">
    <tr>
       <td>查询商品：
           <asp:DropDownList ID="searchProductType" runat="server" AppendDataBoundItems="True">
             <asp:ListItem Selected="True" Value="-1" Text="所有"/>
             <asp:ListItem Value="1" Text="推荐"/>
             <asp:ListItem Value="0" Text="没有推荐"/>
           </asp:DropDownList></td>
       <td>商品名称：<asp:TextBox ID="ProductName" runat="server"  Width="100px" Height="16px"/></td>
       <td>商品类型：<asp:DropDownList ID="ProductType" runat="server">
         <asp:ListItem Text="全部" Value="-1" />
         <asp:ListItem Text="一口价" Value="一口价" />
         <asp:ListItem Text="拍卖" Value="拍卖" />
         <asp:ListItem Text="团购" Value="团购" />
      </asp:DropDownList></td>
       <td><asp:CheckBox ID="bid" runat="server" Text="已出价" />
      <asp:CheckBox ID="discount_join" runat="server" Text="折扣" />&nbsp;</td>
       <td><asp:DropDownList ID="show_type" runat="server">
         <asp:ListItem Text="选择排序方式" Value="-1" Selected="True" />
         <asp:ListItem Text="上架时间从近到远" Value="1" />
         <asp:ListItem Text="上架时间从远到近" Value="2" />
         <asp:ListItem Text="价格从高到低" Value="3" />
         <asp:ListItem Text="价格从低到高" Value="4" />
         <asp:ListItem Text="浏览量从高到低" Value="5" />
         <asp:ListItem Text="浏览量从低到高" Value="6" />
         <asp:ListItem Text="剩余数量从高到低" Value="7" />
         <asp:ListItem Text="剩余数量从低到高" Value="8" />
      </asp:DropDownList></td>
       <td> <asp:Button ID="search" Text="查询" runat="server" OnClick="QucikSearch_Click"/></td>       
    </tr>
 </table>
 <br />
 <div id="product_history">
     <asp:GridView ID="GridView1" runat="server" CssClass="tableHead" AutoGenerateColumns="False" DataSourceID="ObjectDataSource1" 
     RowStyle-HorizontalAlign="Center" width="98%" AllowPaging="True" DataKeyNames="ProductID" AllowSorting="True" GridLines="Horizontal" OnPageIndexChanging="GridView1_PageIndexChanging" >
         <Columns>
             <asp:TemplateField HeaderText="选择">                
                 <HeaderStyle Width="20px" />
                 <ItemTemplate>
                     <asp:CheckBox ID="Product_Select" runat="server" />
                     <asp:HiddenField ID="ProductClassID" runat="server"  Value='<%# Eval("ClassID") %>'/>
                 </ItemTemplate>
                  <HeaderTemplate>
                     <input id="chkAll" onclick="SelectAllCheckboxes(this);" runat="server" type="checkbox" />                    
                  </HeaderTemplate>
                  <HeaderStyle Width="30px" />
             </asp:TemplateField>
             <asp:TemplateField HeaderText="图片">                
                 <HeaderStyle Width="110px" />              
                 <ItemTemplate>
                     <asp:Image ID="Image1" runat="server" ImageUrl='<%# "../"+(Convert.ToString(Eval("ProductSmallImageUrl"))==""?"Images/show_nopic.gif":Eval("ProductSmallImageUrl")) %>'  />
                 </ItemTemplate>
             </asp:TemplateField>
             <asp:TemplateField HeaderText="商品名称">                 
                 <ItemTemplate>
                    <asp:HyperLink ID="ProductNameUrl" runat="server" Text='<%# Bind("ProductName") %>' NavigateUrl='<%#"../Auction/Auction.aspx?ProductID="+Eval("ProductID") %>' Target="_blank"/>
                    <asp:Label ID="ProductType" runat="server" Text='<%# Eval("ProductType") %>'  ForeColor="orangered"/>
                 </ItemTemplate>
                
             </asp:TemplateField>
             <asp:BoundField HeaderText="当前价格(起始价格)" DataField="StandPrice"  HeaderStyle-Width="120px"/>
             <asp:TemplateField HeaderText="剩余时间">                
                 <ItemTemplate>
                     <asp:Label ID="LeftTime" runat="server" Text='<%#"<script>showlefttime("+ Eval("LeftTime")+")</script>" %>'></asp:Label>
                 </ItemTemplate>
                 <HeaderStyle Width="90px" />
             </asp:TemplateField>
             <asp:TemplateField HeaderText="出价次数/浏览量">                
                 <ItemTemplate>
                     <asp:Label ID="Bid_Times_Or_Hits" runat="server" Text='<%#Eval("BidTimes")+"/"+Eval("Hits") %>'/>
                 </ItemTemplate>
                  <HeaderStyle Width="120px" />
             </asp:TemplateField>
             <asp:BoundField DataField="Stocks" HeaderText="库存" />
             <asp:TemplateField HeaderText="操作">                
                 <HeaderStyle Width="100px" />
                 <ItemTemplate>
                     <asp:HyperLink ID="editProduct" runat="server" Text="编辑" NavigateUrl='<%#"../Auction/ProductEdit.aspx?ProductID="+Eval("ProductID") %>' Target="_blank" />
                 </ItemTemplate>
             </asp:TemplateField>
         </Columns>
         <EmptyDataTemplate>
            <div class="empty_style"><asp:Label ID="Literal" Text="没有出售中的商品！" runat="server" /></div>
         </EmptyDataTemplate>
         <PagerStyle CssClass="productPageStyle" />              
     </asp:GridView>
 </div>
 <div align="center">
     <asp:Button ID="Stop_Button" runat="server" Text="商品下架，放入仓库"  CommandName="StopSale" OnCommand="Button_Command" />
     <asp:Button ID="Elite_Button" runat="server" Text="店铺推荐" CommandName="ShopElite" OnCommand="Button_Command" />
     <asp:Button ID="Delete_Button" runat="server" Text="删除" CommandName="Delete" OnCommand="Button_Command"  OnClientClick="return confirm('确定将删除所选定的商品，确认吗？')"/>
 </div>
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetOnSaleProductBySalerID" TypeName="Shop_Product" OldValuesParameterFormatString="original_{0}">
        <SelectParameters>
            <asp:SessionParameter Name="SalerID" SessionField="Howave_UserID" Type="Int32" />
        </SelectParameters>
    </asp:ObjectDataSource>
</asp:Content>