<%@ page language="C#" masterpagefile="AdminIndexMaster.master" autoeventwireup="true" inherits="Admin_Admin_Lable, mallz" title="自定义标签管理" validaterequest="false" enableEventValidation="false" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script type="text/javascript">
    function runCode(id) {
        var obj=document.getElementById(id);
        var winname = window.open('', "_blank", '');
        winname.document.open('text/html', 'replace');
        winname.opener = null             // 防止代码对页面修改
        winname.document.write(obj.value);
        winname.document.close();
    }
    function SelectAll(x)
    {
        var obj = document.all(x);
        for(var i = 0; i<obj.length; i++ )
        {
            obj[i].checked = !(obj[i].checked);
        }
    }
</script>

   
   <table class="nick" cellpadding="1" cellspacing="1">
        <tr><td class="tit" colspan="3">标签管理</td></tr>
        <tr><td class="ltd" style="text-align:center"><a href="Admin_Lable.aspx">显示全部</a></td><td class="rtd"><asp:Literal ID="LableManage" runat="server" /></td>
            <td align="right"><asp:TextBox ID="Txtkeyword" runat="server" Width="200"/><asp:Button ID="Sreach" runat="server" Text=" 搜 索 " OnClick="Sreach_OnClick" /></td></tr>
   </table>
    <asp:GridView ID="GridView1" DataKeyNames="ID" runat="server" AllowPaging="True" AutoGenerateColumns="False"  
      CssClass="adminlist"  PageSize="15" OnDataBound="GridView1_DataBound" OnRowDataBound="GridView1_RowDataBound" OnPageIndexChanging="GridView1_PageIndexChanging">
        <Columns>
            <asp:TemplateField>
                <HeaderTemplate><a href="javascript:{SelectAll('IDs');}">编号</a></HeaderTemplate>
                <ItemTemplate>
                    <input value="<%# Eval("ID") %>" name="IDs" id="IDs" type="checkbox" />
                </ItemTemplate>
                <HeaderStyle Width="5%" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="名称" ItemStyle-HorizontalAlign="Left" ItemStyle-Font-Bold="true">
                <ItemTemplate>
                    <asp:LinkButton ID="butconedit" CommandName='<%# Eval("Name") %>' CommandArgument='<%# Eval("ID") %>' Text='<%# Eval("Name") %>' runat="server" OnCommand="GoConetent" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="Type" HeaderText="分类">
                <HeaderStyle Width="15%" />
            </asp:BoundField>
            <asp:BoundField DataField="UpdateTime" HeaderText="更新时间"  >
                <HeaderStyle Width="15%" />
            </asp:BoundField>
            <asp:TemplateField HeaderText="操作" >              
               <ItemTemplate >
                  <a href="Admin_Lable.aspx?action=updateLabel&id=<%# Eval("ID") %>"  <%# (Eval("OutPutType").ToString()!="static"?"style=\"display:none;\"":"" ) %>  >生成</a> 
                  <a href="Admin_AddLabel.aspx?action=modify&id=<%# Eval("ID") %>">修改</a> 
                  <asp:LinkButton ID="butcon" CommandName='<%# Eval("Name") %>' CommandArgument='<%# Eval("ID") %>' Text="内容" runat="server" OnCommand="GoConetent" /> 
                  <asp:LinkButton ID="CopyButton" runat="server"  Text="复制"  CommandName='<%# Eval("ID") %>' OnClientClick="return confirm('是否复制？')" OnCommand="CopyButton_OnCommodn" /> 
                  <asp:LinkButton ID="DeleteButton" runat="server" OnCommand="Delete_Click" CommandArgument='<%# Eval("ID") %>' Text="删除" OnClientClick="return confirm('是否删除本标签？')" />
               </ItemTemplate>
                <HeaderStyle Width="15%" />
            </asp:TemplateField>
        </Columns>          
    </asp:GridView>
    
    <div class="div_btm">
        <asp:Button ID="DeleteALL" runat="server" Text= "批量删除" OnClick="DeleteALL_OnClick" OnClientClick="return confirm('确定删除选定项吗？')" />
        <input onclick="javascript:{location.href='Admin_LabelIO.aspx';return false;}" type="button" value="导入导出" />
    </div>

</asp:Content>

