<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="index.aspx.cs" Inherits="KstCMS.KstCMS_Manager.WebContent.wz.wzlb.index" %>

<html>
<head 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 checkupdate() {
            if (isSelectPro() == 0) {
                alert("请选择要更新的项！");
                return false;
            }
            return true;
        }


    </script>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server" AllowCustomErrorsRedirect="false">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
    <div class="mainbox">
<table width="100%" border="0" cellspacing="0" cellpadding="4" style=" border-bottom:1px solid #cccccc">
  <tr>
    <td>
        <asp:Label ID="Label1" runat="server" Text="选择站点："></asp:Label> 
        <asp:DropDownList ID="drp_SiteList" runat="server" AutoPostBack="true">
        </asp:DropDownList>
        <asp:Label ID="Label2" runat="server" Text="导航栏目："></asp:Label>
        <asp:DropDownList ID="drp_MenuList" runat="server" AutoPostBack="true">
        </asp:DropDownList> 
        <input type="button" class="uPageBtn1" value="增加分类" onclick="location.href='AddFrm.aspx';" />
    </td>
  </tr>
</table>
<asp:Repeater ID="RepMain" runat="server">
       <HeaderTemplate>    
       <table width="100%" border="0" cellspacing="1" cellpadding="5" class="Table_Gray">
  <tr class="TableHeader">
    <td>选中</td>
    <td>ID</td>
    <td>排序</td>
    <td>类别名称</td>
    <td>操作</td>
  </tr>
  </HeaderTemplate>
  <ItemTemplate>
  <tr class="TableTd_Gray">
    <td align="center"><input type="checkbox" id="chxbox" name="chxbox" value="<%#DataBinder.Eval(Container.DataItem,"LbID") %>" /></td>
    <td align="center"><%#DataBinder.Eval(Container.DataItem,"LbID") %></td>
    <td align="center"><input type="text" size="4" class="input_text" name="SortNo_<%#DataBinder.Eval(Container.DataItem,"LbID") %>" value="<%#DataBinder.Eval(Container.DataItem,"SortNo") %>" /></td>
    <td align="center"><%#DataBinder.Eval(Container.DataItem,"LbName") %></td>
    <td align="center">
     <input type="button"  value="修改" onclick="location.href='EditFrm.aspx?LbID=<%#DataBinder.Eval(Container.DataItem,"LbID") %>';" />
     <asp:Button ID="btn1" runat="server" CommandArgument="0"  CommandName=<%#DataBinder.Eval(Container.DataItem,"LbID") %> Text="删除" OnClientClick="return confirm('真的删除当前类型吗？');" />
    </td>
  </tr>
  </ItemTemplate>
  <AlternatingItemTemplate>
    <tr class="TableTd_Gray1">
    <td align="center"><input type="checkbox" id="chxbox" name="chxbox" value="<%#DataBinder.Eval(Container.DataItem,"LbID") %>" /></td>
    <td align="center"><%#DataBinder.Eval(Container.DataItem,"LbID") %></td>
    <td align="center"><input type="text" size="4" class="input_text" name="SortNo_<%#DataBinder.Eval(Container.DataItem,"LbID") %>" value="<%#DataBinder.Eval(Container.DataItem,"SortNo") %>" /></td>
    <td align="center"><%#DataBinder.Eval(Container.DataItem,"LbName") %></td>
    <td align="center">
     <input type="button"  value="修改" onclick="location.href='EditFrm.aspx?LbID=<%#DataBinder.Eval(Container.DataItem,"LbID") %>';" />
     <asp:Button ID="btn1" runat="server" CommandArgument="0"  CommandName=<%#DataBinder.Eval(Container.DataItem,"LbID") %> Text="删除" OnClientClick="return confirm('真的删除当前类型吗？');" />
    </td>
  </tr>
  </AlternatingItemTemplate>
  <FooterTemplate>
</table>
</FooterTemplate>
   </asp:Repeater>
 <table width="100%" border="0" cellspacing="2" cellpadding="0" align="center"  class="PageBox">
  <tr>
 <td>
   <input type="checkbox" id="chxall" name="chxall" onclick="selectall();" />
   <asp:Button ID="btn_Sort" runat="server" Text="更新" CssClass="uPageBtn" OnClientClick="return checkupdate();" />
 </td>
 </tr></table>
</div>
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
    <ProgressTemplate>
        正在处理,请稍等...
    </ProgressTemplate>
    </asp:UpdateProgress>
    </form>
</body>
</html>