<%@ Page language="c#" Codebehind="BuyRecord.aspx.cs" AutoEventWireup="true" Inherits="XpShop.WebUI.BuyRecord" %>
<%@ Register TagPrefix="uc1" TagName="Header" Src="Modules/Header.ascx" %>
<%@ Register TagPrefix="uc1" TagName="Helper" Src="Modules/Helper.ascx" %>
<%@ Register TagPrefix="uc1" TagName="Footer" Src="Modules/Footer.ascx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
	<head>
		<!--#include file="../../inc/encoding.inc"-->	
		<title>购买记录--<%=product.ProductName %></title>	
		<!--#include file="../../inc/head.inc"-->
	</head>
	<body>
		<uc1:Header id="Header1" runat="server"></uc1:Header>
		<div class="xp-w clear">
		    <!--位置导航开始-->
		    <div class="path"><%=GetCurrentPosition()%></div>
		    <!--位置导航结束-->
		    <div id="content_left">
                <div class="lframe">
                    <div class="tl"></div>
                    <div class="tr"></div>
                    <div class="tm">商品信息</div>
                    <div class="ml"></div>
                    <div class="mr"></div>
                    <div class="mm" style="text-align:center; border-top:1px solid #fff; padding:5px;">
                        <div style="text-align:center;">
                            <a href="<%=webSite %>products/product-<%=Request.QueryString["PID"] %>.<%=config.html %>">
                                <img src="<%=webSite %><%=config.Path%>upload/ProductImg/<%=PPFolder(GetCategoryNo()) %>/<%=product.ThumbnailImg%>" alt="<%=product.ProductName %>" width="160" height="160" />
                            </a>
                        </div>
                        <div>
                            商品名称：<a href="<%=webSite %>products/product-<%=Request.QueryString["PID"] %>.<%=config.html %>"><%=product.ProductName %></a>
                        </div>
                        <% if(MemberShowPrice()) {%>
						<div>    
						    现&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;价：
						    <span class="RedWeight" style=" font-size:16px;"><%=string.Format("{0:f}",product.MemberPrice)%></span>
						</div>    
					    <% }%>
                    </div>
                    <div class="bl"></div>
                    <div class="br"></div>
                    <div class="bm"></div>
                </div>
		    </div>
		    <div id="content_right">
		        <form id="Form1" runat="server">
		        <!--列表开始-->
		        <%BindList(20); %>
		        <asp:datagrid id="dgList" runat="server"
                    AutoGenerateColumns="False" Width="100%" HorizontalAlign="Center" BorderWidth="1"
                    BorderColor="#cccccc">
                    <ItemStyle BackColor="White"></ItemStyle>
                    <HeaderStyle BackColor="#f5f5f5" Height="20px"></HeaderStyle>
                    <Columns>
                        <asp:TemplateColumn HeaderText="买家">
                            <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                            <ItemStyle HorizontalAlign="Center" Height="20px"></ItemStyle>
                            <ItemTemplate>
                                <%# DataBinder.Eval(Container.DataItem, "BuyerName") %>
                            </ItemTemplate>
                        </asp:TemplateColumn>
                        <asp:TemplateColumn HeaderText="买家地区">
                            <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                            <ItemStyle HorizontalAlign="Left" Height="20px"></ItemStyle>
                            <ItemTemplate>
                                <%# DataBinder.Eval(Container.DataItem, "Address") %>
                            </ItemTemplate>
                        </asp:TemplateColumn>
                        <asp:TemplateColumn HeaderText="买家电话">
                            <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                            <ItemStyle HorizontalAlign="Center" Height="20px"></ItemStyle>
                            <ItemTemplate>
                                <%# CutPhone(DataBinder.Eval(Container.DataItem, "Phone").ToString(),4)%>
                            </ItemTemplate>
                        </asp:TemplateColumn>
                        <asp:TemplateColumn HeaderText="购买数量">
                            <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                            <ItemStyle HorizontalAlign="Center" Height="20px"></ItemStyle>
                            <ItemTemplate>
                                <%# DataBinder.Eval(Container.DataItem, "Quantity") %>
                            </ItemTemplate>
                        </asp:TemplateColumn>
                        <asp:BoundColumn DataField="BuyTime" HeaderText="购买时间" DataFormatString="{0:yyyy-MM-dd hh:mm}">
                            <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                            <ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:BoundColumn>
                    </Columns>
                </asp:datagrid>
				<!--列表结束-->
				
				<asp:panel id="plPage" visible="true" runat="server">
				<!-- 翻页开始-->
				<div class="page clear">
					<div class="fpage1">
                        <asp:Label ID="lblPagerInfo" runat="server"></asp:Label>
                        <input id="gopage" type="text" class="gopage" size="1" />
                        <input id="go" type="button" value="Go" class="go" />
                    </div>
                    <div class="fpage2">
                        <span class="prepage"></span>
                        <asp:Label ID="lbPage" runat="server"></asp:Label>
                        <span class="nextpage"></span>
                    </div>                                
				</div>
				<script type="text/javascript">
				    $(document).ready(function(){
				        $('#go').click(function(){
				            var page = $.trim($('#gopage').val());
				            if(page == ''){
				                alert('请输入页码');
				            }else if(isNaN(page)){
				                alert('请输入数字！');
				                return false;
				            }else if(Number(page) > totalPage || Number(page) < 0){
				                alert('输入的数字不在页码范围内！');
				            }else{
				                window.location.href = '<%=webSite %>buyrecord-<%=Request.QueryString["PID"] %>-' + page + '.<%=config.html %>'
				            };
				        });
				    });
				</script>
				<!-- 翻页结束-->
				</asp:panel>
				
				<asp:panel id="plNoProduct" visible="false" runat="server">
					<div style="margin:20px;">
						<h3>此商品没有购买记录！</h3>
					</div>
				</asp:panel>
				</form>
		    </div>
		</div>
	    <uc1:Helper id="Helper1" runat="server"></uc1:Helper>
	    <uc1:Footer id="Footer1" runat="server"></uc1:Footer>			
	</body>
</html>   
