<%@ page title="" language="C#" masterpagefile="~/Admin/AdminIndexMaster.master" autoeventwireup="true" inherits="Admin_MBF_VipCardManage, WebApp_deploy" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CPHead" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

    <table class="nick">
        <tr>
            <td colspan="4" class="tit" style="display: none">
                充值卡列表
            </td>
        </tr>
        <tr>
            <td class="normal">
                VIP卡类别：<asp:DropDownList ID="DropType" 
                    runat="server" AutoPostBack="true" 
                    onselectedindexchanged="Query_SelectedIndexChanged">
                </asp:DropDownList>
            </td>
            <td class="normal">
                面值：<asp:TextBox ID="txtFaceValueQuery" runat="server" 
                    Width="80px" ontextchanged="Query_SelectedIndexChanged" AutoPostBack="true"></asp:TextBox>
            </td>
            <td class="normal">
                购买者：<asp:TextBox ID="txtPurchaseUserNameQuery" runat="server" 
                    Width="80px" ontextchanged="Query_SelectedIndexChanged" AutoPostBack="true"></asp:TextBox>
            </td>
            <td class="normal">
                状态<asp:DropDownList ID="ddl_state" runat="server" 
                    onselectedindexchanged="Query_SelectedIndexChanged" AutoPostBack="true">
                <asp:ListItem Value="" Text="全部"></asp:ListItem>
                <asp:ListItem Value="1" Text="有余额"></asp:ListItem>
                <asp:ListItem Value="0" Text="无余额"></asp:ListItem>
                </asp:DropDownList>
            </td>
            <td class="normal">
                购买日期：<asp:TextBox runat="server" 
                    ID="begindate" Width="75px" Height="16px" AutoPostBack="true" 
                    ontextchanged="Query_SelectedIndexChanged" />
                至
                <asp:TextBox runat="server" ID="EndDate" Width="75px" Height="16px" 
                    AutoPostBack="true" ontextchanged="Query_SelectedIndexChanged" />
            </td>
            <td class="normal">
                <asp:Button ID="Button1" runat="server" Text="查询" CausesValidation="false" OnClick="Button1_OnClick" />
            </td>
        </tr>
    </table>
    <asp:GridView ID="GridView1" runat="server" CssClass="adminlist" AutoGenerateColumns="False"
        DataKeyNames="ID" OnDataBound="GridView1_DataBound">
        <Columns>
            <asp:TemplateField HeaderText="VIP卡类型">
                <ItemTemplate>
                     <%# GetCategoryName(Eval("CardCategory"))%>
                </ItemTemplate>
                <ItemStyle HorizontalAlign="Center" Width="150px" />
            </asp:TemplateField>
            <asp:BoundField DataField="CardNumber" HeaderText="卡号 " />
            <asp:BoundField DataFormatString="{0:F2}" DataField="FaceValue" HeaderText="面值" />
            <asp:BoundField DataFormatString="{0:F2}" DataField="Balance" HeaderText="余额" />
            <asp:BoundField DataFormatString="{0:F2}" DataField="CouponAmount" HeaderText="奖励金额" />
            <asp:BoundField DataField="PurchaseDate" DataFormatString="{0:yyyy-MM-dd}" HeaderText="购买日期" />
            <asp:TemplateField HeaderText="购买者">
                <ItemTemplate>
                     <%# GetUserName(Eval("PurchaseUserID"))%>
                </ItemTemplate>
                
                <ItemStyle HorizontalAlign="Center" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="状态">
                <ItemTemplate>
                    <%# GetState(Eval("Balance"))%>
                </ItemTemplate>
            </asp:TemplateField>
            
        </Columns>
        <EmptyDataTemplate>
            <table class="adminlist">
                <tr>
                    <th>
                    </th>
                </tr>
                <tr>
                    <td colspan="9">
                        暂无VIP卡!
                    </td>
                </tr>
            </table>
        </EmptyDataTemplate>
    </asp:GridView>
    <div class="page">
        <webdiyer:AspNetPager ID="AspNetPager1" runat="server">
        </webdiyer:AspNetPager>
    </div>
    <div class="div_btm">
    </div>
    <div class="help_intro">
        <h1>
            帮助说明：</h1>
        <ul style="margin: 0; padding: 0; text-align: left; line-height: 20px">
            <li>VIP卡是用户自助购买的，后台只提供查询功能</li>
        </ul>
    </div>
</asp:Content>
