<%@ page language="C#" autoeventwireup="true" inherits="Admin_xx_helplist, App_Web_ouxoyg5o" %>
<%@ Register assembly="AspNetPager" namespace="Wuqi.Webdiyer" tagprefix="webdiyer" %>
<%@ Register src="YanZen.ascx" tagname="YanZen" 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 runat="server">
    <title></title>
    <link href="Admin_Style.css" rel="stylesheet" type="text/css" />
    
    <script language="javascript" type="text/javascript">
        // 判断多选是否与选中项（没有选中的返回false）
        function slcNo_click() {
            if (document.form1.checkboxname.length) {
                for (var i = 0; i < document.form1.checkboxname.length; i++) {
                    if (document.form1.checkboxname[i].checked) {
                        return true;
                    }
                }
            }
            else {
                if (document.form1.checkboxname.checked) {
                    return true;
                }
            }
            alert("请选择后再操作！");
            return false;
        }

        // 鼠标经过改变行的颜色
        if (!objbeforeItem) {
            var objbeforeItem = null;
            var objbeforeItembackgroundColor = null;
        }
        function ItemOver(obj) {
            if (objbeforeItem) {
                objbeforeItem.style.backgroundColor = objbeforeItembackgroundColor;
            }
            objbeforeItembackgroundColor = obj.style.backgroundColor;
            objbeforeItem = obj;
            obj.style.backgroundColor = "#B9D1F3";
        }
        //        

        // 多选的全选与取消
        function checkJs(boolvalue) {
            if (document.all.checkboxname.length > 1) {
                for (var i = 0; i < document.all.checkboxname.length; i++) {
                    document.all.checkboxname[i].checked = boolvalue;
                }
            }
            else
                document.all.checkboxname.checked = boolvalue;
        }
        //

        // 只有全部选中时“全选”选中
        function SingleCheckJs() {
            var flag1 = false;
            var flag2 = false;

            if (document.form1.checkboxname.length) {
                for (var i = 0; i < document.form1.checkboxname.length; i++) {
                    if (document.form1.checkboxname[i].checked)
                        flag1 = true;
                    else
                        flag2 = true;
                }
            }
            else {
                if (document.form1.checkboxname.checked)
                    flag1 = true;
                else
                    flag2 = true;
            }

            if (flag1 == true && flag2 == false)
                document.getElementById("chk").checked = true;
            else
                document.getElementById("chk").checked = false;
        }
        //
    </script>
    
</head>
<body>
    <form id="form1" runat="server">
    <uc1:YanZen ID="YanZen1" runat="server" />
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div id="tab1">
        <table cellpadding="4" cellspacing="1" style="width: 100%;">
            <tr>
                <td>
                    <img src="images/start3.gif" />
                    <b>帮助信息列表</b>
                </td>
            </tr>
            <tr>
                <td>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:TextBox ID="SearchText" runat="server" Height="20px" Width="200px"></asp:TextBox>
                    <asp:Button ID="SearchBtn" runat="server" Height="26px" 
                        onclick="SearchBtn_Click" Text="查标题" Width="60px" />
                    <asp:Button ID="WriteHelpDefBtn" runat="server" Height="26px" Text="生成帮助首页" 
                        Width="100px" onclick="WriteHelpDefBtn_Click" />
                    <asp:Button ID="WriteHelpListBtn" runat="server" Height="26px" Text="生成帮助分类页" 
                        Width="120px" onclick="WriteHelpListBtn_Click" />
                    <asp:Button ID="WriteHelpViewBtn" runat="server" Height="26px" Text="生成帮助详细页" 
                        Width="100px" onclick="WriteHelpViewBtn_Click" />
                </td>
            </tr>
            <tr>
                <td>
                    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                        <ContentTemplate>
                            <asp:Label ID="Label1" runat="server"></asp:Label>
                        </ContentTemplate>
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="WriteHelpDefBtn" EventName="Click" />
                            <asp:AsyncPostBackTrigger ControlID="WriteHelpListBtn" EventName="Click" />
                            <asp:AsyncPostBackTrigger ControlID="WriteHelpViewBtn" EventName="Click" />
                        </Triggers>
                    </asp:UpdatePanel>
                    <asp:UpdateProgress ID="UpdateProgress1" runat="server">
                        <ProgressTemplate>
                            <img src="/images/loading.gif" style="width:50px; height:50px;" />
                            <span style="color:Red; font-weight: bold; font-size: 14px;">生成页面中，请勿刷新页面！</span>
                        </ProgressTemplate>
                    </asp:UpdateProgress>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                        BackColor="White" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" 
                        CellPadding="3" ForeColor="Black" GridLines="Vertical" Width="100%">
                        <RowStyle HorizontalAlign="Center" />
                        <Columns>
                            <asp:TemplateField HeaderText="&lt;input type='checkbox' id='chk' name='chk' onclick='checkJs(this.checked);'  /&gt;"
                                FooterText="全选">
                                <ItemTemplate>
                                    <input type="checkbox" id="checkboxname" name="checkboxname" value='<%# DataBinder.Eval(Container.DataItem, "HelpID")%>'
                                        onclick='SingleCheckJs();' />
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Center" Width="20px" />
                            </asp:TemplateField>
                            <asp:HyperLinkField DataNavigateUrlFields="HelpID" 
                                DataNavigateUrlFormatString="xx_helpedit.aspx?helpid={0}" HeaderText="操作" 
                                Text="[编辑]">
                                <ItemStyle Width="60px" />
                            </asp:HyperLinkField>
                            <asp:BoundField DataField="KindName" HeaderText="类别" >
                                <ItemStyle Width="80px" />
                            </asp:BoundField>
                            <asp:BoundField DataField="Title" HeaderText="标题" >
                                <ItemStyle HorizontalAlign="Left" />
                            </asp:BoundField>
                            <asp:BoundField DataField="Hits" HeaderText="点击数">
                                <ItemStyle Width="50px" />
                            </asp:BoundField>
                            <asp:BoundField DataField="InDate" DataFormatString="{0:yyyy-MM-dd}" 
                                HeaderText="添加日期" >
                                <ItemStyle Width="100px" />
                            </asp:BoundField>
                            <asp:BoundField DataField="EditDate" DataFormatString="{0:yyyy-MM-dd}" 
                                HeaderText="最后编辑" >
                                <ItemStyle Width="100px" />
                            </asp:BoundField>
                        </Columns>
                        <FooterStyle BackColor="#CCCCCC" />
                        <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
                        <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
                        <AlternatingRowStyle BackColor="#CCCCCC" />
                    </asp:GridView>
                    <asp:Label ID="NoDataLabel" runat="server" Text="没有数据"></asp:Label>
                </td>
            </tr>
            <tr>
                <td>
                </td>
            </tr>
            <tr>
                <td>
                    <webdiyer:AspNetPager ID="AspNetPager1" runat="server" OnPageChanging="AspNetPager1_PageChanging"
                        FirstPageText="首页" LastPageText="末页" NextPageText="下一页" NumericButtonCount="30"
                        PrevPageText="上一页" HorizontalAlign="Center" Font-Bold="False" Font-Italic="False"
                        Font-Size="15px" LayoutType="Div" Width="100%" 
                        AlwaysShow="True" PageSize="20">
                    </webdiyer:AspNetPager>
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
