<%@ page language="C#" masterpagefile="~/Member/MyShopMasterPage.master" autoeventwireup="true" inherits="Member_MyCoupon, WebApp_deploy" title="我的优惠券" %>

<asp:Content ID="content" runat="server" ContentPlaceHolderID="ContentPlaceHolder1">
    <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 = "";
            }
            if (ulObj.childNodes.length > 5)
            { _flag = _flag * 2 + 1; }
            ulObj.childNodes[_flag].className = "active";
        }   
    </script>
    <div class="pageTitle" style="line-height: 30px; vertical-align: middle;">
        &nbsp;&nbsp;&nbsp;&nbsp;<asp:Literal ID="ltrTitle" runat="server">优惠券记录信息</asp:Literal>
    </div>
    <div id="MainMenu">
        <div class="TabMenu">
            <!--一级导航-->
            <ul id="M1">
                <li class="active"><a href="MyCoupon.aspx?TabMenu=tabAll">全 部</a></li>
                <li><a href="MyCoupon.aspx?TabMenu=tabNoUse">未使用 </a></li>
                <li><a href="MyCoupon.aspx?TabMenu=tabUse">已使用</a></li>
                <li><a href="MyCoupon.aspx?TabMenu=tabNoOverdue">未过期 </a></li>
                <li><a href="MyCoupon.aspx?TabMenu=tabOverdue">已过期 </a></li>
            </ul>
        </div>
        <div class="TabText">
            <asp:GridView ID="gvList" runat="server" CssClass="tableHead" AllowPaging="True"
                AutoGenerateColumns="False" PageSize="10" OnRowDataBound="gvList_RowDataBound">
                <Columns>
                    <asp:BoundField DataField="CouponName" SortExpression="CouponName" HeaderText="名称" />
                    <asp:BoundField DataField="CouponNum" SortExpression="CouponNum" HeaderText="编号 " />
                    <asp:BoundField DataFormatString="{0:0.00}" DataField="CouponParvalue" SortExpression="CouponParvalue"
                        HeaderText="面值" />
                    <asp:BoundField DataFormatString="{0:0.00}" DataField="NeedsMoney" SortExpression="NeedsMoney"
                        HeaderText="所需金额" />
                    <asp:TemplateField HeaderText="有效期">
                        <ItemTemplate>
                            <%# Convert.ToDateTime(Eval("BeginDate")).ToShortDateString() %>&nbsp;&nbsp;至&nbsp;&nbsp;<%# Convert.ToDateTime(Eval("EndDate")).ToShortDateString() %>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="用户名">
                        <ItemTemplate>
                            <asp:Literal ID="ltrUserName" runat="server" Text='<%# Eval("UserName") %>'></asp:Literal>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="使用订单">
                        <ItemTemplate>
                            <asp:Literal ID="ltrUserOrder" runat="server" Text='<%# Eval("UseOrderID") %>'></asp:Literal>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="是否使用">
                        <ItemTemplate>
                            <%# getUseStatus(Eval("UseStatus"))%>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <EmptyDataTemplate>
                    <table class="tableHead">
                        <tr>
                            <th>
                                名称
                            </th>
                            <th>
                                编号
                            </th>
                            <th>
                                面值
                            </th>
                            <th>
                                所需金额
                            </th>
                            <th>
                                有效期
                            </th>
                            <th>
                                使用订单
                            </th>
                            <th>
                                是否使用
                            </th>
                        </tr>
                        <tr>
                            <td colspan="7">
                                优惠券无数据!
                            </td>
                        </tr>
                    </table>
                </EmptyDataTemplate>
            </asp:GridView>
            <div class="page" style="text-align: center; margin-right: 20px;">
                &nbsp;<asp:Label ID="PagePanel" runat="server" />&nbsp;
            </div>
                <br /><br />
        </div>
    </div>
    <script type="text/javascript">        setButtonActive("<%=m_flag %>");</script>
</asp:Content>
