<%@ control language="C#" autoeventwireup="true" inherits="UserControl_SelectParameter, ShopWe" %>
<%@ 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 Clear()
{
var div=document.getElementById("ParameterGroupDiv");
div.innerHTML="";
}

function AddGroup(GroupName)
{
   
   var ObjID=generateMixed(10);
   document.getElementById("ParameterGroupDiv").innerHTML+="<div id=\"GroupItem"+ObjID+"\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"tle_ys\"><tr>"+
                      "<td style=\"width:120px\" class=\"bg_2\">"+GroupName+"</td><td id=\"Group"+ObjID+"\"></td><td style=\"width: 100px\" class=\"bg_4\">"+
                      "<p><img src=\"../css/images/add_img.gif\" alt=\"添加\" /><a href='javascript:AddItem(\"Group"+ObjID+"\",\""+GroupName+"\")' class=\"grey\">添加参数</a></p>"+
                      "<p><img src=\"../css/images/del_imgred.gif\" alt=\"删除该组\" width=\"14\" height=\"10\" /><a href='javascript:Delete(\"GroupItem"+ObjID+"\")' class=\"grey\">删除该组</a></p></td></tr></table></div>";
                      
   AddItem("Group"+ObjID,GroupName);
}
function AddItem(GroupID,GroupName)
{
   var ObjID=generateMixed(10);
   var ShowDiv=document.getElementById(GroupID).innerHTML+="<table id=\"Item"+ObjID+"\" width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"+
                      "<tr>"+
                      "<td class=\"bg_1\" style=\"width: 160px\"> <input name=\"Name\" value=\"请输入参数名\"  style=\"width: 140px\" class=\"input\"/></td>"+
                      "<td class=\"bg_1\" style=\"width: 260px\"> <input name=\"value\" value=\"请输入参数值\" style=\"width: 250px\" class=\"input\" /></td>"+
                      "<td>&nbsp;<img src=\"../css/images/del_imgred.gif\" alt=\"删除\" width=\"14\" height=\"10\" /><a href='javascript:Delete(\"Item"+ObjID+"\")' class=\"grey\">删除</a></td>"+
                      "</tr><input name=\"group\" type=\"hidden\" value="+GroupName+" /></table>";
}
</script>

<asp:UpdatePanel ID="UpdatePanelParemeter" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
        <div class="come_title_3">
            <table width="100%" height="30" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td>
                        <h2>
                            参数组名</h2>
                        <input id="ParameterGroupName" style="height: 18px" class="input" />
                        <input type="button" value="添加一个参数组" class="butt_tle" onclick="AddGroup(document.getElementById('ParameterGroupName').value)"
                            style="height: 20px; width: 110px" />
                        <input type="button" value="全部清空" class="butt_tle" onclick="javascript:Clear()" style="height: 20px;
                            width: 70px" />
                    </td>
                    <td>
                        <asp:TextBox ID="SelectGroupName" runat="server" CssClass="input" Width="150" Height="18"
                            Text="添加快速选择组" MaxLength="7"></asp:TextBox>
                        <asp:Button ID="AddGroup" runat="server" CssClass="butt_tle" Height="20px" Width="120px"
                            CausesValidation="false" Text="添加到快速选择组" OnClick="AddGroup_Click" />
                    </td>
                </tr>
            </table>
        </div>
        <div class="k_all1">
            <asp:Repeater ID="RepeaterSelectGroup" runat="server" OnItemCommand="RepeaterSelectGroup_ItemCommand">
                <ItemTemplate>
                    <div class="Template2_button">
                        <asp:ImageButton ID="DeleteGroup" runat="server" ImageUrl="~/Admin/css/images/del_imgred.gif"
                            CommandName="Delete" CommandArgument='<%# Eval("File") %>' CausesValidation="false"
                            ToolTip="删除" OnClientClick="return confirm('你真的要删除?');" /><asp:LinkButton ID="LinkButtonSelectGroup"
                                runat="server" CssClass="blue" CommandName="Select" CommandArgument='<%# Eval("File") %>'
                                CausesValidation="false"><%# Eval("Name") %></asp:LinkButton>
                    </div>
                    <!--<img src="../css/images/bj.png" alt="导出" />
                <a href='../xml/Attribute/<%# Eval("File")%>' class="grey" target="_blank">导出</a>-->
                </ItemTemplate>
            </asp:Repeater>
        </div>
    </ContentTemplate>
</asp:UpdatePanel>
<div id="ParameterGroupDiv" class="k_all6">
    <table width="100%" cellpadding="0" cellspacing="0" id="bk_3">
        <tr>
            <th style="width: 104px">
                参数组名
            </th>
            <th>
                主要参数
            </th>
            <th style="width: 84px">
                操作
            </th>
        </tr>
    </table>
    <asp:UpdatePanel ID="UpdatePanelParemeterBody" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <asp:Literal ID="LiteralParameter" runat="server"></asp:Literal>
        </ContentTemplate>
    </asp:UpdatePanel>
</div>
