<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="LbList.aspx.cs" Inherits="KstCMS.KstCMS_Manager.Manager.Link.lb.LbList" %>

<html>
<head id="Head1"   runat="server">
    <title>无标题页</title>
            <script type="text/javascript">
                function selectall() {

                    var obj = document.getElementById("chxall");
                    var chxobj = document.getElementsByTagName("input");

                    for (var i = 0; i < chxobj.length; i++) {
                        if (chxobj[i].type == "checkbox") {
                            if (obj.checked) {
                                chxobj[i].checked = true;
                            } else {
                                chxobj[i].checked = false;
                            }
                        }
                    }
                }

                function isSelectPro() {
                    var obj = document.getElementById("chxall");
                    var chxobj = document.getElementsByTagName("input");
                    var SelectNum = 0;
                    for (var i = 0; i < chxobj.length; i++) {
                        if (chxobj[i].type == "checkbox") {
                            if (chxobj[i].checked) {
                                if (chxobj[i] != obj) {
                                    SelectNum++;
                                }
                            }
                        }
                    }
                    return SelectNum;
                }

                function checkdel() {
                    if (isSelectPro() == 0) {
                        alert("请选择要更新的项！");
                        return false;
                    }

                        return true;
                }

    </script>
</head>
<body>
<form id="form1" runat="server">



<asp:Panel ID="Panel1" runat="server" CssClass="MainBox">
<table class="PageTitle" width="98%"><tr><td><img src="<%=SysRootUrl %>/KstCMS_Manager/images/menu/system.gif" align="absmiddle" /> 链接类别</td></tr></table>
    <asp:ScriptManager ID="ScriptManager1" runat="server" AllowCustomErrorsRedirect="false">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
    

<asp:Repeater ID="repMain" runat="server">
<HeaderTemplate><table width="98%" border="0" cellpadding="5" cellspacing="1" class="Table_Gray">
  <tr>
    <td colspan="5" class="TableTd_Gray"><input type="button" class="bigButton" value="新建类别" onclick="parent.document.getElementById('main').src='AddFrm.aspx';" /></td>
  </tr>
</HeaderTemplate>
<ItemTemplate>
  <tr class="TableTd_Gray">
    <td nowrap>
     <input type="checkbox" id="chxbox" name="chxbox" value="<%#DataBinder.Eval(Container.DataItem,"LbID") %>" />
    </td>
      <td nowrap>
     <%#DataBinder.Eval(Container.DataItem,"LbID") %>
    </td>
    <td nowrap>
       <input type="text" class="input_text" size="2" name="SortNo_<%#DataBinder.Eval(Container.DataItem,"LbID") %>" value="<%#DataBinder.Eval(Container.DataItem,"SortNo") %>" />
    </td>
    <td nowrap>
     <%#DataBinder.Eval(Container.DataItem,"LbName") %>
    </td>

    <td nowrap>
    <a href="EditFrm.aspx?LbID=<%#DataBinder.Eval(Container.DataItem,"LbID") %>&LbName=<%#Server.UrlEncode(DataBinder.Eval(Container.DataItem,"LbName").ToString()) %>" target="main">修改</a> 
  
    <asp:LinkButton ID="DelBtn" runat="server" CommandName=<%#DataBinder.Eval(Container.DataItem,"LbID") %>  OnClientClick="return confirm('真的删除此类别吗？');">删除</asp:LinkButton> 
     
    </td>
  </tr>
</ItemTemplate>
<AlternatingItemTemplate>
  <tr class="TableTd_Gray1">
    <td nowrap>
     <input type="checkbox" id="chxbox" name="chxbox" value="<%#DataBinder.Eval(Container.DataItem,"LbID") %>" />
    </td>
      <td nowrap>
     <%#DataBinder.Eval(Container.DataItem,"LbID") %>
    </td>
    <td nowrap>
       <input type="text" class="input_text" size="2" name="SortNo_<%#DataBinder.Eval(Container.DataItem,"LbID") %>" value="<%#DataBinder.Eval(Container.DataItem,"SortNo") %>" />
    </td>
    <td nowrap>
     <%#DataBinder.Eval(Container.DataItem,"LbName") %>
    </td>

    <td nowrap>
    <a href="EditFrm.aspx?LbID=<%#DataBinder.Eval(Container.DataItem,"LbID") %>&LbName=<%#Server.UrlEncode(DataBinder.Eval(Container.DataItem,"LbName").ToString()) %>" target="main">修改</a> 
    <asp:LinkButton ID="DelBtn" runat="server" CommandName=<%#DataBinder.Eval(Container.DataItem,"LbID") %>  OnClientClick="return confirm('真的删除此类别吗？');">删除</asp:LinkButton> 
     
    </td>
  </tr>
</AlternatingItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>

<table width="100%" border="0" cellspacing="2" cellpadding="0" align="center">
             <tr>
              <td nowrap="nowrap">
                   <input type="checkbox" id="chxall" name="chxall" onclick="selectall();" />
                   <asp:Button ID="btn_Del" runat="server" Text="更新" CssClass="uPageBtn" OnClientClick="return checkdel();" />
             </td>
              <td nowrap="nowrap" style="font-family:Verdana">
      <asp:Literal ID="PageInfo" runat="server"></asp:Literal>  
             </td>
            </tr>
         </table>    
    </ContentTemplate>
    </asp:UpdatePanel>
    <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
    <ProgressTemplate>正在删除，请稍候...</ProgressTemplate>
    </asp:UpdateProgress>
</asp:Panel>
    </form>
</body>
</html>
