<%@ page language="C#" enableeventvalidation="false" autoeventwireup="true" inherits="Shop_Browse_browse_offer, mallz" title="求购信息" %>
<%@OutputCache Duration="600"  VaryByParam="*" VaryByControl="TreeView1;TxtRequestTitle;F_ProductPlace"  %>

<form id="form_1" runat="server" visible="false">
<link type="text/css" href="../../skin/css/browse/ShopCategory.css" rel="stylesheet" />
<script language="javascript" type="text/javascript" src="../Js/mallz_time.js"></script> 
<asp:ScriptManager id="ScriptManager1" runat="server"/>


<div id="Category_Content" style="left: 0px; top: -5px">
<!--上-->
    <div id="Catergor_Navgitor">
       <asp:UpdatePanel id="UpdatePanel2" runat="server"> 
             <contenttemplate> 
                  <asp:Label ID="Reuqest_Class" runat="server" Text="所有分类"/>
                   <asp:Label ID="TxtClassID" runat="server" Text="0" Visible="False" />
                  <asp:Label ID="TxtClassName" runat="server" Visible="False" />
             </contenttemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="TreeView1" EventName="SelectedNodeChanged"></asp:AsyncPostBackTrigger>
            </Triggers> 
       </asp:UpdatePanel>
      
    </div>
    <!--下-->
    <!--主栏目开始-->
    <div id="Main_Frame">
    <!--右-->
        <div id="Product_List">
              <div id="mainSarR">
              <!--商品显示按钮栏-->
                     <div id="MainMenu">
		                 <!--一级导航-->
		                 <div class="TabMenu">
                            <ul id="M1" >
                               <li class="active"><a href="#">所有商品</a></li></ul>
                         </div>
                         <!--商品显示方式选择栏-->
                         <div id="Prodcut_Show_Type">
                            <div class="show_num">
                                <asp:UpdatePanel id="UpdatePanel4" runat="server">
                                    <contenttemplate>
                                        <asp:Label ID="ProductCount" runat="server" />
                                    </contenttemplate>
                                    <Triggers>
                                     <asp:AsyncPostBackTrigger ControlID="TreeView1" EventName="SelectedNodeChanged"></asp:AsyncPostBackTrigger>
                                     <asp:AsyncPostBackTrigger ControlID="TxtRequestTitle" EventName="TextChanged"></asp:AsyncPostBackTrigger>
                                     <asp:AsyncPostBackTrigger ControlID="F_ProductPlace" EventName="SelectedIndexChanged"></asp:AsyncPostBackTrigger>
                                    </Triggers>
                                </asp:UpdatePanel>
                                </div>                    
                            <div class="show_place">    
                                <asp:DropDownList ID="F_ProductPlace" runat="server" AppendDataBoundItems="True" AutoPostBack="true" DataSourceID="ObjectDataSource5" DataTextField="City" DataValueField="City" OnSelectedIndexChanged="F_ProductPlace_SelectedIndexChanged">
                                <asp:ListItem Text="所在地" Value="-1"></asp:ListItem>
                                </asp:DropDownList>
                            </div>
                         </div>
                         <div style="clear:both"></div>    
                         <asp:UpdatePanel id="UpdatePanel1" runat="server">
                         <contenttemplate>
                           
                         <div id="show_prieview" style="position:absolute;z-index:1; border:solid 1px black; padding:10px; background:white; display:none;" onmouseover="this.style.display=''" onmouseout="this.style.display='none'"></div>
                             <!--商品列表栏-->      
                             <div id="Porduct_List_Main">  
                                <asp:GridView CssClass="ProductList" AllowPaging="True" PageSize="20" EmptyDataText="对不起没有符合你查询条件的数据"  id="GridView1" runat="server" DataSourceID="ObjectDataSource1" AutoGenerateColumns="False" OnDataBound="GridView1_DataBound"  EnableViewState="false"  BorderWidth="0">
                                    <Columns>
                                        <asp:TemplateField> 
                                            <ItemTemplate> 
                                                <a href='<%#"request_item_detail.ASPX?RequestID="+Eval("RequestID") %>' Target="_blank" ><asp:Image runat="server" ID="RequestImg"  ImageUrl='<%#Eval("UploadImageUrl") %>' Height="80px" Width="120px" /></a>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="求购商品/求购者"> 
                                            <ItemTemplate> 
                                            求购商品：<asp:HyperLink ID="RequestTitle" runat="server" Text='<%#Eval("RequestTitle") %>'
                                             NavigateUrl='<%#"request_item_detail.ASPX?RequestID="+Eval("RequestID") %>' Target="_blank" />
                                             <br />
                                            求购者：<asp:HyperLink  runat="server" Text='<%#Eval("UserName") %>'
                                             NavigateUrl='<%#"Shop/"+Eval("RequesterID") %>' Target="_blank" ID="UserName" />
                                             <br />
                                             <asp:HyperLink ID="QQLink" runat="server" NavigateUrl='<%# "http://wpa.qq.com/msgrd?V=1&Uin="+Eval("OICQ")+"&amp;Site="+Eval("username")+"&amp;Menu=yes" %>' Target="_blank"> 
                                             <asp:Image ID="QQImage" runat="server" ImageUrl='<%# Eval("OICQ")%>' />
                                             </asp:HyperLink>
                                             <asp:HyperLink ID="TaobaoLink" runat="server" NavigateUrl='<%# Eval("Taobaowangwang") %>' Target="_blank">
                                             <asp:Image ID="TaobaoImage" runat="server" AlternateText="点击此可以直接和对方交流" ImageUrl='<%# Eval("Taobaowangwang") %>' />
                                             </asp:HyperLink>
                                            </ItemTemplate>
                                             <ItemStyle HorizontalAlign="Left" />
                                        </asp:TemplateField>
                                        <asp:BoundField DataField="Price" HeaderText="价格（元）"></asp:BoundField>
                                        <asp:BoundField DataField="RequestPlace" HeaderText="所在地"></asp:BoundField>
                                        <asp:TemplateField HeaderText="剩余时间"> 
                                            <ItemTemplate >
                                                   <asp:Literal ID="LeftTime" Text='<%#"<script>showlefttime("+ Eval("LeftTime")+")</script>" %>' runat="server" />
                                             </ItemTemplate> 
                                         </asp:TemplateField>
                                    </Columns>
                                    <AlternatingRowStyle CssClass="AltrowStyle" />
                                </asp:GridView>
                         </div>
                         <asp:ObjectDataSource id="ObjectDataSource1" runat="server"  SelectMethod="GetGetRequestListBySQL" TypeName="MallZ.Data.Shop_Request" OldValuesParameterFormatString="original_{0}">
                            <SelectParameters>
                                <asp:Parameter Type="String" DefaultValue="LeftTime" Name="OrderBy"/>
                                <asp:ControlParameter PropertyName="Text" Type="String" Name="ClassID" ControlID="TxtClassID" DefaultValue="-1"/>
                                <asp:ControlParameter PropertyName="SelectedValue" Type="String" Name="Place" ControlID="F_ProductPlace" DefaultValue=""/>
                                <asp:Parameter Type="String" DefaultValue="-1" Name="UserID"/>
                                <asp:Parameter Type="String" DefaultValue="0" Name="RequestType"/>
                                <asp:ControlParameter PropertyName="Text" Type="String" DefaultValue="" Name="ProductName" ControlID="TxtRequestTitle"/>
                            </SelectParameters>
                        </asp:ObjectDataSource>  
                        </contenttemplate>
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="TreeView1" EventName="SelectedNodeChanged"></asp:AsyncPostBackTrigger>
                            <asp:AsyncPostBackTrigger ControlID="TxtRequestTitle" EventName="TextChanged"></asp:AsyncPostBackTrigger>
                            <asp:AsyncPostBackTrigger ControlID="F_ProductPlace" EventName="SelectedIndexChanged"></asp:AsyncPostBackTrigger>
                        </Triggers> 
                    </asp:UpdatePanel>
             
                    <asp:ObjectDataSource ID="ObjectDataSource5" runat="server" SelectMethod="GetImportantCityByFlag"
                     TypeName="MallZ.Data.Shop_City"/>      
                    
                  </div>
             </div>
        </div>
        <!--左-->
        <div id="Side_Bar">
            <div class="SideBox">
            <div class="title"><b>看谁要求购我的商品</b></div>
            <div style="text-align:center; padding:5px;">
                <asp:TextBox ID="TxtRequestTitle" runat="server" AutoPostBack="True" OnTextChanged="TxtRequestTitle_TextChanged" />
            </div>
        </div>
        <div class="SideBox">
           <div class="title"><b>求购物品分类</b></div>
            <asp:TreeView id="TreeView1" runat="server" OnSelectedNodeChanged="TreeView1_SelectedNodeChanged"></asp:TreeView>
        </div>
        </div>
    </div>

</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="";
        ulObj.childNodes[_flag].className="active";  

    }
</script>
</form>


