<%@ Page Language="C#" AutoEventWireup="true" CodeFile="HelpTypeList.aspx.cs" Inherits="admin_Help_HelpTypeList" %>

<!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">
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>帮助信息分类管理</title>
    <link rel="stylesheet" href="../skin/style.css" type="text/css" />
   <script type="text/javascript" src="../../js/jquery.js"></script>
    <script type="text/javascript">
     function $(id)
         {
            return document.getElementById(id);
         }
         function check()
         {
           if($("txtType").value=="")
           {
             document.getElementById("name").innerHTML="分类名称不能为空";
             return false;
           }
         }
    </script>

</head>
<body>
    <form id="form1" runat="server">
        <div class="itemtitle">
            <h3>
                帮助分类管理</h3>
        </div>
        <div class="itemtitle">
            <h3>
                添加分类</h3>
        </div>
        <div class="itemtitle_tect">
            <p>
                分类名称：
                <asp:TextBox ID="txtType" runat="server"></asp:TextBox>
                <asp:Button ID="btnSave" runat="server" Text="添加" CssClass="i_button" OnClientClick="javascript: return check()" OnClick="btnSave_Click" />
                <asp:Button ID="btnCancel" runat="server" CssClass="i_button" Text="取消" OnClick="btnCancel_Click" />
            </p>
            <div id="name" style="color:Red; text-align:center;"></div>
        </div>
        <div class="clr">
        </div>
        <div class="partition">
            <div class="Option">
                <span><strong>快捷操作</strong></span> <span>
                    <asp:LinkButton ID="ButJS" runat="server">更新分类</asp:LinkButton>
                </span>
            </div>
        </div>
        <div class="clr">
        </div>
        <div class="talbe_border">
            <asp:GridView runat="server" ID="gvHelpTypeList" CellPadding="0" GridLines="None"
                HeaderStyle-CssClass="itemtitle" CssClass="talbe_list" AutoGenerateColumns="False"
                DataKeyNames="ID" OnRowEditing="gvHelpTypeList_RowEditing" OnRowUpdating="gvHelpTypeList_RowUpdating"
                OnRowCancelingEdit="gvHelpTypeList_RowCancelingEdit" OnRowDeleting="gvHelpTypeList_RowDeleting" OnRowCreated="gvHelpTypeList_RowCreated" OnRowDataBound="gvHelpTypeList_RowDataBound">
                <Columns>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:CheckBox ID="CheckBox1" runat="server" />
                        </ItemTemplate>
                        <ItemStyle CssClass="nolet" Width="30px" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="分类名称">
                        <ItemTemplate>
                            <asp:HyperLink ID="hlk" runat="server" NavigateUrl='<%# Eval("ID", "HelpTypeList.aspx?ParentID={0}") %>'
                                Enabled='<%# IsCount( DataBinder.Eval(Container.DataItem, "time").ToString()) %>' Text=' <%# Eval("Name") %>'></asp:HyperLink>
                               
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="txtName" runat="server" Text='<%# Eval("Name") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <ItemStyle CssClass="left2" />
                    </asp:TemplateField> 
                    <asp:TemplateField HeaderText="操作选项">
                        <EditItemTemplate>
                            <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" CommandName="Update"
                                Text="更新"></asp:LinkButton>
                            <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Cancel"
                                Text="取消"></asp:LinkButton>
                        </EditItemTemplate>
                        <ItemTemplate>
                            〖
                             <asp:HyperLink ID="hlkAdd" runat="server" NavigateUrl='<%# Eval("ID", "HelpTypeList.aspx?ParentID={0}") %>'> 添加子分类</asp:HyperLink>
                            <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Edit"
                                Text="编辑"></asp:LinkButton>
                            <asp:LinkButton ID="lbtnDelete" Style="text-decoration: none" runat="server" Text="删除"
                                CommandArgument='<%# DataBinder.Eval(Container.DataItem,"ID") %>' OnClientClick="return confirm('你确定要删除吗?')"
                                CommandName="delete">
                            </asp:LinkButton>
                            〗
                        </ItemTemplate>
                        <HeaderStyle CssClass="th80" Width="200px" />
                    </asp:TemplateField>
                </Columns>
                <HeaderStyle CssClass="itemtitle" />
            </asp:GridView>
            <div class="Paging">
                <p>
                    总记录数：<asp:Label ID="txt_pageCount" runat="server"></asp:Label>
                    页码：<asp:Label ID="txt_begin" runat="server"></asp:Label>/<asp:Label ID="txt_pageAll"
                        runat="server"></asp:Label>
                    <asp:LinkButton ID="btn_pageFirst" runat="server" OnClick="btn_pageFirst_Click">首页</asp:LinkButton>
                    <asp:LinkButton ID="btn_pageLast" runat="server" OnClick="btn_pageLast_Click">上一页</asp:LinkButton>
                    <asp:LinkButton ID="btn_pageNext" runat="server" OnClick="btn_pageNext_Click">下一页</asp:LinkButton>
                    <asp:LinkButton ID="btn_pageFoot" runat="server" OnClick="btn_pageFoot_Click">末页</asp:LinkButton>
                    <asp:TextBox ID="txt_PageNum" runat="server" Width="30px"></asp:TextBox>
                    <asp:LinkButton ID="btn_go" runat="server" OnClick="btn_go_Click">GO</asp:LinkButton>
                </p>
                <input id="CheckBox2" name="CheckBox2" onclick="SelectAll();" type="checkbox" />全选
                <asp:Button ID="btnDelete" runat="server" Font-Size="9pt" Text="批量删除" CssClass="i_button"
                    OnClick="btnDelete_Click" />
            </div>
        </div>
    </form>
</body>
</html>
