<%@ page language="C#" validaterequest="false" masterpagefile="~/Shop/ShopMasterPage/MyShop.master" enableeventvalidation="false" autoeventwireup="true" inherits="Shop_Manage_shop_product_recommend, HoWaveVGO" title="推荐商品" enableviewstate="false" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script type="text/javascript" >
function switchUL(obj,col){
    obj.style.backgroundColor=col;
    
}
</script>
<div class="pageTitle">推荐商品管理</div>
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true"/>    
<div class="tips_onclick"  style="width:94%"><div style="padding:5px 5px 5px 25px;">店长您好！请把您最好的6件商品拿出来推荐哦。在店铺明显位置，单个商品页面下方都会有这6件商品的展示。
</div></div>

<div class="SearchTableStyle" style="width:98%; padding-left:0;"><div class="title"><span>已推荐商品</span></div></div>
<div style="width:98%; margin:0 auto;">
<asp:UpdatePanel ID="UpdatePanel2" runat="server">
<ContentTemplate>
<asp:DataList id="DataListEliteProduct" runat="server" Width="100%" BorderWidth="0px" CellPadding="0" DataSourceID="EliteProductSource" RepeatColumns="6" RepeatDirection="Horizontal" DataKeyField="ProductID" OnItemDataBound="DataListEliteProduct_ItemDataBound">
    <ItemTemplate>                 
            <ul onmousemove="switchUL(this,'#F5F5F5')" onmouseout="switchUL(this,'#FFFFFF')" style="padding:5px; text-align:center;">
               <li style="height:100px;">
               <a href='../Auction/Auction.aspx?ProductID=<%# Eval("ProductID") %>'>
               <img id="Editeproductimage" runat="server"  src='<%# "../"+Eval("ProductSmallImageUrl") %>' /></a></li>             
               <li style="height:100px;">
               <asp:Literal ID="Label2" runat="server" Text='<%# Eval("ProductName") %>'/><br /><span style="color:Red"><asp:Literal ID="Label3" runat="server" Text='<%# Eval("ProductPrice") %>'/>元</span></li>
               <li><asp:Button ID="cancle_elite" runat="server" Text="取消推荐"  CommandName=<%# Eval("ProductID") %> OnCommand="Cancle_Elite"/></li>
            </ul>             
    </ItemTemplate>
    
    </asp:DataList> 
</ContentTemplate>      
</asp:UpdatePanel>
</div>
  <div class="SearchTableStyle" style="width:98%; padding-left:0;">    
        <div class="title"><span>添加推荐商品</span></div>   
        <div>
          &nbsp;方法一：输入商品标题搜索<asp:TextBox ID="KeyWords" runat="server"/><asp:Button ID="Button1" runat="server" Text="搜索" OnClick="Button3_Click" /><br />
          &nbsp;方法二：直接选择商品
        </div>
  </div>      
        <div style="clear:both"></div>
         <asp:UpdatePanel ID="UpdatePanel1" runat="server">
              <ContentTemplate>
<asp:GridView id="GVProduct" runat="server" DataSourceID="ProductDataSource" CssClass="tableHead" AllowPaging="True" AutoGenerateColumns="False" DataKeyNames="ProductID" Border="0" OnDataBound="GVProduct_DataBound"><Columns>
                <asp:TemplateField HeaderText="推荐">
                <ItemTemplate>
                                            
                        <input  type="checkbox" name="chk_select" value='<%# Eval("ProductID") %>' />
                                        
                </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="商品类型">
                <ItemTemplate>
                    <asp:Literal ID="ProductType"  runat="server" Text='<%# Eval("ProductType") %>' /><br />
                    <span><asp:Literal ID="ProudctPrice" runat="server" Text='<%# Eval("ProductPrice") %>' /></span>
                                        
                </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="名称">
                <ItemTemplate>
                      <asp:HyperLink ID="HyperLink1" runat="server" Text='<%# Eval("ProductName") %>'  NavigateUrl='<%#  "../Auction/Auction.aspx?ProductID="+Eval("ProductID") %>'/>
                                        
                </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="图片">
                <ItemTemplate>
                     <img  runat="server"  id="productimage" src='<%# "../"+ ((Convert.ToString(Eval("ProductSmallImageUrl"))=="")?"Images/show_nopic.gif":Eval("ProductSmallImageUrl")) %>' />
                                        
                </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="结束时间"><ItemTemplate>
                    <asp:Literal ID="EndDate"  runat="server" Text='<%#Eval("EndDate")%>' />
                                        
                </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="操作"><ItemTemplate>
                     <asp:HyperLink ID="EditProduct" runat="server" Text="编辑" NavigateUrl='<%#"../Auction/ProductEdit.aspx?ProductID="+Eval("ProductID") %>' Target="_blank" />
                                        
                </ItemTemplate>
                </asp:TemplateField>
                </Columns>

                <PagerStyle BackColor="PaleGoldenrod">
                </PagerStyle>
                </asp:GridView> 
</ContentTemplate>
                  <Triggers>
<asp:AsyncPostBackTrigger ControlID="ButElite" EventName="Click"></asp:AsyncPostBackTrigger>
</Triggers>
         </asp:UpdatePanel>
        <div style="text-align:center;">
             <asp:Button ID="ButElite" runat="server" OnClick="ButElite_Click" Text="推荐" />                                                  
        </div>    
  
  
<asp:ObjectDataSource ID="EliteProductSource" runat="server"   SelectMethod="GetRecommendProductBySalerID" TypeName="Shop_Product" UpdateMethod="SetProductElite">
    <SelectParameters>
        <asp:SessionParameter Name="SalerID" SessionField="Howave_UserID" Type="Int32" />
    </SelectParameters>
    <UpdateParameters>
        <asp:Parameter Name="IsElite" Type="Boolean" />
        <asp:Parameter Name="ProductID" Type="Int32" />
    </UpdateParameters>
</asp:ObjectDataSource>
<asp:ObjectDataSource ID="ProductDataSource" runat="server" SelectMethod="GetProductByCategoryIDShopIDKeywords"
    TypeName="Shop_Product" >
    <SelectParameters>
        <asp:Parameter DefaultValue="-1" Name="CateGoryID" Type="Int32" />
        <asp:CookieParameter CookieName="Howave_ShopID" DefaultValue="" Name="ShopID" Type="Int32" />
        <asp:ControlParameter ControlID="KeyWords" Name="KeyWords" PropertyName="Text" Type="String" />
        <asp:Parameter DefaultValue="-1" Name="DateTimeSect" Type="String" />
    </SelectParameters>
</asp:ObjectDataSource>            
</asp:Content>

