<%
    //-----------------------------------------------------------
    // 文件名称: Promotions_GroupBuy_Operate.aspx
    // 页面名称: 团购管理
    //
    // 描    述:
    //
    // 创建标识: Add By 吴建春 2008-06-25
    // 修改标识: Add By 钟治宇 //2008-12-4   添加了两个控件
    //-----------------------------------------------------------
%>

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

<%@ Register Src="control/PageBottom.ascx" TagName="PageBottom" TagPrefix="uc2" %>
<%@ Register Src="control/HiddenField.ascx" TagName="HiddenField" TagPrefix="uc1" %>
<%@ 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/css_list.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" />
    <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-zh.js"></script>
    <script type="text/javascript" language="javascript" src="Js/Calendar-Setup.js"></script>
    <script type="text/javascript" src="editor/fckeditor.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="【商品团购编辑】" />
                <asp:HyperLink ID="lkReturn" runat="server" Text="返回列表" />
            </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>
                            <td width="20%" height="30" align="right">
                                <asp:Label ID="Label1" runat="server" Text="团购名称："></asp:Label></td>
                            <td width="80%" align="left">
                                <asp:TextBox ID="txtName" runat="server" Width="300px" MaxLength="100" />
                                <span style="color: #ff0000">*</span>
                                <asp:RequiredFieldValidator ID="rfvName" runat="server" ErrorMessage="必须输入。" ControlToValidate="txtName"></asp:RequiredFieldValidator></td>
                        </tr>
                        <tr>
                            <td width="20%" height="30" align="right">
                                <asp:Label ID="Label2" runat="server" Text="大图："></asp:Label></td>
                            <td width="80%" align="left">
                                <V5:ImageBox ID="imgSrcDetail" runat="server" Text="选择图片" ShowSelect="true" BoxWidth="300px" />
                            </td>
                        </tr>
                        <tr>
                            <td width="20%" height="30" align="right">
                                <asp:Label ID="Label3" runat="server" Text="小图："></asp:Label></td>
                            <td width="80%" align="left">
                                <V5:ImageBox ID="imgSrcList" runat="server" Text="选择图片" ShowSelect="true" BoxWidth="300px" />
                            </td>
                        </tr>
                        <tr>
                            <td width="20%" height="30" align="right">
                                <V5:HelpCtrl ID="HelpCtrl6" runat="server" FontColor="red" Header="团购价格" HideSelects="False" ImageURL="images/help.gif" Text="用于前台显示。" />
                                <asp:Label ID="Label5" runat="server" Text="团购价："></asp:Label></td>
                            <td width="80%" align="left">
                                <V5:NumberBox ID="txtPrice" runat="server" Width="100px" />
                            </td>
                        </tr>
                        <tr>
                            <td width="20%" height="30" align="right">
                                <V5:HelpCtrl ID="HelpCtrl7" runat="server" FontColor="red" Header="市场价格" HideSelects="False" ImageURL="images/help.gif" Text="用于前台显示。" />
                                <asp:Label ID="Label14" runat="server" Text="市场价格："></asp:Label></td>
                            <td width="80%" align="left">
                                <V5:NumberBox ID="txtMarketPrice" runat="server" Width="100px" />
                            </td>
                        </tr>
                        <tr style="display: none;">
                            <td width="20%" height="30" align="right">
                                <asp:Label ID="Label13" runat="server" Text="是否关联商品："></asp:Label>
                            </td>
                            <td width="80%" align="left">
                                <asp:RadioButtonList ID="rblIsShowPic" runat="server" AutoPostBack="True" RepeatDirection="Horizontal" OnSelectedIndexChanged="rblIsShowPic_SelectedIndexChanged" CssClass="input2">
                                    <asp:ListItem Selected="True" Value="1">是</asp:ListItem>
                                    <asp:ListItem Value="0">否</asp:ListItem>
                                </asp:RadioButtonList></td>
                        </tr>
                        <tr>
                            <td width="20%" height="30" align="right">
                           <%-- //2008-12-4   添加了两个控件--%>
                                <asp:Label ID="Label19" runat="server" Style="position: relative" Text="团购商品类型："></asp:Label></td>
                            <td width="80%" align="left">
                                &nbsp;<asp:TextBox ID="txtSearchFitName" runat="server" Style="position: relative" Width="184px"></asp:TextBox>&nbsp;<asp:DropDownList
                                    ID="ddlCategoryIdFit" runat="server" Style="position: relative">
                                </asp:DropDownList>
                                <asp:Button ID="btnProduct" runat="server" CssClass="button" Text="查询" OnClick="btnProduct_Click" CausesValidation="False" />
                                <span style="color: #ff0000">*</span>&nbsp;
                                <asp:TextBox ID="txtProductName" runat="server" Width="160px" style="position: relative" Visible="False" /></td>
                        </tr>
                        <tr>
                            <td align="right" height="30" width="20%">
                                <V5:HelpCtrl ID="HelpCtrl8" runat="server" FontColor="red" Header="团购商品" HideSelects="true" ImageURL="images/help.gif" Text="团购商品,每个团购只能关联一个商品,列表中会显示查询出来的商品。" style="position: relative" />
                                <asp:Label ID="Label4" runat="server" Text="团购商品：" style="position: relative"></asp:Label></td>
                            <td align="left" width="80%">
                                <asp:DropDownList ID="ddlProduct" runat="server" style="position: relative">
                                    <asp:ListItem Value="-1">请选择</asp:ListItem>
                                </asp:DropDownList></td>
                        </tr>
                        <tr>
                            <td width="20%" height="30" align="right">
                                <V5:HelpCtrl ID="HelpCtrl9" runat="server" FontColor="red" Header="团购开始时间" HideSelects="False" ImageURL="images/help.gif" Text="团购在这个时间内开始。" />
                                <asp:Label ID="Label6" runat="server" Text="团购开始时间："></asp:Label></td>
                            <td width="80%" align="left">
                                <asp:TextBox ID="txtStartDate" runat="server"></asp:TextBox>
                                <img id="imgStartDate" alt="打开日历" src="images/calendar1.gif" title="打开日历" />
                                <span style="color: #ff0000">*</span>
                                <asp:RegularExpressionValidator ID="revStartDate" runat="server" ControlToValidate="txtStartDate" ErrorMessage="必须输入日期。" ValidationExpression="^((((1[6-9]|[2-9]\d)\d{2})-(0?[13578]|1[02])-(0?[1-9]|[12]\d|3[01]))|(((1[6-9]|[2-9]\d)\d{2})-(0?[13456789]|1[012])-(0?[1-9]|[12]\d|30))|(((1[6-9]|[2-9]\d)\d{2})-0?2-(0?[1-9]|1\d|2[0-8]))|(((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))-0?2-29-))$( (20|21|22|23|[0-1]?\d):[0-5]?\d:[0-5]?\d$)*" Display="Dynamic"></asp:RegularExpressionValidator></td>
                        </tr>
                        <tr>
                            <td width="20%" height="30" align="right">
                                <V5:HelpCtrl ID="HelpCtrl10" runat="server" FontColor="red" Header="团购结束时间" HideSelects="False" ImageURL="images/help.gif" Text="团购在这个时间内结束。" />
                                <asp:Label ID="Label10" runat="server" Text="团购结束时间："></asp:Label></td>
                            <td width="80%" align="left">
                                <asp:TextBox ID="txtEndDate" runat="server"></asp:TextBox>
                                <img id="imgEndDate" alt="打开日历" src="images/calendar1.gif" title="打开日历" />
                                <span style="color: #ff0000">*</span>
                                <asp:RegularExpressionValidator ID="revEndDate" runat="server" ControlToValidate="txtEndDate" ErrorMessage="必须输入日期。" ValidationExpression="^((((1[6-9]|[2-9]\d)\d{2})-(0?[13578]|1[02])-(0?[1-9]|[12]\d|3[01]))|(((1[6-9]|[2-9]\d)\d{2})-(0?[13456789]|1[012])-(0?[1-9]|[12]\d|30))|(((1[6-9]|[2-9]\d)\d{2})-0?2-(0?[1-9]|1\d|2[0-8]))|(((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))-0?2-29-))$( (20|21|22|23|[0-1]?\d):[0-5]?\d:[0-5]?\d$)*" Display="Dynamic"></asp:RegularExpressionValidator></td>
                        </tr>
                        <tr>
                            <td width="20%" height="30" align="right">
                                <V5:HelpCtrl ID="HelpCtrl1" runat="server" FontColor="red" Header="限购数量" HideSelects="False" ImageURL="images/help.gif" Text="此次团购一共出售商品的数量，售完为止。" />
                                <asp:Label ID="Label7" runat="server" Text="限购数量："></asp:Label></td>
                            <td width="80%" align="left">
                                <V5:NumberBox ID="txtStorage" runat="server" Width="80px" IsInt="True" />
                            </td>
                        </tr>
                        <tr>
                            <td width="20%" height="30" align="right">
                                <V5:HelpCtrl ID="HelpCtrl2" runat="server" FontColor="red" Header="每人限购数量" HideSelects="False" ImageURL="images/help.gif" Text="每人最多能买的商品数量。" />
                                <asp:Label ID="Label8" runat="server" Text="每人限购数量："></asp:Label></td>
                            <td width="80%" align="left">
                                <V5:NumberBox ID="txtMaxCount" runat="server" Width="80px" IsInt="True" />
                            </td>
                        </tr>
                        <tr>
                            <td width="20%" height="30" align="right">
                                <V5:HelpCtrl ID="HelpCtrl3" runat="server" FontColor="red" Header="保证金" HideSelects="False" ImageURL="images/help.gif" Text="参加团购需支付保证金。" />
                                <asp:Label ID="Label9" runat="server" Text="保证金："></asp:Label></td>
                            <td width="80%" align="left">
                                <V5:NumberBox ID="txtNeedPrice" runat="server" Width="80px" IsInt="false" />
                            </td>
                        </tr>
                        <tr>
                            <td width="20%" height="30" align="right">
                                <V5:HelpCtrl ID="HelpCtrl4" runat="server" FontColor="red" Header="赠送积分" HideSelects="False" ImageURL="images/help.gif" Text="参加团购赠送的积分。" />
                                <asp:Label ID="Label11" runat="server" Text="赠送积分："></asp:Label></td>
                            <td width="80%" align="left">
                                <V5:NumberBox ID="txtScore" runat="server" Width="80px" IsInt="true" />
                            </td>
                        </tr>
                        <tr>
                            <td width="20%" height="30" align="right">
                                <V5:HelpCtrl ID="HelpCtrl5" runat="server" FontColor="red" Header="价格阶梯" ImageURL="images/help.gif" Text="购买不同的数量享受不同的价格，可以添加价格阶梯，达到数量|享受价格分别表示当购买数量达一个数目后，就享受不同的价格。" />
                                <asp:Label ID="Label15" runat="server" Text="价格阶梯："></asp:Label></td>
                            <td width="80%" align="left">
                                <div id="content" style="border: 1px #cccccc solid; width: 647px">
                                    <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="CheckAll()" type="checkbox" />
                                        全选 &nbsp;&nbsp;
                                        <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>
                                        &nbsp;&nbsp;
                                        <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>
                                        &nbsp;&nbsp;
                                        <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><br />
                                        <asp:Label ID="Label18" runat="server" ForeColor="Red" Text="注意点：带*号的ID为临时ID，可能与数据库ID不相同，只有当所有内容都提交时才会生成实际数据。"></asp:Label>&nbsp;</div>
                                    <!-- 明细数据 -->
                                    <div class="listborder">
                                        <V5:V5ShopGridView ID="GridViewShow" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" CssClass="datalist" PageSize="5" 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="Count" HeaderText="达到数量" SortExpression="Count" />
                                                <asp:BoundField DataField="Price" HeaderText="享受价格" SortExpression="Price" />
                                            </Columns>
                                            <HeaderStyle CssClass="category" ForeColor="Black" />
                                        </V5:V5ShopGridView>
                                        &nbsp;</div>
                                    <asp:Panel ID="pnlOperate" runat="server" Visible="False" Width="400px" Height="18px">
                                        &nbsp;<asp:Label ID="Label16" runat="server" Text="购买数量达到"></asp:Label><V5:NumberBox ID="txtBuyCount" runat="server" Width="50px" IsInt="True" />
                                        <asp:Label ID="Label17" runat="server" Text="时，可享受的优惠价:"></asp:Label><V5:NumberBox ID="txtBuyPrice" runat="server" Width="50px" IsInt="false" />
                                        <asp:Button ID="btnSetPrice" runat="server" CssClass="button" Text="确定" CausesValidation="False" OnClick="btnSetPrice_Click" /></asp:Panel>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td width="20%" align="right">
                                <asp:Label ID="Label12" runat="server" Text="团购描述："></asp:Label></td>
                            <td width="80%" align="left">
                                <div style="padding:1px 10px 1px 1px">
                                <button id="btnSelectPicture" runat="server" class="button" style="vertical-align: middle; width: 72px; text-align: center" type="button">
                                    图片选择</button>
                                </div>
                                <V5:FCKeditor ID="txtContent" runat="server" Height="300px" Width="650px"></V5:FCKeditor></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" />
                                <br />
                            </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" />
            <V5:ActiveControl ID="ActCtrl" runat="server" />
        </div>
        <script language="javascript" type="text/javascript">
        Calendar.setup({
            inputField     :    "txtStartDate",
            ifFormat       :    "%Y-%m-%d", 
            button         :    "imgStartDate",
            align          :    "Br",
            singleClick    :    true
        });
        Calendar.setup({
            inputField     :    "txtEndDate",
            ifFormat       :    "%Y-%m-%d", 
            button         :    "imgEndDate",
            align          :    "Br",
            singleClick    :    true
        });
        </script>
    </form>
    <script type="text/javascript">
    //加TABLE样式
    InitTrClass();
    </script>
</body>
</html>
