<%@ page language="C#" masterpagefile="MyShopMasterPage.master" autoeventwireup="true" enableeventvalidation="false" viewstateencryptionmode="Never" inherits="Member_Shop_MyFavourite, WebApp_deploy" title="我的收藏" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

    <script type="text/javascript">
function setButtonActive()
{
   var _flag=parseInt(<%=m_flag %>);
   var ulObj=document.getElementById("M1");  
   for(var i=0;i<ulObj.childNodes.length;i++)
     ulObj.childNodes[i].className="";
   if(ulObj.childNodes.length>2)
     {_flag=_flag*2+1;}
    ulObj.childNodes[_flag].className="active";  
}
</script>
<%--<script type="text/javascript" src="../Js/howave_time.js"></script>--%>
    <script src="Js/howave_time.js" type="text/javascript"></script>
<div class="pageTitle">我的收藏</div>
<div id="MainMenu" style="height:100%">
	<div class="TabMenu">
		<!--一级导航-->				
       <ul id="M1">
          <li class="active"><asp:LinkButton ID="LinkButton1" runat="server" Text="商品" CommandName="flag1" OnCommand="IComplain_SelectType" /></li>
          <li><asp:LinkButton ID="LinkButton2" runat="server" Text="店铺" CommandName="flag2" OnCommand="IComplain_SelectType" /></li>
       </ul>      
    </div>
    <div class="TabText">
    <asp:PlaceHolder ID="PlaceHolder1" runat="server">
            <br />      
            <div class="SearchTableStyle">
             
                &nbsp 您一共收藏了 <asp:Label runat="server" ID ="LabProductCount"/>种商品
            </div>
            <table class="SearchTableStyle"><tr>
                <td>您现在查看的是：</td>
                <td class="tdbg5"><asp:DropDownList ID="DropF_Update" runat="server" AutoPostBack="True">
                     <asp:ListItem Value="-1">所有</asp:ListItem>
                     <asp:ListItem Value="0">近期收藏</asp:ListItem>                     
                     <asp:ListItem Value="1">历史收藏</asp:ListItem>
                 </asp:DropDownList>
              <asp:DropDownList ID="DropF_ProductClassID" runat="server" AutoPostBack="True" OnSelectedIndexChanged="DropF_ProductClassID_SelectedIndexChanged">
              </asp:DropDownList>   </td>
                 <td class="tdbg5">商品名称：</td>
                 <td class="tdbg5">
                 <asp:TextBox ID="TxtProductName" runat="server" AutoCompleteType="Disabled"  AutoPostBack="True" Width="100px" Height="16px"/>
                 </td>
                 <td class="tdbg5">
                 <asp:DropDownList ID="DropProductEndDate" runat="server" AutoPostBack="True">
                     <asp:ListItem Selected="True" Value="-1">所有</asp:ListItem>
                     <asp:ListItem Value="0">即将结束</asp:ListItem>
                     <asp:ListItem Value="1">一周内结束</asp:ListItem>
                     <asp:ListItem Value="2">结束</asp:ListItem>
                 </asp:DropDownList>
                 </td>
                 <td class="tdbg5">
                 <asp:Button ID="Button3" runat="server" Text="类别管理" OnClick="Button3_Click"  /></td>
             </tr></table>
            <asp:GridView ID="GridViewProduct" runat="server" AutoGenerateColumns="false" DataSourceID="productFavouriteDatasource" 
              AllowPaging="True" DataKeyNames="F_ID"  PageSize="10" CssClass="tableHead" GridLines="None">                  
                 <Columns>
                   <asp:TemplateField>
                     <HeaderTemplate>
                        <input id="chkAll" onclick="SelectAllCheckboxes(this);"  type="checkbox" />                        
                     </HeaderTemplate>
                     <HeaderStyle Width="20px" />
                     <ItemTemplate>                        
                        <input type="checkbox" name="cb_id" value='<%# Eval("F_ID") %>'  id="<%# Eval("ProductID") %>" style="width:20px"/>
                     </ItemTemplate>       
                   </asp:TemplateField>
                    <asp:TemplateField>
                     <HeaderTemplate>
                        对比选中的商品
                     </HeaderTemplate>
                     <ItemTemplate>
                          <a href='../ShowProduct.aspx?ProductID=<%# Eval("ProductID") %>' target="_blank"> <img src='<%# (Convert.ToString(Eval("ProductSmallImageUrl"))==""?"../Images/show_nopic.gif":"../"+Eval("ProductSmallImageUrl")) %>' alt="" onerror="this.src='/Images/nopicture.gif'" align="middle" onload="ResizeImage(this,100,100)" /></a>
                     </ItemTemplate>
                     <ItemStyle Width="110px" />
                   </asp:TemplateField>    
                   <asp:TemplateField  HeaderText="基本信息">
                        <ItemTemplate>
                        <asp:HyperLink ID="ProductName" runat="server" Text='<%# Eval("ProductName") %>' NavigateUrl='<%# "../ShowProduct.aspx?ProductID="+Eval("ProductID") %>'  Target="_blank"/>
                            <br />
                            剩余时间：<asp:Label ID="LabLeftTime" runat="server" Text='<%# "<script type=\"text/javascript\">showlefttime("+ Eval("LeftTime")+")</script>" %>' /><br />
                            卖家：<asp:HyperLink ID="SalerName" runat="server" Text='<%# Eval("UserName") %>' NavigateUrl='<%#"../Store/ShopIndex.aspx?ShopID="+Eval("ShopID")+"&ColumnTag=ShopInfo" %>'  Target="_blank"/><br />
                            备注：<asp:Label ID="Label3" runat="server" Text='<%# Eval("F_Remark") %>'/>
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Left" />
                   </asp:TemplateField>  
                   <asp:TemplateField HeaderText="价格" HeaderStyle-Width="80px">
                       <ItemTemplate >
                           <asp:Label ID="LabShopType" runat="server" Text='<%# HoWave.Web.Shop.TextFormat.GetProductType(Eval("ProductType").ToString()) %>' Width="50px"/><br /><br />
                           <asp:Label ID="LabProductID" runat="server" Text='<%# Eval("ProductID") %>' Visible="False" />                             
                           <asp:Label ID="LabProductPrice" runat="server" Text='<%# Eval("ProductPrice") %>' Font-Bold="true"/>
                       </ItemTemplate> 
                       <ItemStyle CssClass="td_red" />         
                   </asp:TemplateField>
                    <asp:TemplateField HeaderText="操作"  HeaderStyle-Width="80px">
                        <ItemTemplate>
                            <asp:HiddenField ID="HiddenFID" runat="server" Value='<%#Eval("F_ID") %>'/>
                            <asp:HiddenField ID="HProductID" runat="server" Value='<%#Eval("ProductID") %>'/>
                           <asp:HyperLink ID="GoToShop" runat="server" Text="卖家店铺" NavigateUrl='<%# "../Store/ShopIndex.aspx?ShopID="+Eval("ShopID") %>' target="_blank"/><br /><br />
                           <a href="../ProductList.aspx" target="_blank">相关商品</a><br /><br />
                           <a href='AddMyFav.aspx?ProductID=<%# Eval("ProductID")%>&tag=UpdateProFav&F_ID=<%#Eval("F_ID") %>'>修改</a>
                        </ItemTemplate> 
                         <ItemStyle  CssClass="td_center"/>            
                   </asp:TemplateField>
                 </Columns>
                 
                 <EmptyDataTemplate>
                 <table class="tableHeader" style="width:98%"><tr><th><input id="chkAll" type="checkbox" /></th><th>基本信息</th><th>价格</th><th>操作</th>
                    <tr><td colspan="4">没有符合查询条件的记录！</td></tr>
                    </table></EmptyDataTemplate>               
             </asp:GridView>
         <br />        
         <table class="SearchTableStyle"><tr><td class="tdbg5">
             <input type="button" value="商品对比" onclick="doCompare()" />&nbsp;
             <%--<asp:Button ID="Button1" runat="server" Text="批量删除" OnClientClick="doDelete()"  OnCommand="FavButtonClick" CommandName="del_product"/>--%>
                       
             <asp:Button ID="Butdelpro" runat="server" Text="批量删除"  OnCommand="FavButtonClick" CommandName="del_product"/>
         </td></tr></table>
         <br />
         <table class="SearchTableStyle"><tr><td class="tdbg5" width="330">
             您可以选择多个商品,并把它们都移动到另一个分类下面：</td>
             <td class="tdbg5" width="50"><asp:DropDownList ID="DropF_ProductClassID1" runat="server"/> </td>           
             <td class="tdbg5"><asp:Button ID="MoveProductClass" runat="server" Text="移动" OnCommand="FavButtonClick" CommandName="move_product" />
         </td></tr></table>
         <br />
     </asp:PlaceHolder>
     <asp:PlaceHolder ID="PlaceHolder2" runat="server" Visible="False"  >
          <br />
          <div class="tips_onclick" style="width:94%"><div style="padding:5px 5px 5px 25px">
            您一共收藏了<asp:Label ID="LabShopCount" runat="server"/>店铺此分类下有
            <asp:Label ID="LabSCShopCount" runat="server"/>个店铺
          </div></div>
           <br />  
           <table class="SearchTableStyle"><tr>
                  <td class="tdbg5">
                   收藏店铺类别：</td>
                   <td class="tdbg5">
                   <asp:DropDownList ID="DropF_ShopClassID" runat="server" AutoPostBack="True" OnSelectedIndexChanged="DropF_ShopClassID_SelectedIndexChanged">
                   </asp:DropDownList></td>
                   <td class="tdbg5">店铺名称：</td>
                   <td class="tdbg5"><asp:TextBox ID="TxtShopName" runat="server" AutoCompleteType="Disabled" AutoPostBack="True" Width="105px" Height="16px"/></td>
                   <td class="tdbg5">商城店铺类别：</td>
                   <td class="tdbg5">
                   <%--<asp:DropDownList ID="DropShopChildID" runat="server" AutoPostBack="True" AppendDataBoundItems="True" DataSourceID="ObjectDataSource1" OnSelectedIndexChanged="DropShopChildID_SelectedIndexChanged" DataTextField="ClassName" DataValueField="ClassID">
                       <asp:ListItem Value="-1">所有</asp:ListItem>
                   </asp:DropDownList>--%>
                   <asp:DropDownList ID="DropShopChildID" runat="server" AutoPostBack="True" OnSelectedIndexChanged="DropShopChildID_SelectedIndexChanged">
                   </asp:DropDownList>
                   </td>
                   <td class="tdbg5">
                   <asp:Button ID="Button7" runat="server" Text="类别管理" OnClick="Button7_Click"  />
                 </td>
               </tr>
           </table>    
         <asp:GridView DataKeyNames="F_ID" ID="GridViewShop" PageSize="10"  DataSourceID="ShopmyFavouriteDataSource" runat="server"
            AutoGenerateColumns="False"  AllowPaging="True" GridLines="None" CssClass="tableHead">
           <Columns>
                <asp:TemplateField>
                    <HeaderTemplate>
                       <input id="chkAll" onclick="SelectAllCheckboxes(this);"  type="checkbox" />
                    </HeaderTemplate>
                     <HeaderStyle Width="20px" /> 
                     <ItemTemplate>
                       <input type="checkbox" name="cb_id" value='<%# Eval("F_ID") %>' style="width:20px"/>
                     </ItemTemplate> 
                    <ItemStyle Width="20px" />
                </asp:TemplateField> 
                <asp:TemplateField HeaderText="店标">
                     <ItemTemplate>
                       <a href="../Store/ShopIndex.aspx?ShopID=<%#Eval("ShopID") %>"  target="_blank"><img src='<%# Eval("ShopImageUrl") %>' onload="ResizeImage(this,100,100)"/></a>
                     </ItemTemplate>  
                     <HeaderStyle Width="110px" /> 
                </asp:TemplateField> 
                 <asp:TemplateField HeaderText="基本信息">
                     <ItemTemplate>
                       <div  class="fav">
                       <asp:HyperLink ID="shopname" runat="server" Text='<%# Eval("ShopName") %>' NavigateUrl='<%#"../Store/ShopIndex.aspx?ShopID="+Eval("ShopID") %>'  Target="_blank"/><br />
                       <span style="color:Gray;">店铺类别：</span><asp:HyperLink ID="ShopClass" runat="server" Text='<%# Eval("ClassName") %>'/><br />
                       店主：<asp:HyperLink ID="Showsaler" runat="server" Text='<%# Eval("UserName") %>' Target="_blank" /><br />
                       备注：<asp:Label runat="server" ID="LabFremark1" Text='<%# Eval("F_Remark") %>' />
                       </div>
                     </ItemTemplate> 
                </asp:TemplateField> 
                <asp:TemplateField HeaderText="操作">
                     <ItemTemplate>
                        <a href='AddMyFav.aspx?ShopID=<%# Eval("ShopID") %>&tag=UpdateShopFav&F_ID=<%#Eval("F_ID") %>&SValue=<%=GetDropF_ShopClassID()%>'>修改</a>
                     </ItemTemplate> 
                     <HeaderStyle Width="60px" />  
                </asp:TemplateField>                      
           </Columns>           
       </asp:GridView>
        <br />
        <table class="SearchTableStyle"><tr><td class="tdbg5">
        <asp:Button ID="DelShop" runat="server" Text="删除"  OnCommand="FavButtonClick" CommandName="del_shop" />
        </td></tr></table>
        <br />
        <table class="SearchTableStyle"><tr><td class="tdbg5" width="330">
            您可以选择多个店铺,并把它们都移动到另一个分类下面：</td>
            <td class="tdbg5" width="50"><asp:DropDownList ID="DropF_ShopClassID1" runat="server"/> </td>                        
            <td class="tdbg5"><asp:Button ID="MoveShopClass" runat="server" Text="移动类别" OnCommand="FavButtonClick" CommandName="move_shop"  />
        </td></tr></table>
        <br />  
     </asp:PlaceHolder>  
     <asp:PlaceHolder ID="PlaceHolder3" runat="server" Visible="False"  />
     </div>  
    <div style="clear:both; height:3px"></div>
