<%@ page language="C#" autoeventwireup="true" inherits="Shop_Browse_ShopCategory, HoWaveVGO" enableviewstate="false" enableEventValidation="false" %>
<html>
<head></head>
<body>
<form id="form_1" runat="server">
 <link type="text/css" href="../../skin/css/browse/ShopCategory.css" rel="stylesheet" />
<script language="javascript" type="text/javascript" src="../Js/howave_time.js"></script>
<div id="Category_Content">   
   <!--分类导航条-->
   <div id="Catergor_Navgitor">
      <hl:ClassMapPath id="ClassMapPath1" runat="server"/>
   </div>
   
   <!--子分类列表-->
   <div id="ChildClass_List">
     <div>您可以选择下面的详细分类：</div>
     <asp:DataList ID="ChildCategory" runat="server" DataKeyField="ClassID" DataSourceID="ObjectDataSource1"
        Height="100%" RepeatColumns="5" Width="100%"  >
        <ItemTemplate>
           <asp:HyperLink ID="ProName" runat="server" NavigateUrl='<%# "ShopCategory.aspx?othertype="+m_other+"&ParentID="+Eval("ClassID") %>' Text='<%# Eval("ClassName") %>'></asp:HyperLink>
           <span>(<asp:literal ID="ClassProducCount" runat="server"  Text='<%# Eval("ItemCount") %>'/>)</span>
        </ItemTemplate>
        
     </asp:DataList>
   </div>
   <!--主栏目-->
   <div id="Main_Frame">     
         
      <!--商品展示主栏-->
      <div id="Product_List">
      <div id="mainSarR">  
         <!--商品显示按钮栏-->
         <div id="MainMenu">
	         <div class="TabMenu">
		     <!--一级导航-->				
                <ul id="M1" >
                       <li class="active"><asp:HyperLink ID="allLink" runat="server" Text="所有商品" /></li><li><asp:HyperLink ID="recommendLink" runat="server" Text="橱窗推荐" /></li><li><asp:HyperLink ID="commondLink" runat="server" Text="集市商品" /></li><li><asp:HyperLink ID="bandShopLink" runat="server" Text="品牌商城" /></li><li><asp:HyperLink ID="secondhandLink" runat="server" Text="二手/闲置" /></li></ul>
             </div>
             <script type="text/javascript">
                function setButtonActive(flags)
                {
                   var _flag=parseInt(flags);
                   var ulObj=document.getElementById("M1");  
                   for(var i=0;i<ulObj.childNodes.length;i++)
                     ulObj.childNodes[i].className="";
                     //alert(ulObj.childNodes.length);
                     _flag=_flag+ulObj.childNodes.length-5;
                     ulObj.childNodes[_flag].className="active";  

                }
                setButtonActive(<asp:literal id="ButtonIndex" runat="server"/>);
            </script>
             <!--商品显示方式选择栏-->
             <div id="Prodcut_Show_Type">
                <div class="show_num">每页显示数量：</div>
                <div class="show_page">
                   <asp:HyperLink ID="Page20Link" runat="server"><asp:Image ImageUrl="../Images/page_20.gif" runat="server" ID="Page_20" /></asp:HyperLink>
                   <asp:HyperLink ID="Page40Link" runat="server"><asp:Image ImageUrl="../Images/page_40.gif" runat="server" ID="Page_40"/></asp:HyperLink>
                   <asp:HyperLink ID="Page80Link" runat="server"><asp:Image ImageUrl="../Images/page_80.gif" runat="server" ID="Page_80"/></asp:HyperLink>
                </div>
                <div class="show_place">                       
                       <asp:DropDownList ID="F_ProductPlace" runat="server" DataSourceID="ObjectDataSource5" DataTextField="City" DataValueField="City" AppendDataBoundItems="True" AutoPostBack="true" OnSelectedIndexChanged="SortAndPlaceSelectIndexChange" >
                          <asp:ListItem Text="所在地" Value="-1" />
                       </asp:DropDownList>
                       &nbsp;&nbsp;
                       <asp:DropDownList ID="Sort_Type" runat="server" Width="120px"  AutoPostBack="true" OnSelectedIndexChanged="SortAndPlaceSelectIndexChange">
                          <asp:ListItem Text="选择排序方式" Value="-1" />
                          <asp:ListItem Text="价格从低到高" Value="1" />
                          <asp:ListItem Text="价格从高到低" Value="2" />
                          <asp:ListItem Text="时间从小到多" Value="3" />
                          <asp:ListItem Text="时间从多到小" Value="4" />
                          <asp:ListItem Text="卖家信用从高到低" Value="5" />
                          <asp:ListItem Text="卖家信用从低到高" Value="6" />
                          <asp:ListItem Text="浏览量从高到低" Value="7" />
                          <asp:ListItem Text="浏览量从低到高" Value="8" />
                       </asp:DropDownList>
                        
                </div>
             </div>   
             <div style="clear:both"></div>
             <div id="PreviewBox" onmouseout="hidePreview(event);">
	            <div class="Picture" onmouseout="hidePreview(event);">
		            <span></span>
		            <div>
			            <a id="previewUrl" href="javascript:void(0)" target="_blank"><img oncontextmenu="return(false)" id="PreviewImage" src="about:blank" border="0" onmouseout="hidePreview(event);" /></a>
		            </div>
	            </div>
            </div>
            <script type="text/javascript" src="../Js/picPreview.js"></script>
              
             <div id="Porduct_List_Main">     
           　    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"  CssClass="ProductList" 
           　     OnRowDataBound="GridView1_RowDataBound" DataKeyNames="ProductID" AllowPaging="True" 
                  AllowSorting="True"  EnableViewState="false" BorderWidth="0" OnPageIndexChanging="GridView1_OnPageIndexChanging" EmptyDataText="暂无商品！">
                 <Columns>             
                    <asp:TemplateField>
                       <ItemTemplate>
                          <input type="checkbox" name="cb_id" value='<%# Eval("ProductID") %>' />
                       </ItemTemplate>
                       <HeaderTemplate>
                              <img src="../Images/Category_Compare_Left.gif" onclick="doCompare()" style="cursor:pointer" />
                           </HeaderTemplate>
                     </asp:TemplateField>
                    
                    <asp:TemplateField>
                       <ItemTemplate>
                       <div class="PicItem">
                          <div class="Pic">
                             <a href='<%#"../Auction/Auction.aspx?ProductID="+ Eval("ProductID") %>' Target="_blank" style="background:url(<%#"../"+Eval("ProductSmallImageUrl")+""%>) no-repeat" onmouseover='showPreview(event);' onmouseout='hidePreview(event);'>
                              <asp:Image ID="ProductImage" runat="server"  ImageUrl='<%#"../"+Eval("ProductSmallImageUrl")%>' /></a>
                          </div> 
                        </div>
                                        
                       </ItemTemplate>
                       <HeaderTemplate>  
                          <img src="../Images/Category_Compare_Btn.gif" onclick="doCompare()" style="cursor:pointer" />                 
                       </HeaderTemplate>
                
                       <HeaderStyle Width="15%" />
                    </asp:TemplateField>
                    <asp:TemplateField>
                       <HeaderTemplate>商品名称/卖家</HeaderTemplate>
                       <ItemTemplate>
                           <b><a href='<%#"../Auction/Auction.aspx?ProductID="+ Eval("ProductID") %>' target="_blank" ><%#Eval("ProductName") %></a></b> <br />
                               卖家:<a href='<%#"../Shop1/Shop_ShopIntro.aspx?UserID="+ Eval("SalerID") %>' style="color:Gray;"><%#Eval("ShopOwnerName") %></a> <asp:Literal ID="BandShop" runat="server" Text='<%# Eval("ShopLevel") %>' /><br /> 
                             <a href='<%# "http://wpa.qq.com/msgrd?V=1&Uin="+Eval("OICQ")+"&amp;Site="+Eval("ShopOwnerName")+"&amp;Menu=yes" %>' target="_blank">                          
                                 <asp:Image  ID="QQImage" ImageUrl='<%# Eval("OICQ")%>' runat="server" />
                             </a>
                             <a href="http://amos1.taobao.com/msg.ww?v=2&amp;Uid=<%#Server.UrlEncode(Convert.ToString(Eval("Taobaowangwang"))) %>&s=2" target="_blank">
                             <asp:Image ID="TaobaoImage" ImageUrl='<%# Eval("Taobaowangwang") %>' runat="server"  AlternateText="点击此可以直接和对方交流"/></a>
                              <br />
                               <a href='<%#"../Member/Shop_AddMyFav.aspx?ProductID="+Eval("ProductID")+"&tag=AddProFav" %>'  Target="_blank">收藏</a>                           
                       </ItemTemplate>
                       <HeaderStyle Width="42%" />
                       <ItemStyle HorizontalAlign="Left" />
                    </asp:TemplateField>   
                    <asp:TemplateField>
                        <HeaderTemplate>价格</HeaderTemplate>
                       <ItemTemplate>
                          <asp:Literal ID="ProductType" Text='<%#Eval("ProductType") %>' runat="server" /><br /> 
                           <asp:PlaceHolder ID="TeamPeopleLeft_Display" runat="server" Visible="false">
                               还剩<asp:Literal ID="TeamPeopleLeft" Text='<%#Eval("LeftPeople")%>' runat="server" />人
                           </asp:PlaceHolder>
                           <span><asp:Literal ID="ProductPrice" Text='<%#Eval("ProductPrice")%>' runat="server" />元</span>
                                              
                       </ItemTemplate>
                       <HeaderStyle Width="10%" />
                    </asp:TemplateField>
                     <asp:TemplateField>
                        <HeaderTemplate>
                          所在地
                       </HeaderTemplate>
                       <ItemTemplate>
                          <asp:Literal ID="ProductPlace" Text='<%#Eval("ProductPlace") %>' runat="server" />                                          
                       </ItemTemplate>
                       <HeaderStyle Width="10%" />
                    </asp:TemplateField>
                     <asp:TemplateField>
                        <HeaderTemplate>浏览量</HeaderTemplate>
                       <ItemTemplate>
                          <asp:Literal ID="Hits" Text='<%# Eval("Hits") %>' runat="server" />                                          
                       </ItemTemplate>
                       <HeaderStyle Width="10%" />
                    </asp:TemplateField>
                     <asp:TemplateField>
                        <HeaderTemplate>剩余时间</HeaderTemplate>
                       <ItemTemplate>
                         <asp:Literal ID="LeftTime" Text='<%#"<script>showlefttime("+ Eval("LeftTime")+")</script>" %>' runat="server" />                                                        
                       </ItemTemplate>
                       <HeaderStyle Width="10%" />
                    </asp:TemplateField>               
                 </Columns> 
                 <AlternatingRowStyle CssClass="AltrowStyle" />
                 <PagerSettings  PageButtonCount=10  Mode=NumericFirstLast   Visible="false"/>
                
                 <PagerStyle CssClass="productPageStyle" />
                 
              </asp:GridView>  
               <div class="productPageStyle" >
                    <asp:Literal ID="CurrentPage" runat="server" />页
                     &nbsp;&nbsp;
                  
                     <asp:LinkButton ID="Pre_Page" runat="server"  Text="<img src='../Images/pre_page_1.gif' style='border:0; vertical-align:middle;height:18px' />"  ToolTip="上一页" CommandName="Pre" OnCommand="PagerButton_Click"/>
                     <asp:LinkButton ID="FirstPage" runat="server" Text="1" CommandName="First" OnCommand="PagerButton_Click" />&nbsp;
                    
                     <asp:PlaceHolder ID="NumberPageHolder" runat="server" />
                     <asp:LinkButton ID="LastPage" runat="server" Text="尾页" CommandName="Last" OnCommand="PagerButton_Click"/>
                     <asp:LinkButton ID="Next_Page" runat="server"  Text="<img src='../Images/next_page_1.gif' style='border:0; vertical-align:middle;height:18px' />" ToolTip="下一页" CommandName="Next" OnCommand="PagerButton_Click"/>
                     到 第
                     <asp:TextBox ID="GoPageNum" runat="server" Width="30px" /><asp:Button ID="GoPageButton" runat="server" CommandName="GoPage" OnCommand="PagerButton_Click" Text="查看"  OnClientClick="return CheckGoPage();"/>
                     
                 </div>
               
             </div>
          
         </div>
      </div>
      
    </div>
      <!--侧栏-->
      <div id="Side_Bar">
            <!--筛选-->
            <div class="SideBox">
                <div class="title"><b>商品筛选</b></div>
                <hl:ProductDetailSearch ID="ProductDetailSearch1" runat="server" />
            </div>
            <!--搜索-->
           
            
             <div class="SideBox">
                <div class="title"><b>商城推荐</b></div>
               
            </div>
            <div class="SideBox">
                <div class="title"><b>热销商品</b></div>
                <div class="ListShop_E">          
                 
                </div>
            </div>
            <iframe src="../Auction/LastVisited.aspx" style="border:0" frameborder="0" width="200px" scrolling="no" id="myTestFrameID" onload="javascript:{dyniframesize('myTestFrameID');}" ></iframe>
            
	  </div> 
   </div>
   
 </div>   
 <div style="clear:both"></div> 
 <script type="text/javascript">

     
