<%@ Page language="c#" Codebehind="MemberCenter.aspx.cs" AutoEventWireup="true" Inherits="XpShop.WebUI.MemberCenter" %>
<%@ Register TagPrefix="uc1" TagName="MemberHelper" Src="Modules/MemberHelper.ascx" %>
<%@ Register TagPrefix="uc1" TagName="Header" Src="Modules/Header.ascx" %>
<%@ Register TagPrefix="uc1" TagName="memberfooter" Src="Modules/memberfooter.ascx" %>
<%@ Register TagPrefix="uc1" TagName="MemberMenu" Src="Modules/MemberMenu.ascx" %>
<%@ Register TagPrefix="uc1" TagName="MemberBulletin" Src="Modules/MemberBulletin.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><%=GetResourceString("MemberCenter")%>,<%=config.SiteTitle%></title>
		<!--#include file="../../inc/head.inc"-->
		<link href="<%=webSite %>Template/<%=config.TemplateFolder%>/style/member.css" type="text/css" rel="stylesheet" />
		<script type="text/javascript">
            function printOrder(oid)
            {
                temp=window.open('<%=webSite %>OrderPrint.aspx?OrderID='+oid,'shopcat','width=700,height=850,scrollbars=yes,resizable=yes');
                temp.focus();
            }
		</script>
	</HEAD>
	<body>
		<uc1:Header id="Header1" runat="server"></uc1:Header>
		<div class="xp-qgw clear">
		    <!--位置导航开始-->
	        <div class="path"><a href="<%=webSite %><%if(config.html==""){%>default.aspx<%}else{%>Index.<%=config.html%><%}%>"><%=GetResourceString("Home")%></a>&nbsp;&gt;&nbsp;<%=GetResourceString("MemberCenter")%></div>
	        <!--位置导航结束-->
			<div class="member_left">
			    <!--会员中心导航开始-->
				<uc1:MemberMenu id="MemberMenu1" runat="server"></uc1:MemberMenu>
				<!--会员中心导航结束-->
			</div>
			<div class="member_middle">
				<h3>欢迎您,<%=user.Name%> <a href='<%=webSite %>Logout.<%=config.html%>'><span style="margin-left:20px; font-size:12px; font-weight:normal;">退出</span></a></h3>
				<hr class="itemhr" />
				<div class="memberinfo">
				    <table>
				        <tr>
				            <td colspan="2"><%=GetResourceString("MemberLevel")%>：<%=GetLevel(user.GroupId)%></td>
				            <td><a href='<%=webSite %>Score.aspx'><font color="red">积分充值>>></font></a></td>
				        </tr>
				        <tr>
				            <td><%=GetResourceString("Credit")%>：<%=user.Score%></td>
				            <td>已完成的订单：<%=GetFinishedOrderCount()%></td>
				            <td><%=user.CardNo != "" ? "会员卡卡号：" + user.CardNo : "<a href='/" + ShopFolder + "CardReg.aspx'>激活会员卡</a>" %></td>
				        </tr>
				        <tr>
				            <td><%=GetResourceString("AdvancePayment")%>：<%=string.Format("{0:f}",user.AdvancePayment)%></td>
				            <td>一年内消费额：<%=string.Format("{0:f2}",GetYearBuyTotal(1)) %></td>
				            <td>总消费额：<%=string.Format("{0:f2}",user.Expenditure) %></td>
				        </tr>
				    </table>
				</div>
				<div class="msg">
				    <span>消息提示：</span>
				    <a href="<%=webSite %>MyMessage.aspx?SearchType=1&Status=3">
				        <span class="num"><%=GetNewMessageCount()%></span><span class="msglink">条未读短消息</span>
				    </a>
				    <a href="<%=webSite %>MyComplaint.aspx?Status=0">
				        <span class="num"><%=GetComplaintReplyCount()%></span><span class="msglink">条投诉回复</span>
				    </a>
				    <a href="<%=webSite %>MyOrders.aspx">
				        <span class="num"><%=GetNotFinishedOrderCount()%></span><span class="msglink">个待处理订单</span>
				    </a>
				</div>
				
				<h3>最近订单列表</h3>
				<%BindOrders(5); %>
				<asp:datagrid id="dgOrderList" CssClass="dgborder" runat="server"
			        AutoGenerateColumns="False" DataKeyField="OrderID" Width="100%" HorizontalAlign="Center" BorderWidth="1"
			        BorderColor="#d6d6d6">
			        <ItemStyle BackColor="White"></ItemStyle>
			        <HeaderStyle BackColor="#fff7d3" Height="20px"></HeaderStyle>
			        <Columns>
				        <asp:TemplateColumn HeaderText="订单编号">
					        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
					        <ItemStyle HorizontalAlign="Center" Height="20px"></ItemStyle>
					        <ItemTemplate>
						        <a href="<%=webSite %>OrderDetail-<%# DataBinder.Eval(Container.DataItem, "OrderID") %>.<%=config.html%>">
							        <%# DataBinder.Eval(Container.DataItem, "OrderNo") %>
						        </a>
					        </ItemTemplate>
				        </asp:TemplateColumn>
				        <asp:BoundColumn DataField="OrderTime" HeaderText="下订时间" DataFormatString="{0:yyyy-MM-dd}">
					        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
					        <ItemStyle HorizontalAlign="Center"></ItemStyle>
				        </asp:BoundColumn>
				        <asp:TemplateColumn HeaderText="总金额">
					        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
					        <ItemStyle HorizontalAlign="Center"></ItemStyle>
					        <ItemTemplate>
						        ￥<%# DataBinder.Eval(Container.DataItem, "TotalPrice","{0:f}") %>
					        </ItemTemplate>
				        </asp:TemplateColumn>
				        <asp:TemplateColumn HeaderText="还需付款金额">
					        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
					        <ItemStyle HorizontalAlign="Center"></ItemStyle>
					        <ItemTemplate>
						        <font color="Tomato">
							        ￥<%# DataBinder.Eval(Container.DataItem, "NeedPayMoney", "{0:f}")%>
						        </font>
					        </ItemTemplate>
				        </asp:TemplateColumn>
				        <asp:TemplateColumn HeaderText="订单状态">
					        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
					        <ItemStyle HorizontalAlign="Center"></ItemStyle>
					        <ItemTemplate>
						        <%# GetStatus(DataBinder.Eval(Container.DataItem, "OrderID").ToString())%>
					        </ItemTemplate>
				        </asp:TemplateColumn>
				        <asp:TemplateColumn HeaderText="操作">
					        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
					        <ItemStyle HorizontalAlign="Center"></ItemStyle>
					        <ItemTemplate>
						        <a href="<%=webSite %>OrderDetail-<%# DataBinder.Eval(Container.DataItem, "OrderID") %>.<%=config.html%>"><%=GetResourceString("ViewOrder")%></a>
					        </ItemTemplate>
				        </asp:TemplateColumn>
			        </Columns>
		        </asp:datagrid>
				<div class="moreorder"><a href="MyOrders.<%=config.html %>">更多>></a></div>
				<div style="clear:both;"></div>
				
				<h3>待评价商品</h3>
				<%BindNoReviewPdts(); %>
				<asp:datagrid id="dgPdtNotReview" CssClass="dgborder" runat="server"
			        AutoGenerateColumns="False" Width="100%" HorizontalAlign="Center" BorderWidth="1"
			        BorderColor="#d6d6d6">
			        <ItemStyle BackColor="White"></ItemStyle>
			        <HeaderStyle BackColor="#fff7d3" Height="20px"></HeaderStyle>
			        <Columns>
			            <asp:TemplateColumn HeaderText="订单编号">
					        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
					        <ItemStyle HorizontalAlign="Center" Height="20px"></ItemStyle>
					        <ItemTemplate>
						        <%# DataBinder.Eval(Container.DataItem, "OrderNo") %>
					        </ItemTemplate>
				        </asp:TemplateColumn>
				        <asp:TemplateColumn HeaderText="商品编号">
					        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
					        <ItemStyle HorizontalAlign="Center" Height="20px"></ItemStyle>
					        <ItemTemplate>
						        <%# DataBinder.Eval(Container.DataItem, "ProductNo") %>
					        </ItemTemplate>
				        </asp:TemplateColumn>
				        <asp:TemplateColumn HeaderText="商品名称">
					        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
					        <ItemStyle HorizontalAlign="Left" Width="220" Height="20px"></ItemStyle>
					        <ItemTemplate>
						        <a href='<%=webSite %>products/product-<%# DataBinder.Eval(Container.DataItem, "ProductID") %>.<%=config.html %>' target="_blank" style="color:#3665cd;"><%# DataBinder.Eval(Container.DataItem, "ProductName") %></a>
					        </ItemTemplate>
				        </asp:TemplateColumn>
				        <asp:BoundColumn DataField="OrderTime" HeaderText="下订时间" DataFormatString="{0:yyyy-MM-dd}">
					        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
					        <ItemStyle HorizontalAlign="Center" Width="100"></ItemStyle>
				        </asp:BoundColumn>
				        <asp:TemplateColumn HeaderText="是否评价">
					        <HeaderStyle HorizontalAlign="Center" Width="100px"></HeaderStyle>
					        <ItemStyle HorizontalAlign="Center" Height="20px"></ItemStyle>
					        <ItemTemplate>
						        <a href='<%=webSite %>ProductReview-<%# DataBinder.Eval(Container.DataItem, "ProductID") %>-Add-1-<%# DataBinder.Eval(Container.DataItem, "OrderID") %>.<%=config.html%>' target="_blank" style="color:#02b502;">立即评价</a>
					        </ItemTemplate>
				        </asp:TemplateColumn>
			        </Columns>
		        </asp:datagrid>
			</div>
			<div class="member_right">
			    <!--公告开始-->
				<uc1:MemberBulletin id="MemberBulletin1" runat="server"></uc1:MemberBulletin>
			    <!--公告结束-->
			    <div style="width:200px; overflow:hidden; margin-top:10px;">
			        <%=GetAD(97)%>
			    </div>
			    
			</div>
			<div class="clear"></div>
		</div>
		<uc1:MemberHelper id="Helper1" runat="server"></uc1:MemberHelper>
		<uc1:memberfooter id="Footer1" runat="server"></uc1:memberfooter>
	</body>
</HTML>