</div>          
<script type="text/javascript">setButtonActive();</script>     
<asp:ObjectDataSource ID="productFavouriteDatasource" runat="server" SelectMethod="GetFavProByUpdtPNamePEdtFPCUserID"
     TypeName="HoWave.Web.Shop_MyFavourite" >
     <SelectParameters>
         <asp:ControlParameter ControlID="DropF_Update" DefaultValue="-1" Name="F_Update"
             PropertyName="SelectedValue" Type="Int32" />
         <asp:ControlParameter ControlID="TxtProductName" DefaultValue="" Name="ProductName"
             PropertyName="Text" Type="String" />
         <asp:ControlParameter ControlID="DropProductEndDate" DefaultValue="-1" Name="ProductEndDate"
             PropertyName="SelectedValue" Type="Int32" />
         <asp:ControlParameter ControlID="DropF_ProductClassID" DefaultValue="-1" Name="F_ProductClassID"
             PropertyName="SelectedValue" Type="Int32" />
       
         <asp:Parameter  Name="F_UserID"  
             Type="Int32" DefaultValue="0" />
     </SelectParameters> 
 </asp:ObjectDataSource>
<asp:ObjectDataSource ID="ShopmyFavouriteDataSource" runat="server" SelectMethod="GetFavShopByShopNameShopChildFPCUserID"
  TypeName="HoWave.Web.Shop_MyFavourite" >
  <SelectParameters>
      <asp:ControlParameter ControlID="TxtShopName" Name="ShopName" PropertyName="Text"
          Type="String" DefaultValue="" />
      <asp:ControlParameter ControlID="DropShopChildID" DefaultValue="-1" Name="ShopChildID"
          PropertyName="SelectedValue" Type="Int32" />
      <asp:ControlParameter ControlID="DropF_ShopClassID" DefaultValue="-1" Name="F_ShopClassID"
          PropertyName="SelectedValue" Type="Int32" /> 
      <asp:Parameter Name="F_UserID"  
          Type="Int32" DefaultValue="0" />
  </SelectParameters>
</asp:ObjectDataSource>
<%--<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetRootClass"  TypeName="HoWave.Web.Shop_Class"/>--%>
</asp:Content>

