<%
    //-----------------------------------------------------------
    // 文件名称: User_ShopCard_Manage.aspx
    // 页面名称: 购物卡管理
    //
    // 描    述:
    //
    // 创建标识: Add By 吴建春 2008-08-30
    //-----------------------------------------------------------
%>

<%@ page language="C#" autoeventwireup="true" inherits="V5Shop.Admin.User_ShopCard_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">
                    <asp:Label ID="Label5" runat="server" meta:resourcekey="lblAdminNameResource" Text="卡&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;号:"></asp:Label>
                    <asp:TextBox ID="txtNumber" runat="server" Width="120px"></asp:TextBox>
                    <asp:Label ID="Label3" runat="server" meta:resourcekey="lblAdminNameResource" Text="&nbsp;加&nbsp;卡&nbsp;人:"></asp:Label>
                    <asp:TextBox ID="txtAdminName" runat="server" Width="120px"></asp:TextBox>
                    <asp:Label ID="Label2" runat="server" meta:resourcekey="lblAdminNameResource" Text="&nbsp;持&nbsp;卡&nbsp;人:"></asp:Label>
                    <asp:TextBox ID="txtUserName" runat="server" Width="120px"></asp:TextBox>
                    <asp:Label ID="Label4" runat="server" meta:resourcekey="lblAdminNameResource" Text="发放批次:"></asp:Label>
                    <asp:TextBox ID="txtDispenseOrder" runat="server" Width="120px"></asp:TextBox>
                    <br>
                    <asp:Label ID="Label1" runat="server" meta:resourcekey="lblAdminNameResource" Text="销售状态:"></asp:Label>
                    <asp:DropDownList ID="ddlDistributeStatus" runat="server" Width="124px">
                        <asp:ListItem Value="-1">全部</asp:ListItem>
                        <asp:ListItem Value="1">已销售</asp:ListItem>
                        <asp:ListItem Value="0">未销售</asp:ListItem>
                    </asp:DropDownList>
                    <asp:Label ID="lblAdminName" runat="server" meta:resourcekey="lblAdminNameResource" Text="锁定状态:"></asp:Label>
                    <asp:DropDownList ID="ddlIsLock" runat="server" Width="124px">
                        <asp:ListItem Value="-1">全部</asp:ListItem>
                        <asp:ListItem Value="1">已锁定</asp:ListItem>
                        <asp:ListItem Value="0">未锁定</asp:ListItem>
                    </asp:DropDownList>
                    <asp:Label ID="Label7" runat="server" meta:resourcekey="lblAdminNameResource" Text="生成时间:"></asp:Label>
                    <asp:TextBox ID="txtStart" runat="server" Width="120px" onblur="return CheckDate(this, true, false);" />
                    <img id="ImgDateStart" alt="打开日历" src="images/calendar1.gif" title="打开日历" />
                    -
                    <asp:TextBox ID="txtEnd" runat="server" Width="120px" onblur="return CheckDate(this, true, false);" />
                    <img id="ImgDateEnd" alt="打开日历" src="images/calendar1.gif" title="打开日历" />
                    <asp:Button ID="btnSearch" runat="server" OnClick="btnSearch_Click" Text="查询" meta:resourcekey="btnSearchResource" CssClass="button" /></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/key_add.gif" alt="Read/Write Property"/> 添加</asp:LinkButton>
                    <asp:LinkButton ID="btnDel" runat="server" CausesValidation="False" ForeColor="#4B6888" meta:resourcekey="btnDelResource2" OnClick="btnDel_Click" OnClientClick="return CheckDel()" 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="90px"><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:Label ID="lblUserNameTitle" runat="server" Visible="False">当前用户:</asp:Label><asp:Label ID="lblUserName" runat="server" Visible="False"></asp:Label>&nbsp;&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/icon/key_edit.gif" alt=""/> 出售给会员</asp:LinkButton>
                </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="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>
