<%@ Page Language="C#" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="true" Inherits="Kesion.NET.WebSite.Admin.Exam.Admin_SJKnowledge" Title="试卷知识点管理" Codebehind="KS.SJKnowledge.aspx.cs" %>
<%@ Import Namespace="Kesion.Publics" %>
<%@ Import Namespace="Kesion.Cache" %>
 <asp:Content ID="Content1" ContentPlaceHolderID="KSContent" Runat="Server">
 <div id="manage_top" class="menu_top_fixed">
      <div class="quickSelect">
                 <asp:DropDownList ID="DropSJclassid1" runat="server" onchange="location.href='?TheSjclassId='+this.value;">
             <asp:ListItem Value="0">--按试卷分类查看--</asp:ListItem>
             </asp:DropDownList>
          </div>
         <ul class="titleTab"><li><strong>管理操作：</strong></li>
          <li><a href="KS.SJConfig.aspx">频道参数设置</a></li>
          <li><a href="KS.SJCategory.aspx">试卷分类管理</a></li>
          <li><a href="KS.SJType.aspx">自定义试卷类别</a></li>
          <li><a href="KS.SJZDYType.aspx">自定义题型</a></li>
          <li class="curr"><a href="KS.SJKnowledge.aspx">知识点管理</a></li>
          <li><a href="KS.SjTypeClass.aspx">章节管理</a></li>
          <li><a href="KS.SJCJD.aspx">成绩等级管理</a></li>
          <li><a href="KS.ZGCard.aspx">准考证生成管理</a></li>
          <li><a href="KS.SJKM.aspx">会计科目管理</a></li>
       </ul>
 </div>  
<div class="menu_top_fixed_height"></div> 
    <asp:Panel ID="ListPanel" runat="server" Width="100%">
