<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Exame_Edit.aspx.cs" Inherits="RPWEB.Manage.Exame_Edit" EnableEventValidation="false"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title></title>
    <link href="../Web_CSS/WebCss.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../JS/Jquery.js"></script>
    <script type="text/javascript" src="../JS/ManageWeb.js"></script>
        <script language="javascript" type="text/javascript">
// <!CDATA[

function check() {
var k=/\S+\.[xls]/;
if(!k.test(document.getElementById("fileId").value))
{
    alert("只能使用xls格式的文件");
    return false;
}
return true;
}

// ]]>
</script>

</head>
<body>
    <form id="form1" runat="server">
       <div class="div_All">
        <div class="Body_Title">
            <a href=exame_manage.aspx>考试管理</a> >><%=getExameName(htm_exame_id)%></div>
            
                        <div class="pageStyle">
                <%--<input type="button" value="添加新考试科目" onclick='javascript:location.href="ExameSubjectAdd.aspx?id=<%=htm_exame_id %>"'/>--%>
            </div>
            
            
        <asp:Repeater ID="RpPowerUser" runat="server" 
            onitemcommand="RpPowerUser_ItemCommand">
            <HeaderTemplate>
                <table cellpadding="3" cellspacing="1" class="Admin_Table">
                    <thead>
                        <tr class="Admin_Table_Title">
                            <th style="width: 10%;">
                                 学科名称
                            </th>
                            
                            <th style="width: 10%;">
                                 总分
                            </th> 
                                                       
                            <th style="width: 20%;">
                               操作
                            </th>
                        </tr>
                    </thead>
            </HeaderTemplate>
            <ItemTemplate>
                <tr>

                    <td>
                        <%#Eval("SubjectName")%>
                    </td>
                   <td>
                        <asp:TextBox ID="TextBox1" runat="server" Width=28 Text=<%#Eval("fen100")%>></asp:TextBox>
                        <asp:ImageButton ID="TextBox1Save" CommandName="Save" CommandArgument='<%#Eval("ID") %>' runat="server" ImageUrl="../Images/table_edit.png"/>
                    </td>                    
                <td>
                    <%--<asp:ImageButton ID="IBDel" CommandName="Del" CommandArgument='<%#Eval("ID") %>' runat="server" ImageUrl="../Images/Delete.gif"/>--%>
                    </td>                </tr>
            </ItemTemplate>
            <FooterTemplate>
                </table></FooterTemplate>
        </asp:Repeater>

    
<br />
                        <div class="pageStyle">
                <%--<input type="button" value="添加新考试班级" onclick='javascript:location.href="ExameClassAdd.aspx?id=<%=htm_exame_id %>"'/>--%>
            </div>
            
           
        <asp:Repeater ID="Repeater1" runat="server" 
            onitemcommand="Repeater1_ItemCommand">
            <HeaderTemplate>
                <table cellpadding="3" cellspacing="1" class="Admin_Table">
                    <thead>
                        <tr class="Admin_Table_Title">
                            <th style="width: 10%;">
                                 班级ID
                            </th>
                            
                            <th style="width: 10%;">
                                 班级名称
                            </th> 
                            <th style="width: 10%;">
                                 考试人数
                            </th> 
                                                        
                            <th style="width: 10%;">
                                 原有人数
                            </th> 
                                                        
                            <th style="width: 10%;">
                                 班主任
                            </th>                                                        
                            <th style="width: 20%;">
                               操作
                            </th>
                        </tr>
                    </thead>
            </HeaderTemplate>
            <ItemTemplate>
                <tr>

                    <td>
                        <%#Eval("ClassNUM")%>
                    </td>
                   <td>
<%#Eval("ClassName")%>
                    </td>  
                    <td>
                        <%#Eval("Student_Sum")%>
                    </td>
                   <td>
<%#StudentCount(Eval("ClassNUM").ToString())%>
                    </td>  
                    
                  <td>