function CheckGoPage()
{
   var flag=false;
   var _Gopage=document.getElementById("ctl00_ContentPlaceHolder1_GoPageNum").value;
   if(_Gopage!="")
   {
      if(isNaN(_Gopage))
      {
           alert("你输入的页码包含其它字符，请重新输入！");
           
      }
      else if(parseInt(_Gopage)<1)
      {
         alert("输入页码过小，请输入正确页面！");
      }
      else
      {
         flag=true;
      }      
      
   }
   else
   {
      alert("输入页码过小，请输入正确页面！");
   }
   return flag;
}
</script>

      <asp:HiddenField ID="H_pageIndex" runat="server" Value="1" />
      <asp:HiddenField ID="H_pageSize" runat="server" Value="20" />
      <asp:HiddenField ID="H_productPlace" runat="server" Value="-1" />
      <asp:HiddenField ID="H_sortType" runat="server" Value="-1" />     
      <asp:HiddenField ID="H_parentid" runat="server" Value="0" />
      <asp:HiddenField ID="H_OtherType" runat="server" Value="all" />
      <asp:HiddenField ID="H_PageCount" runat="server" Value="1" />
   
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetCategoryListByParentID" TypeName="Shop_Class">
        <SelectParameters>
            <asp:QueryStringParameter DefaultValue="0" Name="ParentID" QueryStringField="ParentID"  Type="Int32" />
        </SelectParameters>
    </asp:ObjectDataSource>
   
    <asp:ObjectDataSource ID="ObjectDataSource3" runat="server" SelectMethod="GetClassMapPathByParentID"   TypeName="Shop_Class">
        <SelectParameters>
            <asp:QueryStringParameter DefaultValue="0" Name="ParentID" QueryStringField="ParentID"  Type="Int32" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <asp:ObjectDataSource ID="ObjectDataSource5" runat="server" SelectMethod="GetImportantCityByFlag"  TypeName="Shop_City"></asp:ObjectDataSource>
  
</form>
</body>
</html>





