<%@ page language="C#" autoeventwireup="true" inherits="V5Shop.Admin.Promotions_Binding_Operate, V5Shop.Shop.Promotions" enableviewstatemac="false" enableEventValidation="false" viewStateEncryptionMode="Never" %>

<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>
<%@ Register Src="control/HiddenField.ascx" TagName="HiddenField" TagPrefix="uc1" %>
<%@ Register Src="control/PageBottom.ascx" TagName="PageBottom" TagPrefix="uc2" %>
<%@ Register Assembly="V5Shop.Control" Namespace="V5Shop.Control" TagPrefix="V5Shop" %>
<!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 id="Head1" 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>
    <script type="text/javascript">
    function checkisnumber(strvalue)
    {
        if(isNaN(strvalue))
        {
            alert("只能为数字");
            return false;
        }
    }

    //打开模式对话框（图片选择）
    function OpenDialogPage(){
        if (navigator.appVersion.indexOf("MSIE") == -1){
            this.returnAction=function(strResult){
                if(strResult!=null){
                    var oEditor = FCKeditorAPI.GetInstance('txtContent'); 
                    oEditor.InsertHtml(GetValue) 
                }
            }
            window.open('Picture_Picture_Manage_Dialog.aspx?d=' + Date(),'newWin','modal=yes,width=620,height=620,top=200,left=300,resizable=no,scrollbars=no');
            return;
        }else{
            var GetValue = showModalDialog('Picture_Picture_Manage_Dialog.aspx?d=' + Date(),'','dialogWidth:620px;dialogHeight:620px;')
            if (GetValue != null) {
                var oEditor = FCKeditorAPI.GetInstance('txtContent'); 
                    oEditor.InsertHtml("<img src='<%=BaseConfigPath %>" + GetValue + "'>");
            } 
        }
    }
    </script>

    <script type="text/javascript" language="javascript" src="js/Common.js"></script>

    <style type="text/css">
    .abcd tr td{ border-width:0px}
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager runat="server" ID="scriptManager"></asp:ScriptManager>
        <div>
    <div class="OperateTitle">
        <div>
            <asp:Label ID="lblTitleAdd" runat="server" Text="【 捆绑销售产品添加 】"></asp:Label> 
            <asp:Label ID="lblTitleEdit" runat="server" Text="【 捆绑销售产品编辑 】" Visible="false"></asp:Label> 
            <a href="Promotions_Binding_Manage.aspx" title="捆绑销售产品维护列表">返回列表</a>
        </div>
    </div>
     <%--<asp:UpdatePanel ID="UpdatePanel2" runat="server" ChildrenAsTriggers="true" UpdateMode="Conditional">
      <ContentTemplate>--%>
       <div style="margin: 20px 0;">
            <div class="listborder" >
            <V5Shop:V5ShopGridView ID="GridViewShow" runat="server" OnRowDeleting="GridViewShow_RowDeleting" DataKeyNames="ProductID"
                AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" CssClass="datalist" 
                HeaderStyle-Height="28px" PageSize="10" HeaderStyle-ForeColor="#000" EmptyDataText="没有查询到任何记录" TableName="Notice">
        	    <rowstyle height="28px" HorizontalAlign="Center"></rowstyle>
                <Columns>
                    <asp:TemplateField ItemStyle-Width="10%">
                        <ItemTemplate>
                            <input class="checkbox" runat="server" Value='<%# Eval("ProductID") %>' ID="CheckBoxID" type="checkbox" onmouseover="this.mouse='over'" onmouseout="this.mouse='out'" mouse="out">
                        </ItemTemplate>
                        <itemstyle horizontalalign="Center"  />
                    </asp:TemplateField>
                    <asp:BoundField DataField="ProductName" SortExpression="ProductName" HeaderText="产品名称" ItemStyle-Width="40%"/>
                    <asp:BoundField DataField="ProductCount" SortExpression="ProductCount" HeaderText="产品数量" ItemStyle-Width="10%"/>
                    <asp:BoundField DataField="CreationDate" SortExpression="CreationDate" DataFormatString="{0:yyyy-MM-dd}" HeaderText="创建日期" ItemStyle-Width="20%"/>
                    <asp:CommandField DeleteText="删除" ShowDeleteButton="true" />
                </Columns>
            </V5Shop:V5ShopGridView>
            <br />
            <div style="background:#f1f1f1; text-align:center; padding:20px 0">
            <table width="800" border="0" align="center" cellpadding="0" cellspacing="0" style="background:#FFFFFF; border:solid 1px #EEEEEE">
                <tr>
                    <td height="30" align="right" style="border-width:0px">
                        <asp:Label ID="Label19" runat="server" Style="position: relative" Text="捆绑商品类型："></asp:Label>
                    </td>
                    <td align="left" style="border-width:0px">
                        <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="btnProductSearch" runat="server" CssClass="button" Text="查询" OnClick="btnProductSearch_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%" style="border-width:0px">
                        <asp:Label ID="Label4" runat="server" Text="捆绑商品：" style="position: relative"></asp:Label></td>
                    <td align="left" width="80%" style="border-width:0px">
                        <asp:DropDownList ID="ddlProduct" runat="server" style="position: relative" ValidationGroup="InsertProduct">
                            <asp:ListItem Value="-1">请选择</asp:ListItem>
                        </asp:DropDownList>
                        <span class="NeedMsg">*</span>
                        <asp:RequiredFieldValidator runat="server" ID="rfvProduct" ControlToValidate="ddlProduct" Text="请选择产品" InitialValue="-1" ValidationGroup="InsertProduct"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td height="30" align="right" style="border-width:0px">
                        <asp:Label ID="lblCount" runat="server" Text="数量："></asp:Label> 
                    </td>
                    <td align="left" style="border-width:0px">
                        <asp:TextBox ID="txtCount" runat="server" Width="300px"></asp:TextBox>
                        <span class="NeedMsg">*</span>
                        <asp:RangeValidator runat="server" ID="rvCount" ControlToValidate="txtCount" ErrorMessage="不能为空" MaximumValue="1000" MinimumValue="0" Type="Integer" ValidationGroup="InsertProduct"></asp:RangeValidator>
                        <asp:RequiredFieldValidator ID="rfvCount" ControlToValidate="txtCount" runat="server" ErrorMessage="不能为空" ValidationGroup="InsertProduct"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td width="20%" height="30" align="right" style="border-width:0px" >&nbsp;
                        
                    </td>
                    <td align="left" style="border-width:0px">
                        <asp:Button runat="server" ID="btnAddProduct" OnClick="btnAddProduct_Click" Text="添加" ValidationGroup="InsertProduct" />
                    </td>
                </tr>
            </table>
            </div>
            </div>
        </div>
        <div>
            <table id="OperateTable" width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                <tr>
                    <td height="30" align="right" style=" background:#F7F7F7; border-bottom:1px #EEEEEE solid; border-top:1px #EEEEEE solid">
                        <asp:Label ID="lblBindingName" runat="server" Text="捆绑商品名称："></asp:Label>  
                    </td>
                    <td align="left"  style=" background:#F7F7F7; border-bottom:1px #EEEEEE solid; border-top:1px #EEEEEE solid">
                        <asp:TextBox ID="txtBindingName" runat="server" Width="300px" MaxLength="50" ValidationGroup="Insert"></asp:TextBox> 
                        <span class="NeedMsg">*</span>
                        <asp:RequiredFieldValidator ID="rfvBindingName" ControlToValidate="txtBindingName" runat="server" ErrorMessage="不能为空" ValidationGroup="Insert"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td height="30" align="right">
                        <asp:Label ID="lblUnit" runat="server" Text="捆绑商品单位："></asp:Label>  
                    </td>
                    <td align="left">
                        <asp:TextBox ID="txtUnit" runat="server" Width="300px" MaxLength="50" ValidationGroup="Insert"></asp:TextBox> 
                    </td>
                </tr>
                <tr>
                    <td height="30" align="right"  style=" background:#F7F7F7; border-bottom:1px #EEEEEE solid; border-top:1px #EEEEEE solid">
                        <asp:Label ID="lblContent" runat="server" Text="捆绑商品图片："></asp:Label>  
                    </td>
                    <td align="left"  style=" background:#F7F7F7; border-bottom:1px #EEEEEE solid; border-top:1px #EEEEEE solid">
                        <asp:TextBox ID="txtContent" runat="server" Width="300px" MaxLength="50"></asp:TextBox>
			            <input type="button" value="选择图片" onclick="OpenDialog('txtContent')" class="button" id="btnSelectSrcDetail" runat="server" />
                        <img src="" id="txtContentView" style="display: none;" /> 
                    </td>
                </tr>
                <tr>
                    <td height="30" align="right">
                        <asp:Label ID="lblContentDetail" runat="server" Text="捆绑商品描述："></asp:Label>  
                    </td>
                    <td align="left">
                        &nbsp;<input class="button" onclick="OpenDialogPage();" type="button" value="选择图片" /><br />
                        <V5Shop:FCKeditor ID="txtContentDetail" runat="server" Width="500px"></V5Shop:FCKeditor>
                    </td>
                </tr>
                <tr>
                    <td height="30" align="right"  style=" background:#F7F7F7; border-bottom:1px #EEEEEE solid; border-top:1px #EEEEEE solid">
                        <asp:Label ID="lblMarketPrice" runat="server" Text="市场价格："></asp:Label>  
                    </td>
                    <td align="left"  style=" background:#F7F7F7; border-bottom:1px #EEEEEE solid; border-top:1px #EEEEEE solid">
                        <asp:TextBox ID="txtMarketPrice" runat="server" Width="300px" MaxLength="50" ValidationGroup="Insert"></asp:TextBox> 
                        <span class="NeedMsg">*</span>
                        <asp:RequiredFieldValidator ID="rfvMarketPrice" ControlToValidate="txtMarketPrice" runat="server" ErrorMessage="不能为空" ValidationGroup="Insert"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td height="30" align="right">
                        <asp:Label ID="lblMemberPrice" runat="server" Text="会员价格："></asp:Label>  
                    </td>
                    <td align="left">
                        <asp:TextBox ID="txtMemberPrice" runat="server" Width="300px" MaxLength="50" ValidationGroup="Insert"></asp:TextBox> 
                        <span class="NeedMsg">*</span>
                        <asp:RequiredFieldValidator ID="rfvMemberPrice" ControlToValidate="txtMemberPrice" runat="server" ErrorMessage="不能为空" ValidationGroup="Insert"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td align="right" height="30" width="20%"  style=" background:#F7F7F7; border-bottom:1px #EEEEEE solid; border-top:1px #EEEEEE solid">
                        <asp:Label ID="lblOrderId" runat="server" Text="排序："></asp:Label>
                    </td>
                    <td align="left" style=" background:#F7F7F7; border-bottom:1px #EEEEEE solid; border-top:1px #EEEEEE solid">
                        <asp:TextBox ID="txtOrderId" runat="server" Width="100px"></asp:TextBox>
			<span class="NeedMsg">*</span>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" ControlToValidate="txtOrderId" runat="server" ErrorMessage="不能为空" ValidationGroup="Insert"></asp:RequiredFieldValidator>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ControlToValidate="txtOrderId"
                                    Display="Dynamic" ErrorMessage="只能为数字" ValidationExpression="^[\d]{0,9}"></asp:RegularExpressionValidator>
                    </td>
                </tr>
                <tr>
                    <td height="30" align="right">
                        <asp:Label ID="lblIsOnSale" runat="server" Text="是否上架销售："></asp:Label> 
                    </td>
                    <td align="left">
                        <asp:CheckBox runat="server" ID="cbIsOnSale" Text="上架" />
                    </td>
                </tr>
                <tr>
                    <td height="30" align="right"  style=" background:#F7F7F7; border-bottom:1px #EEEEEE solid; border-top:1px #EEEEEE solid">
                        <asp:Label ID="lblScore" runat="server" Text="产品积分："></asp:Label>  
                    </td>
                    <td align="left"  style=" background:#F7F7F7; border-bottom:1px #EEEEEE solid; border-top:1px #EEEEEE solid">
                        <asp:TextBox ID="txtScore" runat="server" Width="300px" MaxLength="50"></asp:TextBox>
			<span class="NeedMsg">*</span>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="txtScore" runat="server" ErrorMessage="不能为空" ValidationGroup="Insert"></asp:RequiredFieldValidator>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtScore"
                                    Display="Dynamic" ErrorMessage="只能为数字" ValidationExpression="^[\d]{0,9}"></asp:RegularExpressionValidator>
                    </td>
                </tr>
                <tr>
                    <td height="30" align="right"></td>
                    <td align="left">
                        <asp:Button ID="btnAdd" runat="server" Text="确定" OnClick="btnAdd_Click" class="button" ValidationGroup="Insert" />
                        <asp:Button ID="btnEdit" runat="server" Text="更新" OnClick="btnEdit_Click" Visible="False" class="button" ValidationGroup="Insert" />
                        <input id="iptReset" runat="server" type="reset" value="重置" class="button"/>    
                        <input id="Button3" runat="server" type="button" value="返回列表" onclick="window.location.href='Promotions_Binding_Manage.aspx'" class="button"/>    
                    </td>
                </tr>
            </table>  
            <script type="text/javascript">
            ////加TABLE样式
            //InitTrClass();
            ////加载日期控件
            //Calendar.setup({
            //    inputField     :    "txtExpireDate",
            //    ifFormat       :    "%Y-%m-%d", 
            //    button         :    "imgExpireDate",
            //    align          :    "Br",
            //    singleClick    :    true
            //});
            </script>
        </div>
        <uc2:PageBottom ID="PageBottom" runat="server" />
        <div id="hiddenfield">
            <asp:HiddenField ID="TheDate" runat="server" />
            <asp:HiddenField ID="TheUnionID" runat="server" />
            <asp:HiddenField ID="CheckedIDS" runat="server" Value="0" />
            <asp:HiddenField ID="PageIndex" runat="server" Value="0" />
            <asp:HiddenField ID="MaxPageIndex" runat="server" Value="0" />
            <asp:HiddenField ID="OldOrderStatus" runat="server" Value="0" />
            <uc1:HiddenField ID="Alert" runat="server" />
            <V5Shop:ActiveControl ID="ActiveControl" runat="server" />
        </div>
        <%--</ContentTemplate>
　  </asp:UpdatePanel>--%>
    </div>
    </form>
</body>
</html>
