<%@ page language="C#" masterpagefile="../ShopMasterPage/MyShopMasterPage.master" autoeventwireup="true" inherits="Shop_member_Shop_MyFavourite, HoWaveVGO" title="我的收藏" enableEventValidation="false" %>
<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>
<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="tips_onclick"  style="width:94%">
                 您一共收藏了<asp:Label runat="server" ID ="LabProductCount"/>商品此分类下有
                             <asp:Label ID="LabPCProductCount" runat="server"/>个商品
            </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("ProductID") %>'  id="<%# Eval("F_ID") %>" style="width:20px"/>
                     </ItemTemplate>                   
                   </asp:TemplateField>  
                    <asp:TemplateField  >
                     <HeaderTemplate>
                        对比选中的商品
                     </HeaderTemplate>
                     <ItemTemplate>
                          <a href='../Auction/Auction.aspx?ProductID=<%# Eval("ProductID") %>' target="_blank"> <img src='<%#"../"+Eval("ProductSmallImageUrl") %>' alt=''  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='<%# "../Auction/Auction.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='<%#"../Shop1/Shop_ShopIntro.aspx?UserID="+Eval("SalerID") %>'  Target="_blank"/><br />
                            备注：<asp:Label ID="Label3" runat="server" Text='<%# Eval("F_Remark") %>'/>
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Left" />
                   </asp:TemplateField>  
                   <asp:TemplateField HeaderText="价格">
                       <ItemTemplate >
                           <asp:Label ID="LabShopType" runat="server" Text='<%# Eval("ProductType") %>' 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="操作">
                        <ItemTemplate>
                           
                           <asp:HyperLink ID="GoToShop" runat="server" Text="卖家店铺" NavigateUrl='<%# "../Shop1/MyShop.aspx?ShopID="+Eval("ShopID") %>' target="_blank"/><br /><br />
                           <a href="../../Shop/Browse/CategoryList.aspx" target="_blank">相关商品</a><br /><br />
                           <a href='Shop_AddMyFav.aspx?tag=UpdateProFav&F_ID=<%#Eval("F_ID") %>&ProductID=<%# Eval("ProductID") %>'>修改</a>
                        </ItemTemplate> 
                         <ItemStyle  CssClass="td_center"/>            
                   </asp:TemplateField>                
                 </Columns>               
             </asp:GridView>
         <br />        
         <table class="SearchTableStyle"><tr><td class="tdbg5">
             <input type="button" value="对比选中商品" onclick="doCompare()" />&nbsp;            
             <asp:Button ID="Butdelpro" runat="server" Text="删除" OnClientClick="doDelete()"  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" OnClientClick="doDelete()"  />
         </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" DataTextField="ClassName" DataValueField="ClassID">
                       <asp:ListItem Value="-1">所有</asp:ListItem>
                   </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="../../Shop/Shop1/MyShop.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='<%#"../Shop1/MyShop.aspx?ShopID="+Eval("ShopID") %>'  Target="_blank"/><br />
                       <span style="color:Gray;">店铺类别：</span><asp:HyperLink ID="ShopClass" runat="server" Text='<%# Eval("ClassName") %>' NavigateUrl='<%#"../Browse/ShopList.aspx?ParentID="+Eval("ShopCategoryID") %>' Target="_blank"/><br />
                       店主：<asp:HyperLink ID="Showsaler" runat="server" Text='<%# Eval("UserName") %>' NavigateUrl='<%# "../Shop1/Shop_Review.aspx?UserID="+Eval("UserID")%>' Target="_blank" /><br />
                       备注：<asp:Label runat="server" ID="LabFremark1" Text='<%# Eval("F_Remark") %>' />
                       </div>
                     </ItemTemplate> 
                      
                </asp:TemplateField> 
                <asp:TemplateField HeaderText="操作">
                     <ItemTemplate>
                        <a href='Shop_AddMyFav.aspx?tag=UpdateShopFav&F_ID=<%#Eval("F_ID") %>&ShopID=<%# Eval("ShopID") %>'>修改</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="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:SessionParameter  Name="F_UserID" SessionField="Howave_UserID"
             Type="Int32" DefaultValue="0" />
     </SelectParameters>
   
 </asp:ObjectDataSource>

<asp:ObjectDataSource ID="ShopmyFavouriteDataSource" runat="server" SelectMethod="GetFavShopByShopNameShopChildFPCUserID"
  TypeName="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:SessionParameter Name="F_UserID" SessionField="Howave_UserID"
          Type="Int32" DefaultValue="0" />
  </SelectParameters>
</asp:ObjectDataSource>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetAllParentClass"  TypeName="Shop_Class"/>


</asp:Content>

