<%@ page language="C#" masterpagefile="../ShopMasterPage/MyShopMasterPage.master" autoeventwireup="true" inherits="Shop_Member_Shop_ProductInStock, HoWaveVGO" title="仓库商品" enableEventValidation="false" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
 <div class="pageTitle">仓库里的商品</div>
 <br />
<table class="SearchTableStyle">
    <tr class="tdbg">
        <td class="tdbg5">查询：</td>
        <td class="tdbg5">
  <asp:RadioButtonList  runat="server" RepeatDirection="Horizontal" AutoPostBack="true" ID="InStockProductType">
     <asp:ListItem Text="没卖出的商品" Value="NotSoldAll" Selected="True" />    
     <asp:ListItem Text="部分卖出商品" Value="NotSoldOut"  />
     <asp:ListItem Text="等待上架的商品" Value="WaitOnSale" />     
     <asp:ListItem Text="全部卖完的商品" Value="SoldOut" /> 
     <asp:ListItem Text="被禁止上架的商品" Value="StopSell" /> 
  </asp:RadioButtonList>
 </td>      
        <td class="tdbg5">商品名称： </td>
        <td class="tdbg5"><asp:TextBox ID="ProductName" runat="server" Width="80px" Height="18px"/></td>
        <td class="tdbg5"><asp:Button ID="Button1" runat="server" Text="查询" />
  </td></tr>
</table>
<br />
<div style="clear:both;"></div>  
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"  AllowPaging="true" PageSize="20" CssClass="tableHead" DataKeyNames="ProductID" 
       DataSourceID="ObjectDataSource1" OnRowDataBound="GridView1_RowDataBound1" GridLines="Horizontal" Width="98%" EnableViewState="false">
        <Columns>
            <asp:TemplateField HeaderText="选择">
               <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>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="图片">
               <ItemTemplate>
                  <asp:Image ID="Product_Image" runat="server" ImageUrl='<%#"../"+Eval("ProductSmallImageUrl") %>'  />
                   <ItemStyle Width="20%" />
               </ItemTemplate>
             </asp:TemplateField>
              <asp:TemplateField HeaderText="商品名称">
               <ItemTemplate>
                  <asp:HyperLink ID="ProductName" runat="server"  Text='<%# Eval("ProductName") %>'  NavigateUrl='<%#"../Auction/Auction.aspx?ProductID="+Eval("ProductID") %>'  Target="_blank"/>
                  <asp:Label ID="ProductType" runat="server" Text='<%# Eval("ProductType") %>'  ForeColor="orangered"/>
               </ItemTemplate>
               <ItemStyle Width="24%" HorizontalAlign="Left" />
             </asp:TemplateField>               
             <asp:BoundField DataField="CreateTime" HeaderText="创建时间"  ItemStyle-Width="10%"/>
            <asp:BoundField DataField="BeginDate" HeaderText="开始时间" ItemStyle-Width="10%"/>
            <asp:BoundField DataField="EndDate" HeaderText="结束时间" ItemStyle-Width="10%"/>
            <asp:BoundField DataField="StandPrice" HeaderText="价格" ItemStyle-Width="8%"/>
            <asp:BoundField DataField="Stocks" HeaderText="数量" ItemStyle-Width="8%"/>
            <asp:HyperLinkField HeaderText="编辑" DataNavigateUrlFields="ProductID"  DataTextFormatString="编辑" DataNavigateUrlFormatString="../Auction/ProductEdit.aspx?ProductID={0}" Target="_blank"   DataTextField="ProductID"/>
            
        </Columns>
        <EmptyDataTemplate><div style="text-align:center; font-size:14px">暂无记录！</div></EmptyDataTemplate>
        <PagerStyle CssClass="productPageStyle" />            
    </asp:GridView>

<div align="center">
     <asp:Button ID="OnSale_Button" runat="server" Text="商品上架"  CommandName="OnSale" OnCommand="StockPorityButton_Command" />    
     <asp:Button ID="Delete_Button" runat="server" Text="删除" CommandName="Delete" OnCommand="StockPorityButton_Command"  OnClientClick="return confirm('确定将删除所选定的商品，确认吗？')"/>
  
 </div>
  <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetInStockProductsBySalerID" TypeName="Shop_Product" OldValuesParameterFormatString="original_{0}">
      <SelectParameters>
          <asp:SessionParameter Name="SalerID" SessionField="Howave_UserID" Type="Int32" />
          <asp:ControlParameter ControlID="InStockProductType" DefaultValue="NotSoldAll" Name="Type"
              PropertyName="SelectedValue" Type="String" />
      </SelectParameters>
  </asp:ObjectDataSource>
</asp:Content>

