<%@ Page Language="C#" Debug="true" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="True" Title="行业管理" Inherits="Kesion.NET.WebSite.Course.Admin_Course_KS_CsEPCatetory" Codebehind="KS.EPCatetory.aspx.cs" %>
<%@ Import Namespace="Kesion.Publics"%>
<asp:Content ID="Content1" ContentPlaceHolderID="KSContent" Runat="Server">

<asp:Panel ID="ListPannel" runat="server" Width="100%">
   <div id="manage_top" class="menu_top_fixed">
       <ul class="titleTab">
          <li><a href="KS.EPConfig.aspx">机构频道设置</a></li>
          <li class="curr"><a href="KS.EPCatetory.aspx">行业设置</a></li>
          <li><a href="KS.EnterPriseNavClass.aspx">机构主页导航设置</a></li>
       </ul>
 </div>  
<div class="menu_top_fixed_height"></div>
 <div class="content-area">   
     	<div class="myTitle">
             <span class="fr"><a href='?action=Add&Type=0&preid=<%=KSCMS.S("preid") %>&parentid=<%=parentId  %>' class="button button_on mr20">添加行业</a>
                 <%if (parentId > 0)
                     {%>
                  <a href='KS.EPCatetory.aspx?parentid=<%=KSCMS.S("preid") %>' class="button mr20">返回上一级</a>
                 <%}
                   else
                 { %>
                 <a href='?action=updateLetter' class="button">一键更新首字母</a>
                 <%} %>
             </span>
             行业类别</div>

       <asp:GridView ID="AreaList"  runat="server" AutoGenerateColumns="False" EmptyDataText="还没有添加任何行业!"
        GridLines="None" CssClass="CTable" OnRowDataBound="List_RowDataBound"
        Width="99%" >
        <EmptyDataRowStyle CssClass="emptycss" />
        <Columns>
            <asp:BoundField DataField="ID" HeaderText="序号">
                <ItemStyle HorizontalAlign="Center" Width="50px" />
            </asp:BoundField>
            <asp:TemplateField HeaderText="行业名称">
            <ItemStyle HorizontalAlign="Left" />
            <ItemTemplate>
              <div onmouseover="jQuery('#sub<%# Eval("ID") %>').show();" onmouseout="jQuery('#sub<%# Eval("ID") %>').hide();">
              <asp:TextBox CssClass="textbox" ID="TxtCatetory" Text='<%#Eval("Catetory") %>' runat="server"></asp:TextBox>
              <asp:HiddenField ID="hdFDepth" Value='<%#Eval("Depth") %>' runat="server" />
             &nbsp;
                  <%if (depth < 2)
                      { %>
                  <a href="<%# "KS.EPCatetory.aspx?preid="+parentId+"&parentid=" + Eval("id") + "&Type=" + Type %>">进入子行业</a>
                  <a href='?action=Add&preid=<%=parentId%>&Type=0&parentid=<%#Eval("ID")  %>'>添加子行业</a>
                   <%} %>
               </div>
             </ItemTemplate>
            </asp:TemplateField>

            <asp:TemplateField HeaderText="首字母">
            <ItemStyle HorizontalAlign="Center" />
            <ItemTemplate>
              <asp:TextBox CssClass="textbox" ID="TxtLetter" Width="50px" style="text-align:center" Text='<%#Eval("Letter") %>' runat="server"></asp:TextBox>
             </ItemTemplate>
            </asp:TemplateField>

            <asp:TemplateField HeaderText="显示顺序">
            <ItemStyle HorizontalAlign="Center"  />
            <ItemTemplate>
              <asp:TextBox CssClass="textbox" ID="TxtOrderID" Width="50px" style="text-align:center" Text='<%#Eval("OrderID") %>' runat="server"></asp:TextBox>
             </ItemTemplate>
            </asp:TemplateField>

            <asp:TemplateField HeaderText="删除">
                <itemstyle horizontalalign="Center" width="25"/>
                        <itemtemplate>
                            <a href="<%# "KS.EPCatetory.aspx?preid="+parentId+"&id=" + Eval("id") + "&Type=" + Type %>&action=del" onclick="return(confirm('删除行业将同时删除子行业，确定删除吗?'))"  class="delete">[删除]</a>
                 </itemtemplate>
            </asp:TemplateField>

          
        </Columns>
        <HeaderStyle CssClass="CTitle" />
    </asp:GridView>
    

     <KS:Page ID="Page1" runat="server" />
    <KS:Foot ID="Foot1" runat="server" CancelButtonVisible="false" OnSubmit="Foot1_Submit" SubmitButtonText="批量保存(0)" />
</asp:Panel>

</div>
<asp:Panel ID="AddPannel" runat="server" Width="100%" Visible="false">
 <!--<KS:TopNav ID="TopNav2" runat="server" Text="添加行业" />-->
<div class="content-area mt20">
        <div class="myTitle">添加行业</div>
        <table width="99%" style="margin:0 auto;" border="0" cellpadding="0" cellspacing="0" class="CTable no-borderTable"> 
        <tr>
                <td align="right" class="lefttd" height="30" style="width: 198px">
                    <strong>所属行业：</strong></td>
                <td class="righttd">
                    &nbsp;<asp:DropDownList CssClass="select" ID="DrpParentID" runat="server" Width="200px" OnSelectedIndexChanged="DrpParentID_SelectedIndexChanged" AutoPostBack="True">
                    <asp:ListItem Value="0">--作为一级行业分类--</asp:ListItem>
                   
                   </asp:DropDownList>
                    </td>
            </tr>
        
          <tr>
            <td class="lefttd" height="30" align="right" style="width: 198px"><b>行业名称：</b></td>
            <td class="righttd">
                &nbsp;<asp:TextBox CssClass="textbox" ID="TxtCatetory" runat="server"></asp:TextBox><span style="color:#ff0000">*</span> &nbsp; <span class="tips">如农业、采矿业等</span>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TxtCatetory"
                    ErrorMessage="请输入行业名称!"></asp:RequiredFieldValidator></td>
          </tr>
          
          <tr>
                <td align="right" class="lefttd" height="30" style="width: 198px">
                    <strong>首字母：</strong></td>
                <td class="righttd">
                    &nbsp;<asp:DropDownList ID="DrpLetter" runat="server">
                   </asp:DropDownList>
                    </td>
            </tr>
        
            <tr>
                <td align="right" class="lefttd" height="30" style="width: 198px">
                    <strong>排列序号：</strong></td>
                <td class="righttd">
                &nbsp;<asp:TextBox CssClass="textbox" ID="TxtOrderID" runat="server"></asp:TextBox><span style="color:#ff0000">*</span> &nbsp; <span class="tips">数字越小排在越前面</span>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="TxtOrderID"
                    ErrorMessage="请输入排序号!"></asp:RequiredFieldValidator>
                </td>
            </tr>
    
        </table>
      <br />
      <KS:Foot ID="Foot2" runat="server"  OnSubmit="Foot2_Submit"  />
</asp:Panel>
</div>
</asp:Content>
