<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="TagList.aspx.vb" Inherits="Dingtai.Website.TagList1" %>
<%@ Register src="../../App_Data/Controls/PageControl.ascx" tagname="PageControl" tagprefix="uc1" %>

<!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>鼎太播客 &gt; 后台管理 &gt; 标签管理列表</title>
</head>
<body onload="setTableBg();">
    <form id="form1" runat="server">
    <div id="body">
        <div id="title">                
            <h5>您现在的位置：<a href="#" target="_self">后台管理</a> &gt; 标签管理列表</h5>
             <p><asp:LinkButton ID="LBAll" runat="server">所有</asp:LinkButton> | <asp:LinkButton ID="LinkButton1" runat="server">系统</asp:LinkButton> | <asp:LinkButton ID="LinkButton2" runat="server">数据集</asp:LinkButton> | <asp:LinkButton ID="LinkButton3" runat="server">字段值</asp:LinkButton> </p>        
              <asp:DropDownList ID="ddrTemp" runat="server" CssClass ="list" AutoPostBack="True"></asp:DropDownList>
        </div>
        <div id="box">
            <div id="an_box">
                <ul>
                 <li><a href ="TagAdd.aspx"><img alt="" src="/Skins/default/images/an_d0.gif" /></a></li>
                    <li><a href ="#" ><div class="qx" alt="全选" onclick="SelectAll();" /></a> </li>
                    <li><a href ="#" ><div class="fx" alt="反选"  onclick="Inverse();" /></a> </li>
                    <li><a href ="#" ><div class="dels" alt="批量删除" onclick="delMedias();"  /></a> </li>
                </ul>    
                 <div class="search_box">                    
                    <asp:TextBox ID="txtWhere"  CssClass ="wbk" runat="server"></asp:TextBox>
                    <asp:ImageButton ID="imgSumbit" runat="server" ImageUrl ="/Skins/default/images/yl_an.gif" /> 
                </div>
            </div> 
            <div class="body_box" id="body_box">
                <asp:Repeater ID="Repeater1" runat="server">
                   <HeaderTemplate >
                        <table id="t"  class="table_bg" onclick="clickto()" onmousemove="fmove()" onmouseout="fout()" >
                            <tr class="table_border">
                            <th>选择</th>
                            <th>标签ID</th>
                            <th>名 称</th>
                            <th>返回类型</th>
                            <th>所属模板</th>
                            <th>是否系统</th>
                            <th>创建时间</th>
                            <th>操作</th>
                            </tr>
                   </HeaderTemplate>
                   <ItemTemplate>                                  
                            <tr>
                            <td align ="center"><input type="checkbox" name="checkboxid" id="checkboxid" value="<%#Eval("ID") %>" /></td>
                            <td align ="center"><%#Eval("ID")%></td>    
                            <td align ="center"><%#Eval("Name")%></td>          
                            <td align ="center"><%#IIf(Eval("Type") = 0, "对象", IIf(Eval("Type") = 1, "字段值", "数据集"))%></td>
                            <td align ="center"><%#IIF(DingTai.BLL.Template.Provider.Templates.GetTemplateNameByID(Eval("TempID")) = "" ,"全局标签",DingTai.BLL.Template.Provider.Templates.GetTemplateNameByID(Eval("TempID")))%></td>
                          <td align ="center"><%#IIf(Eval("IsSys"), "是", "否")%></td>
                            <td align ="center"><%#Eval("CreateTime")%></td>                                              
                            <td align ="center">  
                                 <asp:HyperLink  ToolTip="编辑"  ID="hlEdit" ImageUrl="/Skins/default/images/box_an9.gif" runat="server" ></asp:HyperLink>
                                <asp:HyperLink ToolTip="删除"   ID="hlDel" ImageUrl="/Skins/default/images/box_an6.gif" runat="server" ></asp:HyperLink>
                            </td>
                            </tr>
                   </ItemTemplate>
                   <FooterTemplate>
                       </table>
                   </FooterTemplate>
               </asp:Repeater>
               <uc1:PageControl ID="Page2" runat="server" ShowFirstLast="true" ShowPrevNext="true" 
                FirstPageText="首 页" LastPageText="末 页" PrevPageText="上一页" NextPageText="下一页" AlwaysShow="true"            ShowCustomInfoSec="left" NumericButtonCount="5" PagingButtonSpacing="25px" 
                CustomInfoHTML="当前 %CurrentPageIndex% 页 共 %PageCount% 页" />
            </div>
        </div>
    </div>
   
    </form>
</body>

<script type = "text/javascript" language = "javascript">
    function delTag(id){
//        M("aaa","body_box");
//        return;
        if (id == "") {
            M1("无参数传递!");
            return;
        }
        
        if (C("确认删除此标签?") == false)
        {
            return;
        }
        var ret = TagList1.DelTag(id).value;
        if (ret == true)
        {
            M1("Success!");
            refreshPage(0);  
        }
    }
    function delTags(){
        var ids = "";
        for (var i=0;i<document.form1.checkboxid.length;i++) {
            var e=document.form1.checkboxid[i];
            if ( e.checked) {
                ids = ids + e.value + ","
            }
        }        
        if (ids == ""){
            M1("请选择需要删除的标签!");
            return;
        }
        if (C("确认删除这些标签?") == false)
        {
            return;
        }
        if (ids != "" && ids.lastIndexOf(",") == ids.length -1 ){
            ids = ids.substring(0,ids.length - 1)
        }
        
        ids = ids.split(",");
//        alert(ids);
        var ret = TagList1.DelTags(ids).value;
        if (ret == true)
        {
            M1("Success!");            
            refreshPage(0);  
        }
        else{
            M1("Faild!");            
        }        
    }  
    
   
    </script>
</html>
