<%@ Page Title="地区管理" StylesheetTheme="AdminSkin" Language="C#" MasterPageFile="~/Others/AdminMasterPage.Master" AutoEventWireup="true" CodeBehind="AreaManage.aspx.cs" Inherits="Solution.Admin.Contents.AreaManage" %>

<%@ Register Assembly="BX.Common" Namespace="Common" TagPrefix="cc1" %>
<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="ObjectDataSourceAreaList" runat="server" SelectMethod="List" TypeName="Logic.Area">
            <SelectParameters>
                <asp:QueryStringParameter DefaultValue="ParentNode" Name="categroy" QueryStringField="category"
                    Type="String" />
                <asp:QueryStringParameter DefaultValue="0" Name="keywords" QueryStringField="keywords"
                    Type="String" />
                <asp:QueryStringParameter DefaultValue="equals" Name="conditional" QueryStringField="conditional"
                    Type="string" />
            </SelectParameters>
        </asp:ObjectDataSource>
        <div class="DivRightCenter">
            <div class="listdiv">
                <div class="grid-title">
                    <div class="grid-title-text">
                        <h4>
                            <span>地区管理</span>
                        </h4>
                    </div>
                    <div class="grid-title-menu">
                        <ul>
                            <li><a href="AreaManage.aspx?conditional=equals&category=Depth&keywords=1">省份</a></li>
                            <li><a href="AreaManage.aspx">所有</a></li>
                            <li><a href="AreaManage.aspx?conditional=equals&category=Status&keywords=0">隐藏</a></li>
                            <li><a href="AreaManage.aspx?conditional=equals&category=Recommend&keywords=1">推荐</a></li>
                        </ul>
                    </div>
                </div>
                <div class="grid-list">
                    <cc1:ExtendedGridView ID="ExtendedGridViewAreaList" runat="server" AutoGenerateColumns="False" CheckBox="False" DataSourceID="ObjectDataSourceAreaList" ItemName="地区管理" AllowPaging="false" CheckBoxDataIndex="0" CssClass="grid">
                        <Columns>
                            <asp:BoundField DataField="AreaID" HeaderText="ID" SortExpression="AreaID">
                                <ItemStyle Width="50px" />
                            </asp:BoundField>
                            <asp:BoundField DataField="AliasName" HeaderText="目录名">
                                <ItemStyle Width="100px" Wrap="False" HorizontalAlign="Left" />
                            </asp:BoundField>
                            <asp:TemplateField HeaderText="地区名称">
                                <ItemTemplate>
                                    <div class="ListIndustryName" style="">
                                        <img src="../Images/List/folder_open.gif" /><span style="cursor: pointer;" title="点击查看子项" onclick="window.location.href='AreaManage.aspx?conditional=equals&category=ParentNode&keywords=<%#Eval("AreaID")%>'"><%#Eval("AreaName")%></span>
                                    </div>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="排序">
                                <ItemStyle Width="50px" Wrap="False" />
                                <ItemTemplate>
                                    <input id='txtIndustryOrder<%#Eval("AreaID") %>' style="width: 55px; border: 1px #D7D7D7 solid;" type="text" readonly="readonly" value="<%#Eval("Sequence") %>" />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="状态">
                                <ItemStyle Width="100px" Wrap="False" />
                                <ItemTemplate>
                                    <%#Eval("Status").ToString().Equals("1")?"显示":""%>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="推荐">
                                <ItemStyle Width="100px" Wrap="False" />
                                <ItemTemplate>
                                    <%#Eval("Recommend").ToString().Equals("1")?"推荐":""%>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="操作">
                                <ItemStyle Width="100px" Wrap="False" />
                                <ItemTemplate>
                                    <a href="AreaEdit.aspx?cmd=modify&areaid=<%#Eval("AreaID") %>">修改</a>&nbsp;
                                <a href="AreaManage.aspx?conditional=equals&category=ParentNode&keywords=<%#Eval("AreaID")%>">查看子项</a>
                                    <a href="AreaEdit.aspx?cmd=add&parentid=<%#Eval("AreaID") %>">添加子项</a>&nbsp;
                                <a href="AreaManage.aspx?cmd=delete&areaid=<%#Eval("AreaID") %>">删除</a>&nbsp;
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </cc1:ExtendedGridView>
                </div>
            </div>
            <div class="FormButtonArea">
                <br />
                <asp:Button ID="Button1" runat="server" UseSubmitBehavior="false" OnClientClick="document.location.href='AreaEdit.aspx';return false;" Text="添加新地区" />

            </div>
            <br />
        </div>
    </form>
</asp:Content>