<div class="content-area">
     <div class="myTitle">
        <span class="fr">
           <asp:LinkButton ID="addclassbutton" runat="server" OnClick="addclassbutton_Click" CssClass="button">添加试题知识点</asp:LinkButton>
        </span>知识点管理
              <span style="float:right;padding-right:10px;display:none">
             <asp:DropDownList ID="DrpClassID1" runat="server" onchange="location.href='?classid='+this.value;">
             <asp:ListItem Value="0">--按属性分类查看--</asp:ListItem>
             </asp:DropDownList>                   
          </span>
        </div>
    
    <KS:ksgv id="List" cssclass="CTable" runat="server" AutoGenerateColumns="False" EmptyDataText="没有添加任何知识点!" PagerType="CustomNumeric" Width="99%" GridLines="None" OnRowDataBound="List_RowDataBound" OnRowCommand="List_RowCommand" OnRowCreated="List_RowCreated">
        <Columns>
         <asp:TemplateField HeaderText="选择">
                <itemstyle horizontalalign="Center" Height="30px" width="50px" />
                <itemtemplate>
                <input type="checkbox"  name="ids" id="ids" value="<%#Eval("id") %>" />
                </itemtemplate>
            </asp:TemplateField>
            <asp:BoundField HeaderText="ID" DataField="ID" Visible="false" >
                <itemstyle  horizontalalign="Center" />
            </asp:BoundField>
            <asp:TemplateField HeaderText="知识点名称">
               <itemstyle  horizontalalign="Left" />
                <itemtemplate>
                    <span class="doc_1"></span>
                [<%# MyCache.GetCacheSJCategory(Utils.StrToInt(Eval("SJClassId")),"classname") %>]-
                <%# Utils.StrToInt(Eval("classid"))>0 ? "["+ Kesion.Exam.Practice.GetSJTypeClass(Utils.StrToInt(Eval("classid")),"classname")+"]" : "<font color=blue>该类通用</font>" %>-
                <%# Eval("title") %>
                </itemtemplate>
            </asp:TemplateField>
            
             <asp:TemplateField HeaderText="知识点介绍">
             <itemstyle  width="250px" horizontalalign="Left"/>
             <itemtemplate>
              <span class="tips"><%# Utils.CutStr(!string.IsNullOrEmpty(Convert.ToString(Eval("Content")))?Convert.ToString(Eval("content")):"无",80) %></span>
             </itemtemplate>
             </asp:TemplateField>

             <asp:TemplateField HeaderText="试题数">
             <itemstyle width="150px" horizontalalign="Center"/>
             <itemtemplate>
             <a style="color:#999" href="KS.SJTK.aspx?knowledgeid=<%#Eval("id") %>">共有 <%# GetSTNum(Convert.ToInt16(Eval("id"))) %> 题</a>
             </itemtemplate>
             </asp:TemplateField>

             <asp:TemplateField HeaderText="编辑">
              <itemstyle width="30px" horizontalalign="Center"/>
              <itemtemplate>
                   <a href="?action=modify&id=<%# Eval("id") %>" class="edit"></a>
              </itemtemplate>
             </asp:TemplateField>
            <asp:TemplateField HeaderText="删除">
                <itemstyle width="30px" horizontalalign="Center" />
             <itemtemplate>
             <asp:LinkButton runat="server" ToolTip="删除" CssClass="delete" id="delete" commandargument=<%#Eval("id") %> commandname="del"></asp:LinkButton>
            </itemtemplate>
            </asp:TemplateField>

            
        </Columns>
        <HeaderStyle CssClass="CTitle" />
        <EmptyDataRowStyle CssClass="emptycss" />
    </KS:ksgv>
    
    <asp:Panel ID="Panel2" runat="server" Height="30px" Width="741px">
          <div style="margin-top:8px"></div>
            &nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" name="chkall" id="chkall" onclick="CheckAll(this.form);"/><label for="chkall">全部选中</label>
            
           &nbsp;&nbsp;<input type="button" value="删除记录" onmouseover="this.className='button_on';" onmouseout="this.className='button';" class="button" onclick="if (GetIDS('del')){this.form.action='?action=del';this.form.submit()}" />
      </asp:Panel>
    
 <KS:Page ID="Page1" runat="server" />
 <asp:Panel ID="Panel1" runat="server" Height="30px" Width="100%">
                <br />
        <script type="text/javascript">
		showtips('<span class="state"><strong>操作说明：</strong><br /></span>试题知识点一旦建立，建议尽量少改动。最好不要删除操作以免导致试题所属知识点无法关联。');
		</script>

            </asp:Panel>
    </div>
</asp:Panel>


     
    <asp:Panel ID="AddPanel" runat="server"  Width="100%" Visible="false">
   <div class="content-area">
        <div class="myTitle"><%=!string.IsNullOrEmpty(KSCMS.S("id"))?"修改":"添加" %>知识点</div> 
    <table width="99%" align="center" border="0" cellpadding="1" cellspacing="1" class="CTable"> 
          <script>
              function CheckAddMode() {
                  if (jQuery("#AddType")[0].checked == true) {
                      jQuery("#AddOne").hide();
                      jQuery("#AddMore").show();
                  } else {
                      jQuery("#AddOne").show();
                      jQuery("#AddMore").hide();
                  }
              }       
	    </script>

         <tr>
            <td align="right" class="lefttd" height="30" style="width: 198px">
                <strong>所属试卷分类：</strong></td>
            <td class="righttd">
                &nbsp;<asp:DropDownList CssClass="select" ID="DrpSJClassID" runat="server" AutoPostBack="true" OnSelectedIndexChanged="DrpSJClassID_SelectedIndexChanged">
                    <asp:ListItem Value="0">--选择试卷分类--</asp:ListItem>
                </asp:DropDownList>
                <span id="DrpSJClassIDMessage" runat="server"></span>
            </td>
        </tr>

        <tr>
            <td align="right" class="lefttd" height="30" style="width: 198px">
                <strong>所属章节分类：</strong></td>
            <td class="righttd">
                &nbsp;<asp:DropDownList CssClass="select" ID="DrpClassID" runat="server">
                    <asp:ListItem Value="0">-无（作为一级分类或通用）-</asp:ListItem>
                </asp:DropDownList>
                (可以不选择)<span id="DrpClassIDMessage" runat="server"></span>
            </td>
        </tr>

          <tr>
                    <td class="lefttd" height="30" align="right" style="width: 155px">
                        <strong> 分类名称：</strong></td>
                    <td class="righttd" width="751">
                       <span id="AddOne">
                        <asp:TextBox CssClass="textbox" ID="TxtTitle" runat="server"></asp:TextBox>
                        <span class="tips">*请输入分类的中文名称，如公务员</span>
                       </span>

                       <label style="<%=KSCMS.S("action")=="edit"?"display:none;":"" %>font-weight:bold;color:Green"><input onclick="CheckAddMode()" type="checkbox" name="AddType" id="AddType" value="1" />切换到批量添加模式</label>
                       <div id="AddMore" style="display:none">
                          <font color=red>录入格式:分类中文名称,说明每行一个</font><br />
                          <asp:TextBox Text="分类名称1" ID="TxtMoreClassName" runat="server" CssClass="textbox" TextMode="MultiLine" Width="250px" Height="150px"></asp:TextBox>
                         </div>
                       </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="TxtContent" runat="server" Width="300px" Height="120px" TextMode="MultiLine"></asp:TextBox> 可留空</td>
        </tr>
      </table>
      <br />
        <KS:Foot ID="Foot1" runat="server" OnSubmit="Foot1_Submit" />
      </div>
    </asp:Panel>

</asp:Content>
