<%@ Page language="c#" Codebehind="MyCouponsFavourites.aspx.cs" AutoEventWireup="true" Inherits="XpShop.WebUI.MyCouponsFavourites" %>
<%@ Register TagPrefix="uc1" TagName="MemberMenu" Src="Modules/MemberMenu.ascx" %>
<%@ Register TagPrefix="uc1" TagName="Header" Src="Modules/Header.ascx" %>
<%@ Register TagPrefix="uc1" TagName="MemberHelper" Src="Modules/MemberHelper.ascx" %>
<%@ Register TagPrefix="uc1" TagName="memberfooter" Src="Modules/memberfooter.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>我的优惠券,<%=config.SiteTitle%></title>
		<!--#include file="../../inc/head.inc"-->
		<link href="<%=webSite %>Template/<%=config.TemplateFolder%>/style/member.css" type="text/css" rel="stylesheet" />
	</HEAD>
	<body>
	<% if (HaveCoupon(Request.Url.ToString())){%>
		<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;<a href="<%=webSite %>Center.<%=config.html %>"><%=GetResourceString("MemberCenter")%></a>&nbsp;&gt;&nbsp;<%=GetResourceString("CouponFavourites")%></div>
		    <!--位置导航结束-->
			<div class="member_left">
				<!--会员中心导航开始-->
				<uc1:MemberMenu id="MemberMenu1" runat="server"></uc1:MemberMenu>
				<!--会员中心导航结束-->
			</div>
			<div class="member_middle_right">
			    <!--内容开始-->
				<div class="mframe">
		            <div class="tl"></div>
		            <div class="tr"></div>
		            <div class="tm">我的优惠券</div>
		            <div class="ml"></div>
		            <div class="mr"></div>
		            <div class="mm">
                        <form id="Form1" method="post" runat="server">
					    <div class="mctab clear">
                            <ul>
                                <li class="<%=XpShop.Common.Utils.ReqStrParams("flag","active")=="active" ? "curr" : "out"%>">
                                    <s></s>
                                    <b></b>
                                    <a href="MyCouponsFavourites-active.<%=config.html%>">未使用优惠券</a>
                                </li>
                                <li class="<%=XpShop.Common.Utils.ReqStrParams("flag","active")=="used" ? "curr" : "out"%>">
                                    <s></s>
                                    <b></b>
                                    <a href="MyCouponsFavourites-used.<%=config.html%>">已使用优惠券</a>
                                </li>
                                <li class="<%=XpShop.Common.Utils.ReqStrParams("flag","active")=="out" ? "curr" : "out"%>">
                                    <s></s>
                                    <b></b>
                                    <a href="MyCouponsFavourites-out.<%=config.html%>">已过期优惠券</a>
                                </li>
                            </ul>
                            <div class="extra hide">
                                <a class="btn btn-12" href="#"><s></s>激活实体券</a>
                                <a class="btn btn-12" href="#"><s></s>实体券有效期查询</a>
                            </div>
                        </div>
					    <table width="100%" cellspacing="0" cellpadding="0">
						    <tr>
							    <td align="center">
							    <%if (XpShop.Common.Utils.ReqStrParams("flag", "active") == "used"){%>
							        <%BindCoupons("dgList1", 50);%>
							        <asp:datagrid id="dgList1" CssClass="dgborder" runat="server" AutoGenerateColumns="False" DataKeyField="UID" 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" Height="20px"></HeaderStyle>
											    <ItemStyle HorizontalAlign="Center" Width="20%"></ItemStyle>
											    <ItemTemplate>
													<%# DataBinder.Eval(Container.DataItem, "CouponCode")%>
											    </ItemTemplate>
										    </asp:TemplateColumn>											    
										    <asp:TemplateColumn HeaderText="名称">
											    <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
											    <ItemStyle HorizontalAlign="Center" Width="30%"></ItemStyle>
											    <ItemTemplate>
													<%# DataBinder.Eval(Container.DataItem, "CouponName") %>
                                                    <div style="text-align:center;">(<%# DataBinder.Eval(Container.DataItem, "SendReason") %>)</div>
											    </ItemTemplate>
										    </asp:TemplateColumn>
										    <asp:TemplateColumn HeaderText="面值">
											    <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
											    <ItemStyle HorizontalAlign="Center" Width="10%"></ItemStyle>
											    <ItemTemplate>
												    <%# DataBinder.Eval(Container.DataItem, "CouponValue")%>
											    </ItemTemplate>
										    </asp:TemplateColumn>
										    <asp:TemplateColumn HeaderText="所需消费金额">
											    <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
											    <ItemStyle HorizontalAlign="Center" Width="10%"></ItemStyle>
											    <ItemTemplate>
												    <%# DataBinder.Eval(Container.DataItem, "MinMoney")%>
											    </ItemTemplate>
										    </asp:TemplateColumn>
										    <asp:TemplateColumn HeaderText="订单号">
											    <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
											    <ItemStyle HorizontalAlign="Center" Width="15%"></ItemStyle>
											    <ItemTemplate>
												    <%# DataBinder.Eval(Container.DataItem, "OrderNo")%>
											    </ItemTemplate>
										    </asp:TemplateColumn>
										    <asp:TemplateColumn HeaderText="使用时间">
											    <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
											    <ItemStyle HorizontalAlign="Center" Width="15%"></ItemStyle>
											    <ItemTemplate>
												    <%# DataBinder.Eval(Container.DataItem, "UsedTime", "{0:yyyy-MM-dd}")%>
											    </ItemTemplate>
										    </asp:TemplateColumn>
									    </Columns>
								    </asp:datagrid>
							    <%}else{ %>
							        <%BindCoupons("dgList2", 50);%>
								    <asp:datagrid id="dgList2" CssClass="dgborder" runat="server" AutoGenerateColumns="False" DataKeyField="UID" 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" Height="20px"></HeaderStyle>
											    <ItemStyle HorizontalAlign="Center" Width="17%"></ItemStyle>
											    <ItemTemplate>
													<%# DataBinder.Eval(Container.DataItem, "CouponCode")%>
											    </ItemTemplate>
										    </asp:TemplateColumn>											    
										    <asp:TemplateColumn HeaderText="名称">
											    <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
											    <ItemStyle HorizontalAlign="Center" Width="30%"></ItemStyle>
											    <ItemTemplate>
													<%# DataBinder.Eval(Container.DataItem, "CouponName") %>
                                                    <div style="text-align:center;">(<%# DataBinder.Eval(Container.DataItem, "SendReason") %>)</div>
											    </ItemTemplate>
										    </asp:TemplateColumn>
										    <asp:TemplateColumn HeaderText="面值">
											    <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
											    <ItemStyle HorizontalAlign="Center" Width="5%"></ItemStyle>
											    <ItemTemplate>
												    <%# DataBinder.Eval(Container.DataItem, "CouponValue")%>
											    </ItemTemplate>
										    </asp:TemplateColumn>
										    <asp:TemplateColumn HeaderText="所需消费金额">
											    <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
											    <ItemStyle HorizontalAlign="Center" Width="10%"></ItemStyle>
											    <ItemTemplate>
												    <%# DataBinder.Eval(Container.DataItem, "MinMoney")%>
											    </ItemTemplate>
										    </asp:TemplateColumn>
										    <asp:TemplateColumn HeaderText="有效期">
											    <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
											    <ItemStyle HorizontalAlign="Center" Width="20%"></ItemStyle>
											    <ItemTemplate>
												    <%# DataBinder.Eval(Container.DataItem, "BeginTime", "{0:yyyy-MM-dd}")%>至<%# DataBinder.Eval(Container.DataItem, "EndTime", "{0:yyyy-MM-dd}")%>
											    </ItemTemplate>
										    </asp:TemplateColumn>
										    <asp:TemplateColumn HeaderText="使用说明">
											    <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
											    <ItemStyle HorizontalAlign="Center" Width="10%"></ItemStyle>
											    <ItemTemplate>
												    <%# DataBinder.Eval(Container.DataItem, "Remark")%>
											    </ItemTemplate>
										    </asp:TemplateColumn>
									    </Columns>
								    </asp:datagrid>
								<%} %>
							    </td>
						    </tr>
						    <tr>
							    <td colspan="3" height="20"></td>
						    </tr>
					    </table>
	                    </form>
	                </div>
			        <div class="bl"></div>
			        <div class="br"></div>
			        <div class="bm"></div>
			    </div>
				<!--内容结束-->
			</div>
		</div>
		<uc1:MemberHelper id="Helper1" runat="server"></uc1:MemberHelper>
		<uc1:memberfooter id="Footer1" runat="server"></uc1:memberfooter>
		<%} %>
	</body>
</HTML>