<%#Eval("TeacherUID")%>（<%#Eval("TeacherName")%>）
                    </td>                                          
                                      
                <td>
                <a title="添加删除学生" href='ExameClassStudentAdd.aspx?exam_id=<%#Eval("exam_id") %>&ClassNUM=<%#Eval("ClassNUM") %>'><%--<img src="../Images/Edit.gif"/>--%>添加删除学生</a>&nbsp;&nbsp;
                    <%--<asp:ImageButton ID="IBDel" CommandName="Del" CommandArgument='<%#Eval("ID") %>' runat="server" ImageUrl="../Images/Delete.gif"/>--%>
                    <asp:LinkButton ID="IBDel" OnClientClick=" return confirm('您确定要删除吗？')" CommandName="Del" CommandArgument='<%#Eval("exam_id")+","+Eval("ClassNUM") %>' runat="server" >删除整个班</asp:LinkButton>
                    
                    </td>                </tr>
            </ItemTemplate>
            <FooterTemplate>
                </table></FooterTemplate>
        </asp:Repeater>
    
    
    
    
<br />
                        <div class="pageStyle">
                &nbsp;<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="考号随机安排" />
                &nbsp;</br>考号导入：<asp:FileUpload ID="fileId" runat="server" /><asp:Button ID="Button2" 
                                runat="server" Text="导入" OnClientClick="return check()" 
                                onclick="Button2_Click"  />
                                <asp:Label ID="Exameidtemp" runat="server" Text="Label" Visible="False"></asp:Label>                        
                            <asp:LinkButton ID="LinkButton1" runat="server" onclick="LinkButton1_Click"></br>模板下载(学号考号姓名导出)：</asp:LinkButton>
                            
                            
<table border="1" cellpadding="0" cellspacing="0">
  <tr>

    <td >学号</td>
    <td >考号</td>
    <td >姓名</td>
  </tr>
    <tr>

    <td >2011001</td>
    <td >1</td>
    <td >XXX</td>
  </tr>
      <tr>

    <td >...</td>
    <td >...</td>
    <td >...</td>
  </tr>
</table> 
                            
                            
                            
                            <asp:Button ID="Button3" runat="server" onclick="Button3_Click" Text="考试详细信息导出" />
            </div>
    
    
    
            <asp:Repeater ID="Repeater2" runat="server" 
            onitemcommand="Repeater2_ItemCommand">
            <HeaderTemplate>
                <table cellpadding="3" cellspacing="1" class="Admin_Table">
                    <thead>
                        <tr class="Admin_Table_Title">
                            <th style="width: 10%;">
                                 所在班级
                            </th>
                            
                            <th style="width: 10%;">
                                 学生姓名
                            </th> 
                            <th style="width: 10%;">
                                 学生学号
                            </th> 
                                                        
                            <th style="width: 10%;">
                                 学生考号
                            </th> 
                                                        
                                                       
                            <th style="width: 20%;">
                               操作
                            </th>
                        </tr>
                    </thead>
            </HeaderTemplate>
            <ItemTemplate>
                <tr>

                    <td>
                   <%#Eval("ClassNUM")%>
                   （<%#GetClassNameByEIDClassNUM(Convert.ToInt32(Eval("exam_id").ToString()), Eval("ClassNUM").ToString())%>）
                    </td>
                   <td>
                   
                        <%#Eval("StudentName")%>
                   
                    </td>  
                    <td>
                        <%#Eval("StudentNUM")%>
                    </td>
                   <td>
 <%#Eval("ExameNUM")%>
                    </td>  
                    

                                      
                <td>
                    <asp:ImageButton ID="IBDel" CommandName="Del" CommandArgument='<%# Eval("ID")+","+Eval("exam_id")+","+Eval("ClassNUM")  %>' runat="server" ImageUrl="../Images/Delete.gif"/>
                    </td>                </tr>
            </ItemTemplate>
            <FooterTemplate>
                </table></FooterTemplate>
        </asp:Repeater>
        
        
 


        
    
    </div>
    </form>
</body>
</html>
