<%
    //-----------------------------------------------------------
    // 文件名称: User_UserCard_Manage.aspx
    // 页面名称: 会员卡管理
    //
    // 描    述:
    //
    // 创建标识: Add By 吴建春 2008-06-11
    //-----------------------------------------------------------
%>

<%@ page language="C#" autoeventwireup="true" inherits="V5Shop.Admin.User_UserCard_Manage, V5Shop.Shop.User" culture="auto" uiculture="auto" meta:resourcekey="PageResource1" enableviewstatemac="false" enableEventValidation="false" viewStateEncryptionMode="Never" %>

<%@ Register Src="control/HiddenField.ascx" TagName="HiddenField" TagPrefix="uc1" %>
<%@ Register Src="control/PageBottom.ascx" TagName="PageBottom" TagPrefix="uc2" %>
<%@ Register Src="control/ManageHeader.ascx" TagName="ManageHeader" TagPrefix="uc3" %>
<%@ Register Assembly="V5Shop.Control" Namespace="V5Shop.Control" TagPrefix="V5" %>
<!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 runat="server">
    <title></title>
    <link href="css/css.css" rel="stylesheet" type="text/css" />
    <link href="css/control.css" rel="stylesheet" type="text/css" />
    <link href="js/calendar-system.css" rel="stylesheet" type="text/css" />
    <link href="css/css_list.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" language="javascript" src="js/Common.js"></script>
    <script type="text/javascript" language="javascript" src="Js/Calendar.js"></script>
    <script type="text/javascript" language="javascript" src="Js/Calendar-Setup.js"></script>
    <script type="text/javascript" language="javascript" src="Js/Calendar-zh.js"></script>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <uc3:ManageHeader ID="PageHead" runat="server" />
            <div id="search">
                <!-- 查询部 -->
                <div style="padding-right: 20px; padding-left: 20px; padding-bottom: 20px; padding-top: 20px; border-bottom: #f7f7f7 4px solid">
                    <table>
                        <tr>
                            <td style="text-align: right">
                                <asp:Label ID="Label5" runat="server" meta:resourcekey="lblAdminNameResource" Text="卡号:"></asp:Label></td>
                            <td>
                                <asp:TextBox ID="txtNumber" runat="server" Width="104px"></asp:TextBox></td>
                            <td style="text-align: right">
                                <asp:Label ID="Label3" runat="server" meta:resourcekey="lblAdminNameResource" Text="加卡人:"></asp:Label></td>
                            <td style="text-align: right">
                                <asp:TextBox ID="txtAdminName" runat="server" Width="104px"></asp:TextBox></td>
                            <td style="text-align: right">
                                <asp:Label ID="Label2" runat="server" meta:resourcekey="lblAdminNameResource" Text="持卡人:"></asp:Label></td>
                            <td>
                                <asp:TextBox ID="txtUserName" runat="server"></asp:TextBox></td>
                            <td style="text-align: right">
                                <asp:Label ID="Label4" runat="server" meta:resourcekey="lblAdminNameResource" Text="发放批次:"></asp:Label></td>
                            <td colspan="2">
                                <asp:TextBox ID="txtDispenseOrder" runat="server"></asp:TextBox></td>
                        </tr>
                        <tr>
                            <td style="text-align: right">
                                &nbsp;<asp:Label ID="Label1" runat="server" meta:resourcekey="lblAdminNameResource" Text="分配状态:"></asp:Label></td>
                            <td>
                                <asp:DropDownList ID="ddlDistributeStatus" runat="server">
                                    <asp:ListItem Value="-1">全部</asp:ListItem>
                                    <asp:ListItem Value="1">已分配</asp:ListItem>
                                    <asp:ListItem Value="0">未分配</asp:ListItem>
                                </asp:DropDownList></td>
                            <td style="text-align: right">
                                &nbsp;<asp:Label ID="lblAdminName" runat="server" meta:resourcekey="lblAdminNameResource" Text="锁定状态:"></asp:Label></td>
                            <td style="text-align: left">
                                <asp:DropDownList ID="ddlIsLock" runat="server">
                                    <asp:ListItem Value="-1">全部</asp:ListItem>
                                    <asp:ListItem Value="1">已锁定</asp:ListItem>
                                    <asp:ListItem Value="0">未锁定</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                            <td style="text-align: right">
                                &nbsp;<asp:Label ID="Label7" runat="server" meta:resourcekey="lblAdminNameResource" Text="生成时间:"></asp:Label></td>
                            <td colspan="3">
                                <asp:TextBox ID="txtStart" runat="server" Width="100px" onblur="return CheckDate(this, true, false);" />
                                <img id="ImgDateStart" alt="打开日历" src="images/calendar1.gif" title="打开日历" />
                                -
                                <asp:TextBox ID="txtEnd" runat="server" Width="100px" onblur="return CheckDate(this, true, false);" />
                                <img id="ImgDateEnd" alt="打开日历" src="images/calendar1.gif" title="打开日历" />&nbsp;
                            </td>
                            <td>
                                &nbsp;<asp:Button ID="btnSearch" runat="server" OnClick="btnSearch_Click" Text="查询" meta:resourcekey="btnSearchResource" CssClass="button" /></td>
                        </tr>
                    </table>
                </div>
            </div>
            <div id="content">
                <div style="padding-right: 25px; padding-left: 25px; padding-bottom: 3px; color: #4b6888; padding-top: 3px; border-bottom: #cccccc 1px solid">
                    <input id="CheckAllBox" onclick="CheckAll()" type="checkbox" class="checkbox" />
                    全选&nbsp;
                    <asp:LinkButton ID="btnAdd" runat="server" ForeColor="#4B6888" meta:resourcekey="btnAddResource2" OnClick="btnAdd_Click" Width="60px"><img src="images/icon/key_add.gif" alt=""/>添加</asp:LinkButton><asp:LinkButton ID="btnDel" runat="server" CausesValidation="False" ForeColor="#4B6888" meta:resourcekey="btnDelResource2" OnClick="btnDel_Click" OnClientClick="return CheckSelectOne()" Width="60px"><img src="images/icon/key_delete.gif" alt=""/> 删除</asp:LinkButton><asp:LinkButton ID="btnLock" runat="server" CausesValidation="False" ForeColor="#4B6888" meta:resourcekey="btnDelResource2" OnClientClick="return CheckSelect()" OnClick="btnLock_Click" Width="60px"><img src="images/icon/key_lock.gif" alt=""/> 锁定</asp:LinkButton><asp:LinkButton ID="btnUnLock" runat="server" CausesValidation="False" ForeColor="#4B6888" meta:resourcekey="btnDelResource2" OnClientClick="return CheckSelect()" OnClick="btnUnLock_Click" Width="85px"><img src="images/icon/key_unlock.gif" alt=""/> 取消锁定</asp:LinkButton><asp:LinkButton ID="btnViewLog" runat="server" CausesValidation="False" ForeColor="#4B6888" meta:resourcekey="btnDelResource2" OnClientClick="return CheckSelectOne()" OnClick="btnViewLog_Click" Width="110px"><img src="images/icon/key_detail.gif" alt=""/> 查看使用记录</asp:LinkButton><asp:LinkButton ID="LinkButton1" OnClick="btnSetUserDate_Click" OnClientClick="return CheckSelectOne();" runat="server" meta:resourcekey="btnAddResource2" ForeColor="#4B6888" Width="130px"><img src="images/icon/key_edit.gif" alt=""/>延长会员卡使用期</asp:LinkButton>
                    &nbsp;
                    <asp:Label ID="lblUserNameTitle" runat="server" Visible="False">当前用户:</asp:Label><asp:Label ID="lblUserName" runat="server" Visible="False"></asp:Label>
                    &nbsp;
                    <asp:LinkButton ID="btnDistribute" runat="server" ForeColor="#4B6888" meta:resourcekey="btnEditResource2" OnClientClick="return CheckSelectOne()" CausesValidation="False" Visible="False" OnClick="btnDistribute_Click"><img src="images/key_edit.gif" alt=""/> 分配给会员</asp:LinkButton>
                </div>
                <div id="pnlSetUserCardDate" runat="server" visible="false" style="padding-right: 25px; padding-left: 50px; padding-bottom: 3px; color: #4b6888; padding-top: 3px; border-bottom: #cccccc 1px solid">
                    <asp:Label ID="lblChangeDateType" runat="server" Text="请选择要延长的使用期限：" />&nbsp;<asp:DropDownList runat="server" ID="ddlChangeDateType">
                    </asp:DropDownList>
                    <asp:Button ID="btnSetUserCardDate" runat="server" CssClass="button" Text="确定" OnClick="btnSetUserCardDate_Click" /></div>
                <div class="listborder">
                    <V5:V5ShopGridView ID="GridViewShow" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" CssClass="datalist" PageSize="12" HeaderStyle-ForeColor="#000000" EmptyDataText="没有任何可用信息！">
                        <PagerSettings Mode="NumericFirstLast" />
                        <Columns>
                            <asp:TemplateField meta:resourcekey="DetilData">
                                <itemtemplate>
                                    <input runat="server" value='<%# Eval("ID") %>' id="CheckBoxID" type="checkbox" class="checkbox"
                                        onmouseover="this.mouse='over'" onmouseout="this.mouse='out'" />
                                </itemtemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="ID" HeaderText="ID" SortExpression="ID" />
                            <asp:BoundField DataField="Number" HeaderText="卡号" SortExpression="Number" />
                            <asp:TemplateField meta:resourcekey="DetilData" HeaderText="密码">
                                <itemtemplate>
                                    <V5:HelpCtrl runat="server" ImageURL="images/key_detail.gif" Header="卡密码:" 
                                        FontColor="#000000" Text='<%# DataBinder.Eval(Container.DataItem, "Password") %>'></V5:HelpCtrl>
                                </itemtemplate>
                                <itemstyle horizontalalign="Center" width="5%" />
                            </asp:TemplateField>
                            <asp:TemplateField meta:resourcekey="DetilData" HeaderText="分配状态" SortExpression="DistributeStatus">
                                <itemtemplate>
                                    <asp:Label ID="lblDistributeStatus" runat="server" 
                                        Text='<%# FormatState("DistributeStatus", DataBinder.Eval(Container, "DataItem(DistributeStatus)","{0}")) %>'></asp:Label>
                                </itemtemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="CardPrise" HeaderText="卡金额" SortExpression="CardPrise" />
                            <asp:BoundField DataField="AdminName" HeaderText="加卡人" SortExpression="AdminName" />
                            <asp:BoundField DataField="Date" HeaderText="生成时间" SortExpression="Date" />
                            <asp:BoundField DataField="EndDate" HeaderText="最后使用日期" SortExpression="EndDate" />
                            <asp:BoundField DataField="DispenseOrder" HeaderText="发放批次" SortExpression="DispenseOrder" />
                            <asp:BoundField DataField="UserName" HeaderText="持卡人" SortExpression="UserName" />
                            <asp:TemplateField meta:resourcekey="DetilData" HeaderText="锁定状态" SortExpression="IsLock">
                                <itemtemplate>
                                    <asp:Label ID="lblLockState" runat="server" 
                                        Text='<%# FormatState("IsLock", DataBinder.Eval(Container, "DataItem(IsLock)","{0}")) %>'></asp:Label>
                                </itemtemplate>
                            </asp:TemplateField>
                        </Columns>
                        <HeaderStyle CssClass="category" ForeColor="Black" />
                    </V5:V5ShopGridView>
                </div>
            </div>
            <uc2:PageBottom ID="PageBottom" runat="server" />
            <div id="hiddenfield">
                <asp:HiddenField ID="RequestID" runat="server" Value="0" />
                <asp:HiddenField ID="CheckedIDS" runat="server" Value="0" />
                <asp:HiddenField ID="PageIndex" runat="server" Value="0" />
                <asp:HiddenField ID="MaxPageIndex" runat="server" Value="0" />
                <uc1:HiddenField ID="Alert" runat="server" />
            </div>
        </div>
        <script language="javascript" type="text/javascript">
        Calendar.setup({
            inputField     :    "txtStart",
            ifFormat       :    "%Y-%m-%d", 
            button         :    "ImgDateStart",
            align          :    "Br",
            singleClick    :    true
        });
        Calendar.setup({
            inputField     :    "txtEnd",
            ifFormat       :    "%Y-%m-%d", 
            button         :    "ImgDateEnd",
            align          :    "Br",
            singleClick    :    true
        });
        </script>
    </form>
</body>
</html>
