<%@ page title="" language="C#" masterpagefile="~/Member/MyShopMasterPage.master" autoeventwireup="true" inherits="Member_MBF_BuyVipCards, WebApp_deploy" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <style type="text/css">
        .cursorpoint{cursor:pointer;}
    </style>
    <script type="text/javascript">
        ////////----------------    begin 页面中所有的js非空认证的代码请写在这里，方便以后的维护  --------------//////
        //判断充值卡和充值卡密码是否为空
        function CheckCarNumAndPwd() {

            return true;
        }
        function CheckMoney() {

            return false;
        }
        //判断输入的兑换总额是否为空
        function CheckEpCount() {

            return true;
        }
        ////////----------------    end 页面中所有的js非空认证（请写在这里，方便以后的维护） --------------//////
    </script>
    <div class="pageTitle">
        <font color="red">我的VIP卡管理</font></div>
    <br />
    <table class="SearchTableStyle">
        <tr>
            <td colspan="4">
                <b>1、购买VIP卡</b>
            </td>
        </tr>
        <tr>
            <td colspan="4" style="background-color: #fff">
                <asp:Repeater ID="Repeater_Store" runat="server" 
                    onitemcommand="Repeater_Store_ItemCommand">
                    <ItemTemplate>
                        <div style="width: 40%; height: 340px; position: relative;margin-top:8px; float: left; display: inline table;border-bottom:1px solid white">
                            <div style="width: 280px; text-align: center; border: 1px solid Red; padding: 2px 0px 2px 0px;">
                                <img src='../UpLoadFile/VIPCardPic/<%#Eval("Pictrue") %>' alt='' style="width: 280px;
                                    height: 190px" /></div>
                            
                            <div style="width: 280px; text-align: center;display:inline table; border: 1px solid Red; padding: 2px 0px 2px 0px;margin-top:4px;">
                                <%#GetCategoryName(Eval("CardCategory"))%>/面值：<font color="#EF831D">￥<asp:Literal ID="ltr_FaceValue" runat="server" Text='<%#Eval("FaceValue")%>'></asp:Literal></font><br />数量：<asp:DropDownList ID="ddl_count" runat="server">
                                    <asp:ListItem Value="1" Text="1"></asp:ListItem>
                                    <asp:ListItem Value="2" Text="2"></asp:ListItem>
                                    <asp:ListItem Value="3" Text="3"></asp:ListItem>
                                    <asp:ListItem Value="4" Text="4"></asp:ListItem>
                                    <asp:ListItem Value="5" Text="5"></asp:ListItem>
                                    <asp:ListItem Value="6" Text="6"></asp:ListItem>
                                    <asp:ListItem Value="7" Text="7"></asp:ListItem>
                                    <asp:ListItem Value="8" Text="8"></asp:ListItem>
                                    <asp:ListItem Value="9" Text="9"></asp:ListItem>
                                    <asp:ListItem Value="10" Text="10"></asp:ListItem>
                                </asp:DropDownList>
                                &nbsp;&nbsp;&nbsp;&nbsp;<asp:Button ID="btnBuy" CommandArgument='<%#Eval("id") %>' CommandName="buycard" runat="server" Text="购买" CssClass="cursorpoint" />
                            </div>
                            
                            <div style="width: 280px; text-align: center; border: 1px solid Red; padding: 2px 0px 2px 0px;display:inline table;margin-top:4px;">
                            <div style="width: 95%;margin:0 auto;">
                            <%#GetIntro(Eval("FaceValue"),Eval("DiscountRate"),Eval("CardCategory"))%>
                            </div>
                                
                            </div>
                           
                        </div>
                    </ItemTemplate>
                    <SeparatorTemplate>
                        
                    </SeparatorTemplate>
                </asp:Repeater>
                <%--<div style="clear: both; width: 100%; position: relative; float: left;">
                    <br />
                    <hr style="border: 1px solid Gray; width: 80%;" />
                    <br />
                </div>--%>
            </td>
        </tr>
        <tr>
            <td colspan="4">
                <b></b>
            </td>
        </tr>
        <tr>
            <th>
            </th>
            <td>
                <b></b>
            </td>
            <th>
            </th>
            <td>
            </td>
        </tr>
    </table>
    <br />
    <table class="SearchTableStyle">
    <tr>
            <td colspan="4">
                <b>2、查询我的VIP卡</b>
            </td>
        </tr>
        <tr>
            <td style="width: 200px; padding-left: 20px;">
                VIP卡类别：<asp:DropDownList ID="DropType" OnSelectedIndexChanged="Search_OnClick" runat="server"
                    AutoPostBack="true">
                </asp:DropDownList>
            </td>
            <td style="width: 200px; padding-left: 20px;">
                面值：<asp:TextBox ID="txtFaceValueQuery" runat="server" AutoPostBack="true" 
                    ontextchanged="Search_OnClick"></asp:TextBox>
            </td>
            <td>
                开始日期：<asp:TextBox runat="server" ID="begindate" Width="75px" Height="16px" 
                    AutoPostBack="true" ontextchanged="Search_OnClick" />
            </td>
            <td>
                结束日期：
                <asp:TextBox runat="server" ID="EndDate" Width="75px" Height="16px" 
                    AutoPostBack="true" ontextchanged="Search_OnClick" />
                <asp:Button ID="sb" runat="server" Text="查 询" OnClick="Search_OnClick" />
            </td>
        </tr>
    </table>
    <br />
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="ID"
        AllowPaging="True" PageSize="15" CssClass="tableHead">
        <Columns>
        <asp:BoundField ReadOnly="True" DataField="rowid" HeaderText="序号" ItemStyle-Width="120px">
            </asp:BoundField>
            <asp:BoundField ReadOnly="True" DataField="CardNumber" HeaderText="VIP卡号" ItemStyle-Width="180px">
            </asp:BoundField>
            <asp:TemplateField HeaderText="VIP卡类型" ItemStyle-Width="200px">
                <ItemTemplate>
                    <asp:Label ID="CardCategory" runat="server" Text='<%#GetCategoryName(Eval("CardCategory")) %>' />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="购买日期" ItemStyle-Width="200px">
                <ItemTemplate>
                    <asp:Label ID="PurchaseDate" runat="server" Text='<%#GetData(Eval("PurchaseDate")) %>' />
                </ItemTemplate>
            </asp:TemplateField>
            

            <asp:BoundField DataField="FaceValue" HeaderText="面值" ItemStyle-Width="100px"></asp:BoundField>
            <asp:TemplateField HeaderText="余额" ItemStyle-Width="100px">
                <ItemTemplate>
                    <asp:Label ID="Balance" runat="server" Text='<%#Eval("Balance") %>' />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="查询" ItemStyle-Width="40px">
                <ItemTemplate>
                    <%#GetQueryUrl(Eval("FaceValue"), Eval("Balance"), Eval("CardNumber"))%>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField ReadOnly="True" DataField="CouponAmount" HeaderText="奖励"></asp:BoundField>
        </Columns>
        <EmptyDataTemplate>
            <table class="tableHearder" style="width: 98%">
                <tr>
                <th>
                        序号
                    </th>
                    <th>
                        VIP卡号
                    </th>
                    <th>
                        VIP卡类型
                    </th>
                    <th>
                        购买日期
                    </th>
                    <th>
                        面值
                    </th>
                    <th>
                        余额
                    </th>
                    <th>
                        购买时得到的奖励
                    </th>
                </tr>
                <tr>
                    <td colspan="7">
                        没有符合查询条件的记录
                    </td>
                </tr>
            </table>
        </EmptyDataTemplate>
    </asp:GridView>
</asp:Content>
