<%
    //-----------------------------------------------------------
    // 文件名称: Promotions_Coupon_Manage.aspx
    // 页面名称: 优惠券管理
    //
    // 描    述:
    //
    // 创建标识: Add By 吴建春 2008-06-23
    //-----------------------------------------------------------
%>

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

<%@ Register Src="control/HiddenField.ascx" TagName="HiddenField" TagPrefix="uc1" %>
<%@ Register Assembly="V5Shop.Control" Namespace="V5Shop.Control" TagPrefix="V5" %>
<%@ Register Src="control/ManageHeader.ascx" TagName="ManageHeader" TagPrefix="uc3" %>
<%@ Register Src="control/PageBottom.ascx" TagName="PageBottom" TagPrefix="uc2" %>

<!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="优惠券名:"/>
                    <asp:TextBox ID="txtName" runat="server" Width="80px"/>
                    <asp:Label ID="Label3" runat="server" meta:resourcekey="lblAdminNameResource" Text="优惠券号:"/>
                    <asp:TextBox ID="txtNumber" runat="server" Width="80px"/>
                    <asp:Label ID="Label2" runat="server" meta:resourcekey="lblAdminNameResource" Text="使用会员:"/>
                    <asp:TextBox ID="txtUserName" runat="server" Width="80px"/>
                                <asp:Label ID="Label7" runat="server" meta:resourcekey="lblAdminNameResource" Text="开始时间:"/>
                    <asp:TextBox ID="txtMinStart" runat="server" Width="70px" onblur="return CheckDate(this, true, false);" /><img id="ImgMinStart" alt="打开日历" src="images/calendar1.gif" title="打开日历" />
                                -
                                <asp:TextBox ID="txtMaxStart" runat="server" Width="70px" onblur="return CheckDate(this, true, false);" /><img id="ImgMaxStart" alt="打开日历" src="images/calendar1.gif" title="打开日历" />&nbsp;<br>
                                <asp:Label ID="Label8" runat="server" meta:resourcekey="lblAdminNameResource" Text="是否分配:"/>
                                <asp:DropDownList ID="ddlIsDistribution" runat="server" Width="84px">
                                    <asp:ListItem Value="-1">全部</asp:ListItem>
                                    <asp:ListItem Value="1">已分配</asp:ListItem>
                                    <asp:ListItem Value="0">未分配</asp:ListItem>
                                </asp:DropDownList>
                                <asp:Label ID="Label1" runat="server" meta:resourcekey="lblAdminNameResource" Text="是否使用:"/>
                                <asp:DropDownList ID="ddlIsUsed" runat="server" Width="84px">
                                    <asp:ListItem Value="-1">全部</asp:ListItem>
                                    <asp:ListItem Value="1">已使用</asp:ListItem>
                                    <asp:ListItem Value="0">未使用</asp:ListItem>
                                </asp:DropDownList>
                    <asp:Label ID="Label6" runat="server" meta:resourcekey="lblAdminNameResource" Text=" 是否启用:"/>
                                <asp:DropDownList ID="ddlIsActive" runat="server" Width="84px">
                                    <asp:ListItem Value="-1">全部</asp:ListItem>
                                    <asp:ListItem Value="1">已启用</asp:ListItem>
                                    <asp:ListItem Value="0">未启用</asp:ListItem>
                                </asp:DropDownList>
                    <asp:Label ID="Label4" runat="server" meta:resourcekey="lblAdminNameResource" Text="结束时间:"/>
                                <asp:TextBox ID="txtMinEnd" runat="server" Width="70px" onblur="return CheckDate(this, true, false);" /><img id="ImgMinEnd" alt="打开日历" src="images/calendar1.gif" title="打开日历" />
                                -
                                <asp:TextBox ID="txtMaxEnd" runat="server" Width="70px" onblur="return CheckDate(this, true, false);" /><img id="ImgMaxEnd" alt="打开日历" src="images/calendar1.gif" title="打开日历" />
                                <asp:Button ID="btnSearch" runat="server" OnClick="btnSearch_Click" Text="查询" meta:resourcekey="btnSearchResource" CssClass="button" CausesValidation="False" />
                </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" /><asp:Label ID="lblSelectAll" runat="server" Text="全选" />
                    &nbsp; &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 CheckDel()" Width="60px"><img src="images/icon/key_delete.gif" alt=""/> 删除</asp:LinkButton><asp:LinkButton ID="btnViewDetail" runat="server" CausesValidation="False" ForeColor="#4B6888" meta:resourcekey="btnAddResource2" OnClientClick="return CheckSelectOne()" OnClick="btnViewDetail_Click" Width="60px"><img src="images/icon/key_detail.gif" alt=""/> 查看</asp:LinkButton><asp:LinkButton ID="btnActive" runat="server" ForeColor="#4B6888" meta:resourcekey="btnAddResource2" OnClick="btnActive_Click" OnClientClick="return CheckSelect()" CausesValidation="False" Width="60px"><img src="images/icon/key_run.gif" alt="启用"/> 启用</asp:LinkButton><asp:LinkButton ID="btnUnActive" runat="server" ForeColor="#4B6888" meta:resourcekey="btnAddResource2" OnClick="btnUnActive_Click" OnClientClick="return CheckSelect()" CausesValidation="False" Width="60px"><img src="images/icon/key_stop.gif" alt="禁用"/> 禁用</asp:LinkButton><asp:Label ID="lblUserNameTitle" runat="server" Visible="False"> 当前用户:</asp:Label><asp:Label ID="lblUserName" runat="server" Visible="False"/>
                    &nbsp;&nbsp;
        　    <asp:LinkButton ID="btnDistribute" runat="server" ForeColor="#4B6888" meta:resourcekey="btnEditResource2" OnClientClick="return CheckSelectOne()" Visible="False" OnClick="btnDistribute_Click" CausesValidation="False"><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" HeaderStyle-ForeColor="#000000" EmptyDataText="没有任何可用信息！">
                        <PagerSettings Mode="NumericFirstLast" />
                        <Columns>
                            <asp:TemplateField meta:resourcekey="DetilData" ItemStyle-Width="5%">
                                <itemtemplate>
                                    <input runat="server" value='<%# Eval("ID") %>' id="CheckBoxID" type="checkbox" class="checkbox"
                                        onmouseover="this.mouse='over'" onmouseout="this.mouse='out'" />
                                </itemtemplate>
                            <itemstyle horizontalalign="Center"/></asp:TemplateField>
                            <asp:BoundField DataField="ID" HeaderText="ID" SortExpression="ID" ItemStyle-Width="5%" />
                            <asp:BoundField DataField="Name" HeaderText="优惠券名" SortExpression="Name" ItemStyle-Width="20%" />
                            <asp:BoundField DataField="Number" HeaderText="优惠券号" SortExpression="Number" ItemStyle-Width="20%"/>
                            <asp:BoundField DataField="StartDate" HeaderText="开始时间" SortExpression="StartDate" ItemStyle-Width="10%"/>
                            <asp:BoundField DataField="EndDate" HeaderText="结束时间" SortExpression="EndDate" ItemStyle-Width="10%"/>
                            <asp:BoundField DataField="MinusPrice" HeaderText="面值" SortExpression="MinusPrice" ItemStyle-Width="6%"/>
                            <asp:BoundField DataField="UserName" HeaderText="持卡人" SortExpression="UserName" ItemStyle-Width="6%"/>
                            <asp:TemplateField meta:resourcekey="DetilData" HeaderText="使用状态" SortExpression="IsUsed" ItemStyle-Width="6%">
                                <itemtemplate>
                                    <asp:Label ID="lblIsUsed" runat="server" 
                                        Text='<%# FormatState("IsUsed", DataBinder.Eval(Container, "DataItem(IsUsed)","{0}")) %>'/>
                                </itemtemplate>
                            <itemstyle horizontalalign="Center"/></asp:TemplateField>
                            <asp:TemplateField meta:resourcekey="DetilData" HeaderText="分配状态" SortExpression="IsDistribution" ItemStyle-Width="6%">
                                <itemtemplate>
                                    <asp:Label ID="lblIsDistribution" runat="server" 
                                        Text='<%# FormatState("IsDistribution", DataBinder.Eval(Container, "DataItem(IsDistribution)","{0}")) %>'/>
                                </itemtemplate>
                            <itemstyle horizontalalign="Center"/></asp:TemplateField>
                            <asp:TemplateField meta:resourcekey="DetilData" HeaderText="启用状态" SortExpression="IsActive" ItemStyle-Width="6%">
                                <itemtemplate>
                                    <asp:Label ID="lblIsActive" runat="server" 
                                        Text='<%# FormatState("IsActive", DataBinder.Eval(Container, "DataItem(IsActive)","{0}")) %>'/>
                                </itemtemplate>
                            <itemstyle horizontalalign="Center"/></asp:TemplateField>
                        </Columns>
                        <HeaderStyle CssClass="category" ForeColor="Black" />
                    </V5:V5ShopGridView>
                </div>
                <uc2:PageBottom ID="PageBottom1" runat="server" />
            </div>
            <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     :    "txtMinStart",
	        ifFormat       :    "%Y-%m-%d", 
	        button         :    "ImgMinStart",
	        align          :    "Br",
	        singleClick    :    true
        });
        Calendar.setup({
	        inputField     :    "txtMaxStart",
	        ifFormat       :    "%Y-%m-%d", 
	        button         :    "ImgMaxStart",
	        align          :    "Br",
	        singleClick    :    true
        });
        Calendar.setup({
	        inputField     :    "txtMinEnd",
	        ifFormat       :    "%Y-%m-%d", 
	        button         :    "ImgMinEnd",
	        align          :    "Br",
	        singleClick    :    true
        });
        Calendar.setup({
	        inputField     :    "txtMaxEnd",
	        ifFormat       :    "%Y-%m-%d", 
	        button         :    "ImgMaxEnd",
	        align          :    "Br",
	        singleClick    :    true
        });
        </script>

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