<%@ page language="C#" validaterequest="false" masterpagefile="MyShop.master" enableeventvalidation="false" autoeventwireup="true" inherits="Shop_Manage_shop_product_recommend, WebApp_deploy" title="推荐商品" enableviewstate="true" %>
<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;">店长您好！请把您最好的商品拿出来推荐哦。在店铺明显位置，单个商品页面下方都会有这些商品的展示。
</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" OnItemDataBound="DataListEliteProduct_ItemDataBound" DataKeyField="ProductID" RepeatDirection="Horizontal" RepeatColumns="6" DataSourceID="EliteProductSource" CellPadding="0" BorderWidth="0px" Width="100%" OnItemCommand="DataListEliteProduct_ItemCommand"   >
<ItemTemplate>
<UL style="PADDING-RIGHT: 5px; PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; PADDING-TOP: 5px; TEXT-ALIGN: center" onmousemove="switchUL(this,'#F5F5F5')" onmouseout="switchUL(this,'#FFFFFF')">
<LI style="HEIGHT: 100px">
<A href='../ShowProduct.aspx?ProductID=<%# Eval("ProductID") %>'>
<IMG id="Editeproductimage" style="width:120px;height:120px" src='<%# "../"+Eval("ProductSmallImageUrl") %>' runat="server" /></A></LI>
<LI style="HEIGHT: 100px">
<asp:Literal id="Label2" runat="server" Text='<%# Eval("ProductName") %>' __designer:wfdid="w1"></asp:Literal>
<BR /><SPAN style="COLOR: red">
<asp:Literal id="Label3" runat="server" Text='<%# Eval("CurrentPrice") %>' __designer:wfdid="w2"></asp:Literal>元</SPAN></LI><LI>
<asp:Button id="cancle_elite" runat="server" Text="取消推荐"  __designer:wfdid="w3"  CommandName="cancelEli" CommandArgument='<%# Eval("ProductID") %>'></asp:Button></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='<%# HoWave.Web.Shop.TextFormat.GetProductType(Eval("ProductType").ToString()) %>' /><br />
                    <span><asp:Literal ID="CurrentPrice" runat="server" Text='<%# Eval("CurrentPrice") %>' /></span>
                </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="名称">
                <ItemTemplate>
                      <asp:HyperLink ID="HyperLink1" runat="server" Text='<%# Eval("ProductName") %>'  NavigateUrl='<%#  "../ShowProduct.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")) %>' width="68" />
                                        
                </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='<%#"../EditProduct.aspx?ProductID="+Eval("ProductID") %>' Target="_blank" />
                </ItemTemplate>
                </asp:TemplateField>
                </Columns>

                <PagerStyle CssClass="productPageStyle">
                </PagerStyle>
                </asp:GridView> 
</ContentTemplate>
                  <Triggers>
<asp:AsyncPostBackTrigger ControlID="ButElite" EventName="Click"></asp:AsyncPostBackTrigger>
</Triggers>
         </asp:UpdatePanel>
        <div style="text-align:center; margin-top:10px;">
             <asp:Button ID="ButElite" runat="server" OnClick="ButElite_Click" Text=" 推 荐 " />                                                  
        </div>    
  
  
<asp:ObjectDataSource ID="EliteProductSource" runat="server"   SelectMethod="GetRecommendProductBySalerID" 
TypeName="HoWave.Web.Shop_Product" UpdateMethod="SetProductElite">
    <SelectParameters>
    <asp:Parameter
      Name="SalerID"  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="HoWave.Web.Shop_Product" >
    <SelectParameters>
        <asp:Parameter DefaultValue="-1" Name="CateGoryID" Type="Int32" />
        <asp:Parameter  
         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>

