<%
    //-----------------------------------------------------------
    // 文件名称: Promotions_WholeSale_Operate.aspx
    // 页面名称: 批发方案添加/编辑
    //
    // 描    述:
    //
    // 创建标识: Add By 吴建春 2008-06-27
    //-----------------------------------------------------------
%>

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

<%@ Register Assembly="V5Shop.Control" Namespace="V5Shop.Control" TagPrefix="V5" %>
<%@ Register Src="control/PageBottom.ascx" TagName="PageBottom" TagPrefix="uc2" %>
<%@ Register Src="control/HiddenField.ascx" TagName="HiddenField" TagPrefix="uc1" %>
<!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/css_list.css" rel="stylesheet" type="text/css" />
    <link href="css/control.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" language="javascript" src="js/Common.js"></script>
</head>
<body>
    <form id="form1" runat="server">
        <div class="OperateTitle">
            <div>
                <asp:Label ID="lblAdd" runat="server" Text="【批发方案添加】" />
                <asp:Label ID="lblEdit" runat="server" Text="【批发方案编辑】" />
                <a href='Promotions_WholeSale_Manage.aspx' title="返回列表">返回列表</a>
            </div>
        </div>
        <div style="text-align: center;">
            <asp:Panel runat="server" ID="PanelShow" Width="100%">
                <div>
                    <table id="OperateTable" width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                        <tr class="F7tr">
                            <td width="20%" height="30" align="right">
                                <asp:Label ID="Label5" runat="server" Text="批发方式：" /></td>
                            <td width="80%" align="left">
                                <asp:RadioButtonList ID="rblIsSingle" runat="server" RepeatDirection="Horizontal" AutoPostBack="True" OnSelectedIndexChanged="rblIsSingle_SelectedIndexChanged" RepeatColumns="6" CssClass="input2">
                                    <asp:ListItem Selected="True" Value="1">单批</asp:ListItem>
                                    <asp:ListItem Value="0">混批</asp:ListItem>
                                </asp:RadioButtonList>
                                <asp:Label ID="Label3" runat="server" ForeColor="Blue" Text="请注意:批发方案变动时, 批发方案中的拆扣列表将被清空." />
                            </td>
                        </tr>
                        <tr class="FFtr">
                            <td width="20%" height="30" align="right">
                                <asp:Label ID="Label1" runat="server" Text="批发方案名称：" /></td>
                            <td width="80%" align="left">
                                <asp:TextBox ID="txtName" runat="server" Width="300px" MaxLength="50" />
                                <span style="color: #ff0000">*</span>
                                <asp:RequiredFieldValidator ID="rfvName" runat="server" ErrorMessage="必须输入。" ControlToValidate="txtName" Display="Dynamic"></asp:RequiredFieldValidator></td>
                        </tr>
                        <tr class="F7tr">
                            <td width="20%" height="30" align="right">
                                <asp:Label ID="Label13" runat="server" Text="是否启用：" />
                            </td>
                            <td width="80%" align="left">
                                <asp:RadioButtonList ID="rblIsAct" runat="server" RepeatDirection="Horizontal" RepeatColumns="6" CssClass="input2">
                                    <asp:ListItem Selected="True" Value="1">是</asp:ListItem>
                                    <asp:ListItem Value="0">否</asp:ListItem>
                                </asp:RadioButtonList></td>
                        </tr>
                        <tr class="FFtr">
                            <td width="20%" height="30" align="right">
                                <asp:Label ID="Label6" runat="server" Text="适用会员等级：" /></td>
                            <td width="80%" align="left">
                                <asp:CheckBoxList ID="cblUserGroup_disable" runat="server" RepeatDirection="Horizontal" RepeatColumns="6" CssClass="input3">
                                </asp:CheckBoxList></td>
                        </tr>
                        <tr id="trProduct" runat="server">
                            <td width="20%" height="30" align="right">
                                <asp:Label ID="Label2" runat="server" Text="关联商品：" /></td>
                            <td width="80%" align="left">
                                <V5:SelectListBox ID="slbProduct" runat="server" CategoryHeaderText="商品分类:" DescHeaderText="选定的商品:" Height="200px" SrcHeaderText="待选的商品:" Width="440px" />
                            </td>
                        </tr>
                        <tr class="F7tr">
                            <td width="20%" height="30" align="right">
                                <asp:Label ID="Label15" runat="server" Text="折扣列表：" /></td>
                            <td width="80%" align="left">
                                <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" class="checkbox" onclick="CheckAllByGridView('GridViewShow', 0, 'CheckAllBox')" type="checkbox" />全选
        　    <asp:LinkButton ID="btnAdd" runat="server" ForeColor="#4B6888" meta:resourcekey="btnAddResource2" OnClick="btnAdd_Click" CausesValidation="False"><img src="images/icon/key_add.gif" alt="添加"/> 添加</asp:LinkButton>
        　    <asp:LinkButton ID="btnEdit" runat="server" CausesValidation="False" ForeColor="#4B6888" meta:resourcekey="btnEditResource2" OnClick="btnEdit_Click" OnClientClick="return CheckEdit()"><img src="images/icon/key_edit.gif" alt="编辑"/> 编辑</asp:LinkButton>
        　    <asp:LinkButton ID="btnDel" runat="server" CausesValidation="False" ForeColor="#4B6888" meta:resourcekey="btnDelResource2" OnClick="btnDel_Click" OnClientClick="return CheckDel()"><img src="images/icon/key_delete.gif" alt="删除"/> 删除</asp:LinkButton>&nbsp;</div>
                                    <!-- 明细数据 -->
                                    <div class="listborder">
                                        <asp:Label ID="Label18" runat="server" ForeColor="Blue" Text="注意点：带*号的ID为临时ID，可能与数据库ID不相同，只有当所有内容都提交时才会生成实际数据。" />
                                        <V5:V5ShopGridView ID="GridViewShow" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" CssClass="datalist" PageSize="5" HeaderStyle-ForeColor="#000000" EmptyDataText="没有任何可用信息！" BorderWidth="0px" CacheName="TableCache_" GridLines="None" TableName="" Width="100%">
                                            <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="Count" HeaderText="达到数量" SortExpression="Count" />
                                                <asp:BoundField DataField="Price" HeaderText="享受价格" SortExpression="Price" />
                                                <asp:BoundField DataField="Discount" HeaderText="折扣" ReadOnly="True" SortExpression="Discount" />
                                            </Columns>
                                            <HeaderStyle CssClass="category" ForeColor="Black" />
                                        </V5:V5ShopGridView>
                                    </div>
                                    <asp:Panel ID="pnlSingle" runat="server" Visible="False" Width="400px" Height="18px">
                                        <asp:Label ID="Label16" runat="server" Text="购买商品数量达到" /><V5:NumberBox ID="txtCountSingle" runat="server" Width="80px" IsInt="True" />
                                        <asp:Label ID="Label17" runat="server" Text="时，可享受的折扣为:" /><V5:NumberBox ID="txtDisCountSingle" runat="server" Width="50px" IsInt="false" />
                                        <asp:Button ID="btnSetPriceSingle" runat="server" CssClass="button" Text="确定" CausesValidation="False" OnClick="btnSetPrice_Click" /></asp:Panel>
                                    <asp:Panel ID="pnlMuti" runat="server" Visible="False" Width="440px" Height="18px">
                                        <asp:DropDownList ID="ddlTypeMuti" runat="server">
                                            <asp:ListItem Value="0">购买商品总价达到</asp:ListItem>
                                            <asp:ListItem Value="1">购买商品数量达到</asp:ListItem>
                                        </asp:DropDownList><V5:NumberBox ID="txtCountMuti" runat="server" Width="80px" IsInt="True" />
                                        <asp:Label ID="lblCountTitle" runat="server" Text="时，可享受折扣为:" /><V5:NumberBox ID="txtDisCountMuti" runat="server" Width="50px" IsInt="false" />
                                        <asp:Button ID="btnSetPriceMuti" runat="server" CssClass="button" Text="确定" CausesValidation="False" OnClick="btnSetPrice_Click" /></asp:Panel>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td width="20%" height="30" align="right">
                                <asp:Label ID="Label12" runat="server" Text="活动描述：" /></td>
                            <td width="80%" align="left">
                                <asp:TextBox ID="txtContent" runat="server" Height="100px" TextMode="MultiLine" Width="300px" />
                                <asp:RegularExpressionValidator ID="revContent" runat="server" ControlToValidate="txtContent" Display="Dynamic" ErrorMessage="长度必须在250以内" ValidationExpression=".{0,250}"></asp:RegularExpressionValidator></td>
                        </tr>
                        <tr>
                            <td align="center" style="text-align: center;" colspan="2">
                                <br />
                                <asp:Button ID="btnAddSubmit" runat="server" meta:resourcekey="btnAddResource1" OnClick="btnAddSubmit_Click" Text="确定" CssClass="button" />
                                <input id="iptReset" runat="server" type="reset" value="重置" class="button" />
                                <asp:Button id="btnReturn" onclick="btnReturn_Click" runat="server" Text="返回列表" CssClass="button" CausesValidation="false" />
                            </td>
                        </tr>
                    </table>
                </div>
            </asp:Panel>
            <uc2:PageBottom ID="PageBottom1" runat="server" />
        </div>
        <div id="hiddenfield">
            <asp:HiddenField ID="CheckedIDS" runat="server" Value="0" />
            <asp:HiddenField ID="EditID" runat="server" Value="0" />
            <asp:HiddenField ID="IsEdit" runat="server" Value="0" />
            <asp:HiddenField ID="PanelOperate" 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>
    </form>
</body>
</html>
