<%@ page language="C#" autoeventwireup="true" inherits="ECMe_Product_AddProduct, ECMe_Deploy" validaterequest="false" %>

<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>
<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<%@ Register Src="../WebUserControl/Product_Parameter.ascx" TagName="Product_Parameter"
    TagPrefix="uc1" %>
<%@ Register Src="../WebUserControl/Product_Specification.ascx" TagName="Product_Specification"
    TagPrefix="uc2" %>
<%@ Register Src="../WebUserControl/Product_UploadImages.ascx" TagName="Product_UploadImages"
    TagPrefix="uc3" %>
<%@ Register Src="../WebUserControl/Product_Related.ascx" TagName="Product_Related"
    TagPrefix="uc4" %>
<%@ Register Src="../WebUserControl/Product_Privilege.ascx" TagName="Product_Privilege"
    TagPrefix="uc5" %>
<%@ Register Src="../WebUserControl/AjaxModal.ascx" TagName="AjaxModal" TagPrefix="uc6" %>
<%@ Register Src="../WebUserControl/Product_MemberPrice.ascx" TagName="Product_MemberPrice"
    TagPrefix="uc7" %>
<!-- Put IE into quirks mode -->
<!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/Admin/CSS/ECMe.css" rel="stylesheet" type="text/css" />
    <link href="../CSS/Admin/CSS/body63.css" rel="stylesheet" type="text/css" />
    <link href="../CSS/Admin/CSS/AdminIndex.css" rel="stylesheet" type="text/css" />
    <link href="../CSS/Admin/CSS/volti.css" rel="stylesheet" type="text/css" />
    <link href="../JS/DatePicker/datePicker.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../JS/jquery.js"></script>
    <script type="text/javascript" src="../JS/Common.js"></script>
    <script type="text/javascript" src="../JS/FileUpload/FileUpload.js"></script>
    <script type="text/javascript" src="../JS/DatePicker/date.js"></script>
    <script type="text/javascript" src="../JS/DatePicker/jquery.datePicker.js"></script>
    <script type="text/javascript">
        function SetTag(TagName) {
            if (document.getElementById("TProductTag").value == "") {
                document.getElementById("TProductTag").value = TagName;
            }
            else {
                document.getElementById("TProductTag").value += "," + TagName;
            }
        }
        $(function () {
            Date.firstDayOfWeek = 0;
            Date.format = 'yyyy-mm-dd';
            $('.top_date').datePicker({ clickInput: true, startDate: '2010-01-01' });
        });
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManagerPage" runat="server">
    </asp:ScriptManager>
    <asp:UpdateProgress ID="UpdateProgressPage" runat="server">
        <ProgressTemplate>
            <uc6:AjaxModal ID="UCAjaxModal" runat="server" />
        </ProgressTemplate>
    </asp:UpdateProgress>
    <asp:RequiredFieldValidator ID="RFV_TProductName" runat="server" ErrorMessage="商品名称不能为空"
        ControlToValidate="TProductName" Display="None"></asp:RequiredFieldValidator>
    <asp:RequiredFieldValidator ID="RFV_TProductPrice" runat="server" ErrorMessage="商品单价不能为空"
        ControlToValidate="TProductPrice" Display="None"></asp:RequiredFieldValidator>
    <asp:RequiredFieldValidator ID="RFV_TProductMarketPrice" runat="server" ErrorMessage="商品市场价不能为空"
        ControlToValidate="TProductMarketPrice" Display="None"></asp:RequiredFieldValidator>
    <asp:RequiredFieldValidator ID="RFV_TProductCostPeice" runat="server" ErrorMessage="商品成本价不能为空"
        ControlToValidate="TProductCostPeice" Display="None"></asp:RequiredFieldValidator>
    <asp:RequiredFieldValidator ID="RFV_TProductHeft" runat="server" ErrorMessage="商品重量不能为空"
        ControlToValidate="TProductHeft" Display="None"></asp:RequiredFieldValidator>
    <asp:RequiredFieldValidator ID="RFV_TProductStock" runat="server" ErrorMessage="商品库存不能为空"
        ControlToValidate="TProductStock" Display="None"></asp:RequiredFieldValidator>
    <asp:RegularExpressionValidator ID="REV_TProductPrice" runat="server" ErrorMessage="商品价格格式不对"
        ValidationExpression="^[0-9]+(.[0-9]{1,4})?$" ControlToValidate="TProductPrice"
        Display="None"></asp:RegularExpressionValidator>
    <asp:RegularExpressionValidator ID="REV_TProductMarketPrice" runat="server" ErrorMessage="商品市场价格格式不对"
        ValidationExpression="^[0-9]+(.[0-9]{1,4})?$" ControlToValidate="TProductMarketPrice"
        Display="None"></asp:RegularExpressionValidator>
    <asp:RegularExpressionValidator ID="REV_TProductCostPeice" runat="server" ErrorMessage="商品成本价格格式不对"
        ValidationExpression="^[0-9]+(.[0-9]{1,4})?$" ControlToValidate="TProductCostPeice"
        Display="None"></asp:RegularExpressionValidator>
    <asp:RegularExpressionValidator ID="REV_TProductHeft" runat="server" ErrorMessage="商品重量格式不对"
        ValidationExpression="^[0-9]+(.[0-9]{1,4})?$" ControlToValidate="TProductHeft"
        Display="None"></asp:RegularExpressionValidator>
    <asp:RegularExpressionValidator ID="REV_TProductStock" runat="server" ErrorMessage="商品库存格式不对"
        ValidationExpression="^\d+$" ControlToValidate="TProductStock" Display="None"></asp:RegularExpressionValidator>
    <div class="header">
        <div class="aj">
            <ul>
                <li id="two1" onclick="setTab('two',1,6)" class="hover" style="cursor: pointer">基本信息</li>
                <li id="two2" onclick="setTab('two',2,6)" style="cursor: pointer">商品规格</li>
                <li id="two3" onclick="setTab('two',3,6)" style="cursor: pointer">商品图片</li>
                <li id="two4" onclick="setTab('two',4,6)" style="cursor: pointer">促销活动</li>
                <li id="two5" onclick="setTab('two',5,6)" style="cursor: pointer">相关商品</li>
                <li id="two6" onclick="setTab('two',6,6)" style="cursor: pointer">商品参数</li>
            </ul>
        </div>
    </div>
    <div class="container">
        <div id="con_two_1">
            <div class="title">
                商品的基本信息</div>
            <asp:ValidationSummary ID="MainValidationSummary" DisplayMode="List" CssClass="error"
                runat="server" />
            <div class="all_1">
                <table border="0" cellspacing="0" cellpadding="0" style="width: 100%">
                    <tr>
                        <td valign="top" class="line" style="width: 225px">
                            <div class="left_img">
                                <div class="img">
                                    <asp:Image ID="IProductImage" ImageUrl="~/Images/CommonImage/defaultImg200.jpg" Width="200px"
                                        Height="200px" runat="server" />
                                </div>
                                <asp:FileUpload ID="FProductImage" Width="200px" CssClass="ty" runat="server" />
                                <div class="txte">
                                    <img src="../CSS/Admin/images/help.png" alt=" " width="10" height="10" />
                                    上传商品主图提交后便可查看上传的商品图片。上传商品图片格式包括JPG、GIF、PNG等。</div>
                            </div>
                        </td>
                        <td valign="top">
                            <div class="right">
                                <table width="100%" border="0" cellpadding="0" cellspacing="0" class="ADDGood_table_1">
                                    <tr>
                                        <th style="width: 70px">
                                            商品名称：
                                        </th>
                                        <td>
                                            <div>
                                                <asp:TextBox ID="TProductName" CssClass="input_1" Width="270px" runat="server"></asp:TextBox>
                                                <a href='javascript:ShowHide("SetProductSubtitle")' class="blue">添加副标题</a>
                                            </div>
                                            <div id="SetProductSubtitle" style="display: none">
                                                <asp:TextBox ID="TProductSubtitle" CssClass="input_2" Width="120px" runat="server"></asp:TextBox>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <th>
                                            商品货号：
                                        </th>
                                        <td>
                                            <asp:TextBox ID="TProductNumber" CssClass="input_1" Width="270px" runat="server"></asp:TextBox>
                                            <img src="../CSS/Admin/images/help.png" alt=" " width="10" height="10" />
                                            货号不能重复
                                            <asp:Button ID="BCheckProductNumber" CssClass="button_1" runat="server" Text="检查重复"
                                                OnClick="BCheckProductNumber_Click" />
                                        </td>
                                    </tr>
                                </table>
                                <asp:UpdatePanel ID="UpdatePanelProduct" runat="server" UpdateMode="Conditional">
                                    <ContentTemplate>
                                        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="ADDGood_table_1">
                                            <tr>
                                                <th style="width: 70px">
                                                    商品分类：
                                                </th>
                                                <td>
                                                    <div>
                                                        <asp:DropDownList ID="DCategoryID" Height="20px" Width="140px" CssClass="input_3"
                                                            runat="server" AutoPostBack="True" OnSelectedIndexChanged="DCategoryID_SelectedIndexChanged">
                                                        </asp:DropDownList>
                                                        <a href='javascript:ShowHide("SpeedAddCategory")' class="blue">添加分类</a>
                                                    </div>
                                                    <div id="SpeedAddCategory" style="display: none">
                                                        <asp:TextBox ID="TCategoryName" CssClass="input_2" Width="145px" runat="server"></asp:TextBox>
                                                        <asp:Button ID="BAddCategory" runat="server" CssClass="button_1" Text="添加" OnClick="BAddCategory_Click" />
                                                    </div>
                                                </td>
                                            </tr>
                                            <asp:Literal ID="LCategoryFilter" runat="server"></asp:Literal>
                                        </table>
                                        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="ADDGood_table_1">
                                            <tr>
                                                <th style="width: 70px">
                                                    &nbsp;
                                                </th>
                                                <td>
                                                    <div class="filter">
                                                        <h3>
                                                            <strong>扩展分类：</strong>
                                                            <asp:DropDownList ID="DOtherCategorys" Height="20px" Width="130px" CssClass="input_3"
                                                                runat="server">
                                                            </asp:DropDownList>
                                                            <asp:Button ID="BAddOtherCategorys" runat="server" CssClass="button_1" Text="添加"
                                                                OnClick="BAddOtherCategorys_Click" />
                                                        </h3>
                                                        <table border="0" cellspacing="0" cellpadding="0" class="filter_table">
                                                            <asp:Literal ID="LOtherCategorys" runat="server"></asp:Literal>
                                                        </table>
                                                    </div>
                                                </td>
                                            </tr>
                                        </table>
                                    </ContentTemplate>
                                </asp:UpdatePanel>
                                <asp:UpdatePanel ID="UpdatePanelMemberPrice" runat="server" UpdateMode="Conditional">
                                    <ContentTemplate>
                                        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="ADDGood_table_1">
                                            <tr>
                                                <th style="width: 70px">
                                                    关键字：
                                                </th>
                                                <td>
                                                    <asp:TextBox ID="TProductTag" CssClass="input_3" Width="192px" runat="server"></asp:TextBox>
                                                    <asp:DropDownList ID="DProductTag" Height="20px" Width="70px" onchange="SetTag(document.getElementById('DProductTag').value)"
                                                        runat="server">
                                                    </asp:DropDownList>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>
                                                    商品重量：
                                                </th>
                                                <td>
                                                    <span class="kd">
                                                        <asp:TextBox ID="TProductHeft" CssClass="input_3" Width="68px" Text="0" runat="server"></asp:TextBox>
                                                        克/g</span><span class="kd">单位名称：
                                                            <asp:DropDownList ID="DProductMeasure" Width="65px" Height="20px" runat="server">
                                                            </asp:DropDownList>
                                                        </span>
                                                    <img src="../CSS/Admin/images/help.png" alt=" " width="10" height="10" />
                                                    需要更多的单位请 <a href="ProductMeasureList.aspx" class="blue">添加单位</a>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>
                                                    商品价格：
                                                </th>
                                                <td>
                                                    <span class="kd">
                                                        <asp:TextBox ID="TProductPrice" CssClass="input_3" Text="0" Width="68px" runat="server"></asp:TextBox>
                                                        <asp:Button ID="BCreateMemberPrice" CssClass="button_1" Width="50px" runat="server"
                                                            Text="会员价" OnClick="BCreateMemberPrice_Click" /></span><span class="kd">库存数量：
                                                                <asp:TextBox ID="TProductStock" CssClass="input_3" Text="0" Width="65px" runat="server"></asp:TextBox>
                                                            </span>
                                                </td>
                                            </tr>
                                        </table>
                                        <uc7:Product_MemberPrice ID="UCProduct_MemberPrice" runat="server" />
                                    </ContentTemplate>
                                </asp:UpdatePanel>
                                <table width="100%" border="0" cellpadding="0" cellspacing="0" class="ADDGood_table_1">
                                    <tr>
                                        <th style="width: 70px">
                                            市场价：
                                        </th>
                                        <td>
                                            <span class="kd">
                                                <asp:TextBox ID="TProductMarketPrice" CssClass="input_3" Text="0" Width="68px" runat="server"></asp:TextBox>
                                            </span><span class="kd">成本价格：
                                                <asp:TextBox ID="TProductCostPeice" Text="0" CssClass="input_3" Width="65px" runat="server"></asp:TextBox>
                                            </span>
                                            <img src="../CSS/Admin/images/help.png" alt=" " width="10" height="10" />
                                            前台一般不显示，计算利润使用
                                        </td>
                                    </tr>
                                    <tr>
                                        <th>
                                            商品简介：
                                        </th>
                                        <td>
                                            <asp:TextBox ID="TProductSummarize" TextMode="MultiLine" CssClass="textarea_ys" Width="100%"
                                                Height="40px" runat="server"></asp:TextBox>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </td>
                    </tr>
                </table>
            </div>
            <div class="title">
                详细介绍</div>
            <div class="all_1">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td class="all">
                            <div class="title_1">
                                <asp:UpdatePanel ID="UpdatePanelSelectRemark" runat="server" UpdateMode="Conditional">
                                    <ContentTemplate>
                                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                            <tr>
                                                <td>
                                                    <asp:Repeater ID="RepeaterTable" runat="server" OnItemCommand="RepeaterTable_ItemCommand">
                                                        <ItemTemplate>
                                                            <span class="Fast_group">
                                                                <div class="del">
                                                                    <span>
                                                                        <asp:ImageButton ID="IDeleteRemarkTemplate" ImageUrl="~/ECMe/CSS/Admin/images/web_del_off.gif"
                                                                            CommandName="Delete" CommandArgument='<%# Eval("ID") %>' CausesValidation="false"
                                                                            ToolTip="删除模板" OnClientClick="return confirm('你真的要删除?');" runat="server" />
                                                                    </span>
                                                                </div>
                                                                <div class="fast_txte">
                                                                    <asp:LinkButton ID="LSelectRemarkTemplate" CommandName="Select" CommandArgument='<%# Eval("ID") %>'
                                                                        CausesValidation="false" CssClass="blue" runat="server"><%# Eval("Name") %></asp:LinkButton>
                                                                </div>
                                                            </span>
                                                        </ItemTemplate>
                                                    </asp:Repeater>
                                                </td>
                                                <td align="right" style="width: 270px">
                                                    <asp:Button ID="BAddRemarkTemplate" CssClass="button_1" runat="server" Text="添加为模板"
                                                        OnClick="BAddRemarkTemplate_Click" />
                                                </td>
                                            </tr>
                                        </table>
                                    </ContentTemplate>
                                </asp:UpdatePanel>
                            </div>
                            <asp:UpdatePanel ID="UpdatePanelReamk" runat="server" UpdateMode="Conditional">
                                <ContentTemplate>
                                    <FCKeditorV2:FCKeditor ID="FProductContent" Width="100%" Height="300px" runat="server">
                                    </FCKeditorV2:FCKeditor>
                                </ContentTemplate>
                            </asp:UpdatePanel>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
        <div id="con_two_2" style="display: none">
            <div class="title">
                商品规格信息</div>
            <div class="all_1">
                <uc2:Product_Specification ID="UCProduct_Specification" runat="server" />
            </div>
        </div>
        <div id="con_two_3" style="display: none">
            <uc3:Product_UploadImages ID="UCProduct_UploadImages" runat="server" />
        </div>
        <div id="con_two_4" style="display: none">
            <div class="title">
                促销设置</div>
            <div class="all_1">
                <uc5:Product_Privilege ID="UCProduct_Privilege" runat="server" />
            </div>
        </div>
        <div id="con_two_5" style="display: none">
            <uc4:Product_Related ID="UCProduct_Related" runat="server" />
        </div>
        <div id="con_two_6" style="display: none">
            <div class="title">
                商品参数信息</div>
            <div class="all_1">
                <uc1:Product_Parameter ID="UCProduct_Parameter" runat="server" />
            </div>
        </div>
    </div>
    <div class="footer">
        <div class="footer_button">
            <asp:Button ID="BSubmit" runat="server" CssClass="footer_but" Text="保存当前操作" OnClick="BSubmit_Click" />
        </div>
    </div>
    </form>
</body>
</html>
