<%@ Page Title="文章类别管理" StylesheetTheme="AdminSkin" Language="C#" MasterPageFile="~/Others/AdminMasterPage.Master" AutoEventWireup="true" CodeBehind="ArticleCategoryManage.aspx.cs" Inherits="Web.Admin.Contents.ArticleCategoryManage" %>

<%@ Register Assembly="BX.Common" Namespace="Common" TagPrefix="BX" %>
<asp:Content ID="Content1" ContentPlaceHolderID="AdminContentHead" runat="server">
    <script type="text/javascript">
        function GetListSytle(nodePath, nodeName) {
            var node = nodePath.split('/');
            var depth = node.length;//计算出节点的深度
            var style = "";
            var imgtxt = "";
            if (depth > 1) {
                style = "padding-left: " + (depth - 1) * 15 + "px;";
                imgtxt = "<img src=\"../Images/List/t.gif\"/><img src=\"../Images/List/folder_open.gif\"/>";
            }
            else {
                style = "";
                imgtxt = "<img src=\"../Images/List/folder_open.gif\"/>";
                var parentPath = nodePath.replace(/\/\d+$/, "");
                nodeName = "<span style=\"cursor:pointer;\" title=\"点击查看子项\" onclick=\"window.location.href='IndustryList.aspx?conditional=rightlike&category=NodePath&keywords=" + parentPath + "'\">" + nodeName + "</span>";
            }
            var nodetxt = "<div class=\"ListIndustryName\" style=\"" + style + "\">" + imgtxt + nodeName + "</div>";
            return nodetxt;
        }
    </script>
    <style type="text/css">
        .ListIndustryName {
            text-align: left;
            margin-left: 20px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="AdminContentCenter" runat="server">
    <form id="form1" runat="server">
        <asp:ObjectDataSource ID="ObjectDataSourceArticleCategory" runat="server" SelectMethod="ListCategory" TypeName="Logic.Article">
            <SelectParameters>
            </SelectParameters>
        </asp:ObjectDataSource>
        <div class="DivRightCenter">
            <div class="listdiv">
                <div class="grid-title">
                    <div class="grid-title-text">
                        <h4>
                            <span>文章类别管理</span>
                        </h4>
                    </div>
                </div>
                <div class="grid-list">
                    <BX:ExtendedGridView ID="ExtendedGridViewArticleCategory" runat="server" AutoGenerateColumns="False" CheckBox="False" CssClass="grid" DataSourceID="ObjectDataSourceArticleCategory" ItemName="文章类别管理" AllowPaging="false" PageSize="1000">
                    <Columns>
                        <asp:BoundField DataField="CategoryID" HeaderText="ID">
                            <ItemStyle Width="50px" />
                        </asp:BoundField>
                        <asp:TemplateField HeaderText="类别名称">
                            <ItemTemplate>
                                <script type="text/javascript">
                                    document.write(GetListSytle('<%#Eval("NodePath")%>', '<%#Eval("CategoryName")%>'));
                                </script>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="Sequence" HeaderText="排序">
                            <ItemStyle Width="50px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="CreateDate" HeaderText="创建时间">
                            <ItemStyle Width="100px" Wrap="false" />
                        </asp:BoundField>

                        <asp:TemplateField HeaderText="操作">
                            <ItemStyle Width="100px" Wrap="False" />
                            <ItemTemplate>
                                <a href="ArticleCategoryEdit.aspx?cmd=modify&id=<%#Eval("CategoryID") %>">修改</a>&nbsp;
                                <a href="ArticleCategoryManage.aspx?cmd=delete&id=<%#Eval("CategoryID") %>" onclick="return confirm('确定删除?')">删除</a>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </BX:ExtendedGridView>
                </div>
            </div>

            <br />
            <div class="FormButtonArea">
                <asp:Button ID="Button1" runat="server" Text="添加新分类" OnClientClick="window.location.href='ArticleCategoryEdit.aspx';return false;" />&nbsp;&nbsp;
                          <asp:Button ID="Button2" runat="server" UseSubmitBehavior="false" Text="添加文章" OnClientClick="document.location.href='ArticleEdit.aspx';return false;" />&nbsp;&nbsp;
            <asp:Button ID="Button3" runat="server" UseSubmitBehavior="false" Text="文章管理" OnClientClick="document.location.href='ArticleManage.aspx';return false;" />
            </div>
        </div>
    </form>
</asp:Content>
