<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="member_voucher_list.aspx.cs" Inherits="VA.Modules.JDingMember.mycenter.memberinfo.member_voucher_list" %>

<%@ Import Namespace="System.Data"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>会员代金券</title>    
    <!--#include virtual="/include/css/editlist.aspx"-->
    <link href="/app_themes/default/css/modules/voucher.css" type="text/css" rel="Stylesheet" />
    <!--#include virtual="/include/js/editlist.aspx"-->         
    <script type="text/javascript">   
        $(function () {
            initListPage();         
        });
    </script>

</head>
<body>
<!--说明：该页面是以 employee_editlist_nofresh_5.aspx 为原型封装的结果-->
<form id="Form1" method="post" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>

<div id="pageWrapper" class="pageWrapper">   
                        
    <div id="toolBar">                          
        <a href="javascript:refresh()" class="jtongui-toolbarbutton" icon="icon-reload">刷新</a>            
        <asp:LinkButton ID="lbnExportToExcel" runat="server" CssClass="jtongui-toolbarbutton" icon="icon-export" OnClick="lbnExportToExcel_Click">导出</asp:LinkButton>
    </div><!--toolBar.END-->   
     
    <div id="searchBar">
    
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
        
        <asp:DropDownList ID="ddlUsingFlag" runat="server" 
             AutoPostBack="true"
             OnSelectedIndexChanged="ddlUsingFlag_SelectedIndexChanged">        
        </asp:DropDownList>      

        <asp:DropDownList ID="ddlExpiredFlag" runat="server" 
             AutoPostBack="true"
             OnSelectedIndexChanged="ddlExpiredFlag_SelectedIndexChanged">        
            <asp:ListItem Value="" Selected="True">是否过期</asp:ListItem>
            <asp:ListItem Value="0">未过期</asp:ListItem>
            <asp:ListItem Value="1">已过期</asp:ListItem>
        </asp:DropDownList>

        <asp:DropDownList ID="ddlSearchField" runat="server" EnableViewState="false">
        <asp:ListItem Value="">检索字段</asp:ListItem>
        <asp:ListItem Value="1">代金券编号</asp:ListItem>
        <asp:ListItem Value="2">代金券名称</asp:ListItem>
        <asp:ListItem Value="3">使用门店</asp:ListItem>            
        </asp:DropDownList>            

        <asp:TextBox ID="txtKeyWords" runat="server"
            CssClass="input keywords"
            Width="100px" />                          
        
        <asp:Button ID="btnSearch" runat="server" 
             CssClass="simpleBtn"
             Text="查询" 
             Onclick="btnSearch_Click" />
        
        </ContentTemplate>
        </asp:UpdatePanel>

    </div><!--searchBar.END-->    

    <div id="dataBar">

    <!--MainList.Start-->    
    <div class="jtongui-smartlisttable" id="jtongui-smartlisttable">

    <table cellpadding="3" cellspacing="0" class="tableheader" id="tb1_header" >
    <thead>
    <tr>
        <%--<td style="width:30px;text-align:center;"><input type="checkbox" id="ckb_selectAll"/></td>--%>
        <td style="width:30px;text-align:center;">No.</td>
        <td style="width:60px;text-align:center;">使用标志</td>
        <td style="width:80px;text-align:center;">代金券编号</td>
        <td style="width:200px;text-align:center;">代金券名称</td>
        <td style="width:70px;text-align:center;">代金券面值</td>
    <%--    <td style="width:110px;text-align:center;">每日限使用次数</td> --%>       
        <td style="width:110px;text-align:center;">限最低消费金额</td>         
        <td style="width:230px;text-align:center;">有效期</td>	                 
        <td style="width:100px;text-align:center;">受赠日期</td>
        <td style="width:100px;text-align:center;">受赠门店</td>
        <td style="width:70px;text-align:center;">赠送人</td>        
        <td style="width:100px;text-align:center;">使用时间</td>
        <td style="width:100px;text-align:center;">使用门店</td>
        <td></td>
    </tr>    
    </thead>
    </table>

    <div id="dataBody">
    <asp:Repeater ID="myRepeater" Runat="server" EnableViewState="False"  >
    <HeaderTemplate>    
    <div class="bodyContainer">
    <% = base.ShowNoRecordInfo() %>
    <table cellpadding="3" cellspacing="0" class="tablebody" tbHeader="tb1_header">
    </HeaderTemplate>
    <ItemTemplate>
    <tr<%# SetRowStyle(Convert.ToDateTime(Eval("Voucher_Expire_Date")))%>>
       <%-- <td style="text-align:center;"><input type="checkbox" name="ckb_dataItem" value="<%# Eval("Voucher_Code")%>" /></td>--%>
        <td align="center"><%# (base.currPage - 1)*base.PageSize + Container.ItemIndex + 1%></td>
        <td align="center"><%# VA.Modules.JDingMember.Core.Enums.VoucherConverter.VoucherUsingFlagConverter.Convert_Value_ToText(Eval("Using_Flag").ToString())%></td>   
        <td align="center"><%# Eval("VoucherNo")%></td>
        <td align="left"><%# Eval("Voucher_Name")%></td>
        <td align="center"><%# Convert.ToDecimal(Eval("Face_Value")).ToString("F2")%></td>
     <%--   <td align="center"><%# Eval("Limit_MaxUseTimes_PerDay")%></td>--%>
        <td align="center"><%# Convert.ToDecimal(Eval("Limit_MinConsumeAmount_PerBill")).ToString("F2")%></td>        
        <td align="center"><%# String.Format("{0:yyyy-MM-dd HH:mm}", Eval("Voucher_TakeEffect_Date"))%> 至 <%# String.Format("{0:yyyy-MM-dd HH:mm}", Eval("Voucher_Expire_Date"))%></td>        
        <td align="center"><%# String.Format("{0:yyyy-MM-dd HH:mm}", Eval("Distribute_Date"))%></td>        
        <td align="left"><%# Eval("BelongTo_Shop_Name")%></td>
        <td align="left"><%# Eval("Distribute_Operator_Code")%></td>        
        <td align="center"><%# VA.Utils.DateHelper.GetDateStringFormatNullDate(String.Format("{0:yyyy-MM-dd HH:mm}", Eval("Used_Date")))%></td>
        <td align="center"><%# Eval("Used_Shop_Name")%></td>   
        <td></td>
    </tr>
    </ItemTemplate>
    <FooterTemplate>
    </table>
    </div><!--bodyContainer.END-->        

    <div id="divPagerInfo" style="display:none">
        <%=base.pageInfo%>
    </div>

    <input type="hidden" id="hidden_pageCnt" value="<% = base.PageCnt%>" />
    <input type="hidden" id="hidden_rdCnt" value="<% = base.RdCnt%>" />
    <input type="hidden" name="chkNum" value="<%=chkNum%>" />

    </FooterTemplate>
    </asp:Repeater>    
    </div><!--dataBody.END-->

    </div><!--jtongui-smartlisttable.END-->        
    <!--MainList.End-->  

    </div><!--dataBar.END-->

    <div id="pagerBar">
       ……
    </div><!--pageNavBar.END-->
    
    <asp:HiddenField runat="server" ID="hfCurrPage" EnableViewState="true" />
    
</div>

<script type="text/javascript">

function distributeVouchers() {
    openFrameWindow("分配代金券", 725, 325, "voucher_allocate.aspx?vouchercode=<% = Request.QueryString["vouchercode"] %>");
}

</script>

</form>
</body>
</html> 