<%@ Page Language="C#" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="true" Inherits="Kesion.NET.WebSite.Admin_SJCJD" Title="成绩段设置管理" Codebehind="KS.SJCJD.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">
         <ul class="titleTab">
          <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>
          <%if (MyCache.GetSJCacheConfig(2).ToString() == "1"){ %>
          <li><a href="KS.SJKnowledge.aspx">知识点管理</a></li>
        <%} %>
          <li><a href="KS.SjTypeClass.aspx">章节管理</a></li>
          <li class="curr"><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="mr20 button button_on">添加成绩段</asp:LinkButton>
        </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" 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 width="50px" horizontalalign="Center" />
            </asp:BoundField>
            <asp:BoundField HeaderText="成绩段项目名称" DataField="ItemName" HtmlEncode="False" >
                <itemstyle/>
            </asp:BoundField>
            <asp:BoundField HeaderText="排列序号" DataField="OrderID">
                <itemstyle width="120px" verticalalign="Middle"  horizontalalign="Center"/>
            </asp:BoundField>
            <asp:BoundField HeaderText="是否默认" DataField="IsDefault">
                <itemstyle width="120px" verticalalign="Middle"  horizontalalign="Center"/>
            </asp:BoundField>

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

            
        </Columns>
        <HeaderStyle CssClass="CTitle" />
        <EmptyDataRowStyle CssClass="emptycss" />
       
    </KS:ksgv>
     <div class="listedit">
        <ul>
            <input type='checkbox' name='chkall' id='chkall' onClick='CheckAll(this.form);'/><label for="chkall">全选</label>
            <asp:LinkButton ID="delclassbutton" runat="server" OnClick="delclassbutton_Click" CssClass="button">删除成绩段</asp:LinkButton>
        </ul>
      </div>
    <KS:Page ID="Page1" runat="server" />
                <asp:Panel ID="Panel1" runat="server" Height="30px" Width="100%">
        <script type="text/javascript">
		showtips('<span class="state"><strong>操作说明：</strong><br /></span>成绩段一旦建立，建议尽量少改动。最好不要删除操作以免导致试卷不能按成绩段统计分析。');
		</script>

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

</div>
     
    <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="100%" align="center" border="0" cellpadding="1" cellspacing="1" class="CTable no-borderTable"> 
          <tr>
            <td align="right" class="lefttd" height="30" style="width:258px"><b>成绩段名称：</b></td>
            <td class="righttd">
                &nbsp;<asp:TextBox CssClass="textbox" ID="TxtItemName" runat="server" Width="203px"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TxtItemName"
                    ErrorMessage="请填写成绩段名称!" Display="Dynamic"></asp:RequiredFieldValidator> 如100分制成绩段等</td>
        </tr>


        <tr>
            <td align="right" class="lefttd" height="30" style="width: 258px">
                <strong>是否默认：</strong></td>
            <td class="righttd">
                <asp:RadioButtonList ID="IsDefault" runat="server" RepeatDirection="Horizontal">
                    <asp:ListItem Value="1">是</asp:ListItem>
                    <asp:ListItem Selected="True" Value="0">否</asp:ListItem>
                </asp:RadioButtonList></td>
        </tr>
        <tr>
            <td align="right" class="lefttd" height="30" style="width: 258px">
                <strong>设置分数段：</strong></td>
            <td class="righttd">
               
				   <script>
                       function doadd(num) {
                           var i;
                           var str = "";
                           var oldi = 0;
                           var j = 0;
                           if (jQuery("#itemlist").html() != '') {
                               oldi = parseInt(jQuery('#editnum').val());
                           } else {
                             oldi = 0;
                       }
                       jQuery("#editnum").val(parseInt(jQuery('#editnum').val()) + parseInt(num));
                          
                           for (i = 1; i <= num; i++) {
                               j = i + oldi;
                               str = str + "<tr><td height=20 align=center><input type=hidden name=id" + j + " value=0>" + j + "</td><td align=center><input type=text style='width:100px' class=textbox name=title" + j + " size=13></td><td align=center nowrap>大于等于<input type='text' name='minscore" + j + "' size='3'  style='width:42px' class='textbox' style='text-align:center'/>分 小于等于<input type='text' style='width:42px' class='textbox' name='maxscore" + j + "' size='3' style='text-align:center'/>分</td><td align=center><input type=text  style='width:60px' class=textbox name='score" + j + "' style='text-align:center' value=0 size=6></div></td><td align=center><input type=text  style='width:60px' class=textbox name='orderid" + j + "' style='text-align:center' value=0 size=6></div></td></tr>";
                           }
                           jQuery('#itemlist').append(str);
                       }
                       <%if (editNum==0){ %>
                       jQuery(document).ready(function() {
                           doadd(3);
                       });
                       <%} %>
                 </script>
               
             <table border="0" class="CTable nTable" cellpadding="0" cellspacing="0" style="margin-left:5px;" width="96%">
     
                 <tr>
                  <td colspan="3" height="30px">
                  		选项数量: 
                      <input name="vote_num" class="textbox" type="text" id="votenum" value="1" size="5" style="width:60px;text-align:center"> 
                      <input type="button" name="Submit52" value="增加选项" class="button" onmouseover="this.className='button_on';" onmouseout="this.className='button';" onclick="javascript:doadd(jQuery('#votenum').val());"> 
                      <input name="editnum" type="hidden" id="editnum" value="<%=editNum %>"> 
                  
                  </td>
                 </tr>
                 <tr bgcolor='#f2f4f7'>
                 <td width='9%' height='30' align='center'>编号</td>
                 <td align='center'>成绩段名称</td>
                 <td align='center'>成绩范围</td>
                 <td align='center'>赠送积分</td>
                 <td align='center'>排序号</td>
                 </tr>
                 <tbody id="itemlist">
                 <%=itemStr %>
                 </tbody>
                
                </table>
            <br />
        <script type="text/javascript">
            showtips('<span class="state"><strong>操作说明：</strong><br /></span>1、成绩段名称如及格、优秀等，赠送积分表示当考试成绩在此成绩段时可以赠送积分奖励，设置“0”表示没有积分奖励。<br/>2、如果删除某个成绩段，请将成绩段名称留空并提交保存即可。');
		</script>
            </td>
        </tr>
        
        
        <tr>
            <td align="right" class="lefttd" height="30" style="width: 155px">
                <strong>排 序 号：</strong></td>
            <td class="righttd">
                &nbsp;<asp:TextBox CssClass="textbox" ID="OrderID" runat="server" Width="60px"></asp:TextBox>序号越小排在越前面</td>
        </tr>
      </table>
      
        <KS:Foot ID="Foot1" runat="server" OnSubmit="Foot1_Submit" />
      
    </asp:Panel>
</div>
</asp:Content>
