<%@ page language="C#" masterpagefile="MyShopMasterPage.master" autoeventwireup="true" inherits="Member_ShopProductSold, WebApp_deploy" title="已出售商品" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div class="pageTitle">
        已卖出的商品</div>
    <br />
    <table id="tb1" class="SearchTableStyle" runat="server">
        <tr class="tdbg">
            <td class="tdbg5" align="right">
                下单起始日期：
            </td>
            <td class="tdbg5">
                <asp:TextBox ID="TxtBeginDate" Width="170px" runat="server" Height="16px" />
            </td>
            <td class="tdbg5" align="right">
                至：
            </td>
            <td class="tdbg5">
                <asp:TextBox ID="TxtEndDate" Width="170px" runat="server" Height="16px" />
            </td>
        </tr>
        <tr class="tdbg">
            <td class="tdbg5" align="right">
                商品名称：
            </td>
            <td class="tdbg5">
                <asp:TextBox ID="TxtOrderName" Width="170px" runat="server" Height="16px" />&nbsp;&nbsp;
            </td>
            <td class="tdbg5" align="right">
                交易类型：
            </td>
            <td class="tdbg5">
                <asp:DropDownList ID="RadProductType" Width="175px" runat="server" RepeatDirection="Horizontal"
                    AutoPostBack="true" OnSelectedIndexChanged="Search_OnClick">
                    <asp:ListItem Text="所有" Value="0" Selected="True" />
                    <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:DropDownList>
            </td>
        </tr>
        <tr class="tdbg">
            <td class="tdbg5" align="center" colspan="4">
                <asp:Button ID="search_btn" runat="server" Text=" 查 询 " OnClick="Search_OnClick" />
            </td>
        </tr>
    </table>
    <div style="clear: both">
    </div>
    <div id="product_history" runat="server">
        <asp:GridView ID="GridView1" runat="server" CssClass="tableHead" Width="98%" AutoGenerateColumns="False"
            AllowPaging="True" OnDataBound="GridView1_DataBound">
            <Columns>
                <asp:TemplateField HeaderText="商品名称">
                    <ItemTemplate>
                        <asp:HiddenField ID="HiddenProID" runat="server" Value='<%#Eval("ProductID") %>' />
                        <asp:HyperLink ID="ProductNameUrl" runat="server" Text='<%# Bind("ProductName") %>'
                            NavigateUrl='<%#"../ShowProduct.aspx?ProductID="+Eval("ProductID") %>' Target="_blank" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="商品类型">
                    <ItemTemplate>
                        <asp:HyperLink ID="LabStatus" runat="server" Text='<%# HoWave.Web.Shop.TextFormat.GetProductType(Eval("ProductType").ToString()) %>' />
                    </ItemTemplate>
                    <ItemStyle Width="15%" />
                </asp:TemplateField>
                <asp:BoundField DataField="EndDate" HeaderText="结束时间" ItemStyle-Width="15%" />
                <asp:TemplateField HeaderText="操作">
                    <ItemTemplate>
                        <asp:HiddenField ID="hfProductType" runat="server" Value='<%# Eval("ProductType") %>' />
                        <asp:HiddenField ID="hfProductName" runat="server" Value='<%# Eval("ProductName") %>' />
                        <%#CountNum(Eval("ProductID").ToString(),Eval("ProductID"))%>
                        <%--<asp:LinkButton ID="ViewComment" runat="server" CommandName="ButView">查看评价</asp:LinkButton>--%>
                        <%--<a href="Shop_ProductSold.aspx?ProductID='<%#Eval("ProductID") %>'&tag=Views">查看评价(<span
                            style="color: Red; font-weight: bold">
                            <%#CountNum(Eval("ProductID").ToString())%></span>)</a>--%>&nbsp;&nbsp;&nbsp;
                        <asp:HyperLink ID="view" runat="server" Text="查看订单" NavigateUrl='<%# "Shop_ManageOrder.aspx?all=all&productname="+HttpContext.Current.Server.UrlEncode(Eval("ProductName").ToString())+"&showProType="+Eval("ProductType") %>' />
                    </ItemTemplate>
                    <ItemStyle Width="25%" />
                </asp:TemplateField>
            </Columns>
            <EmptyDataTemplate>
                <table style="width: 98%">
                    <tr>
                        <th>
                            商品名称
                        </th>
                        <th>
                            商品类型
                        </th>
                        <th>
                            结束时间
                        </th>
                        <th>
                            操作
                        </th>
                    </tr>
                    <tr>
                        <td colspan="4">
                            暂无任何商品
                        </td>
                    </tr>
                </table>
            </EmptyDataTemplate>
        </asp:GridView>
    </div>
    <asp:Panel ID="Panel1" runat="server" Visible="false">
        <span style="left: 50%; position: relative; color: Black; font-size: 16px; font-weight: bold;
            text-align: center; width: 100%">查看评价信息</span>
        <asp:GridView ID="GridView2" CssClass="tableHead" Width="98%" AutoGenerateColumns="false"
            runat="server" OnRowCommand="GridView2_RowCommand">
            <Columns>
                <asp:BoundField DataField="CreditID" HeaderText="编号" />
                <asp:TemplateField HeaderText="评价人">
                    <ItemTemplate>
                        <%#Eval("ValuerName") == DBNull.Value ? "" :  Eval("ValuerName")%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="内容">
                    <ItemTemplate>
                        <asp:LinkButton ID="linkContent" CommandName="LBut" runat="server" Text='<%#Eval("Comment") %>'></asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="评论等级">
                    <ItemTemplate>
                        <%# Levelrate(Eval("CreditScore"))%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="CreateTime" HeaderText="评论时间" />
            </Columns>
        </asp:GridView>
        <div id="divCommnet" runat="server" visible="false">
            <table width="100%">
                <tr>
                    <td style="text-align: center">
                        评价内容
                    </td>
                </tr>
                <tr>
                    <td style="text-align: center">
                        <asp:TextBox ID="ComentBox" runat="server" ReadOnly="true" Width="400px" Height="200px"></asp:TextBox>
                    </td>
                </tr>
            </table>
        </div>
        <div style="text-align: center">
            <asp:Button ID="ReturnBut" runat="server" Text="返回" OnClick="ReturnBut_Click" /></div>
    </asp:Panel>
</asp:Content>
