<%@ control language="C#" autoeventwireup="true" inherits="ECMe_WebUserControl_Product_Specification, ECMe_Deploy" %>
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>
<script type="text/javascript">
    //添加规格值
    function AddSpecification(ID, Value, GroupName) {
        var ObjID = generateMixed(10);
        document.getElementById(ID).innerHTML += "<li id=\"" + ObjID + "\"><span class=\"tle_withe_closs\"><a href=\"#\"><img src=\"../CSS/Admin/images/dell.jpg\" onclick='Delete(\"" + ObjID + "\")' alt=\"删除\"/>" +
    "</a></span><span class=\"tle_withe\"><input name=\"SpecificationValue\" type=\"text\" value=\"" + Value + "\" class=\"input_1\" /></span><span class=\"tle_witheouit\">" +
        "<input name=\"SpecificationImage\" type=\"file\" class=\"ty\" style=\"width: 300\" size=\"28\" /></span>" +
        "<input name=\"GroupName\" type=\"hidden\" value=\"" + GroupName + "\" /></li>";
    }

    //清空规格值
    function ClearSpecification(ID) {
        document.getElementById(ID).innerHTML = "<li class=\"tle_top\"><span class=\"tle_withe_closs\">相关操作</span><span class=\"tle_withe\">规格值</span><span class=\"tle_witheouit\">规格图片(可选)</span></li>";

    }

</script>
<asp:RequiredFieldValidator ID="RFV_TAssembleStock" runat="server" ErrorMessage="规格库存不能为空"
    ControlToValidate="TAssembleStock" Display="None"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="REV_TAssembleStock" runat="server" ErrorMessage="规格库存格式不对"
    ValidationExpression="^\d+$" ControlToValidate="TAssembleStock" Display="None"></asp:RegularExpressionValidator>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
        <td class="all">
            <asp:UpdatePanel ID="UpdatePanelSpecification" runat="server" UpdateMode="Conditional">
                <ContentTemplate>
                    <div class="title_1">
                        <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">
                                                    <asp:ImageButton ID="IDeleteItem" OnClientClick="return confirm('你真的要删除?');" CommandName="Delete"
                                                        CommandArgument='<%# Eval("File") %>' CausesValidation="false" ImageUrl="~/ECMe/CSS/Admin/images/web_del_on.gif"
                                                        runat="server" />
                                                </div>
                                                <div class="fast_txte">
                                                    <asp:LinkButton ID="LSelectItem" CommandName='<%# Eval("Name") %>' CausesValidation="false"
                                                        CommandArgument='<%# Eval("File") %>' CssClass="blue" runat="server"> <%# Eval("Name") %></asp:LinkButton>
                                                </div>
                                            </span>
                                        </ItemTemplate>
                                    </asp:Repeater>
                                    <a href="AddProductSpecification.aspx" target="_blank" class="top_but">增加规格项</a>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <asp:Literal ID="LiteralItem" runat="server"></asp:Literal>
                </ContentTemplate>
            </asp:UpdatePanel>
        </td>
    </tr>
    <tr>
        <td class="all">
            <asp:UpdatePanel ID="UpdatePanelAssemble" runat="server" UpdateMode="Conditional">
                <ContentTemplate>
                    <div class="Fast_group_all">
                        <div class="title_1">
                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td align="left" style="width: 65px; font-size: 12px">
                                        默认库存：
                                    </td>
                                    <td align="left">
                                        <asp:TextBox ID="TAssembleStock" CssClass="input_3" Text="0" runat="server"></asp:TextBox>
                                        <asp:Button ID="BAssemble" runat="server" CssClass="button_1"
                                            Text="生成商品" OnClick="BAssemble_Click" />
                                    </td>
                                    <td align="right" style="width: 150px">
                                        <asp:Button ID="BAssembleClear" runat="server" CssClass="button_1" CausesValidation="false"
                                            Text="清空规格" OnClick="BAssembleClear_Click" />
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <div class="Fast_group_labe">
                            <table border="0" cellspacing="0" cellpadding="0" class="Fast_group_table">
                                <tr>
                                    <th style="width: 80px">
                                        搭配值
                                    </th>
                                    <th style="width: 180px">
                                        商品货号
                                    </th>
                                    <th>
                                        库存
                                    </th>
                                </tr>
                                <asp:Repeater ID="RepeaterItem" runat="server">
                                    <ItemTemplate>
                                        <tr>
                                            <td>
                                                <asp:Localize ID="LValue" Text='<%#Eval("AssembleValue") %>' runat="server"></asp:Localize>
                                            </td>
                                            <td>
                                                <asp:TextBox ID="TNumber" runat="server" CssClass="input_3" Text='<%#Eval("ProductNumber") %>'></asp:TextBox>
                                            </td>
                                            <td>
                                                <asp:TextBox ID="TStock" runat="server" CssClass="input_3" Text='<%#Eval("Stock") %>'></asp:TextBox>
                                            </td>
                                        </tr>
                                    </ItemTemplate>
                                </asp:Repeater>
                            </table>
                        </div>
                    </div>
                </ContentTemplate>
            </asp:UpdatePanel>
        </td>
    </tr>
</table>
