<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="exammanage.aspx.cs" Inherits="FangPage.Exam.Admin.exammanage" %>
<%@ Register Assembly="FangPage.Control" Namespace="FangPage.Control" TagPrefix="cc1" %>

<!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>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link href="styles/bmsmanager.css" type="text/css" rel="stylesheet">
    <link href="styles/datagrid.css" type="text/css" rel="stylesheet">

    <script type="text/javascript" src="js/common.js"></script>

    <meta content="MSHTML 6.00.3790.0" name="GENERATOR">
</head>
<body leftmargin="5" topmargin="5" rightmargin="5" bottommargin="5">
    <form id="form1" runat="server">
    <div class="Navbutton" style="width: 98%;">
        <table cellspacing="1" cellpadding="4" align="left" class="table1">
            <tr>
                <td align="left">
                    &nbsp;<input title="全选/取消全选" onclick="CheckAll(this.form)" type="checkbox" name="chkall"
                        id="chkall" />全选 &nbsp;
                    <cc1:Button ID="DelRec" runat="server" Text=" 删 除 " ButtonImgUrl="images/dell.gif"
                        OnClick="DelRec_Click"></cc1:Button>
                    <cc1:Button ID="Status" runat="server" Text=" 审 核 " OnClick="Status_Click"></cc1:Button>&nbsp;
                    <button type="button" class="ManagerButton" onclick="window.location='examadd.aspx?sortid=<%=sortid%>';">
                        <img src="images/add.gif" /> 添 加 </button>&nbsp;
                    <button class="ManagerButton" type="button" onclick="javascript:window.location.href='subjectmanage.aspx?sortid=<%=sortid%>';">
                        <img src="images/arrow_undo.gif" />返 回</button>
                </td>
            </tr>
        </table>
    </div>
    <cc1:DataGrid ID="DataGrid1" runat="server" OnPageIndexChanged="DataGrid_PageIndexChanged"
        AllowPaging="true" PageSize="20">
        <Columns>
            <asp:TemplateColumn HeaderText="选择">
                <ItemTemplate>
                    <input id="id" onclick="javascript:SH_SelectOne(this)" type="checkbox" value="<%# DataBinder.Eval(Container, "DataItem.id").ToString() %>"
                        name="id" />
                </ItemTemplate>
            </asp:TemplateColumn>
            <asp:BoundColumn DataField="id" SortExpression="id" HeaderText="Id" Visible="false">
            </asp:BoundColumn>
            <asp:TemplateColumn ItemStyle-HorizontalAlign="Left" HeaderText="考试名称">
                <ItemTemplate>
                    <a href="examedit.aspx?sortid=<%# DataBinder.Eval(Container, "DataItem.sortid").ToString() %>&id=<%# DataBinder.Eval(Container, "DataItem.id").ToString() %>">
                        <%# DataBinder.Eval(Container, "DataItem.title").ToString()%></a>
                </ItemTemplate>
            </asp:TemplateColumn>
            <asp:TemplateColumn HeaderText="考试科目">
               <ItemTemplate>
                    <%# GetSortName(DataBinder.Eval(Container, "DataItem.sortid").ToString().Trim())%>
                </ItemTemplate>
            </asp:TemplateColumn>
            <asp:BoundColumn DataField="totalper" HeaderText="总分"></asp:BoundColumn>
            <asp:TemplateColumn HeaderText="考试日期">
               <ItemTemplate>
                    <%# GetExamDate(DataBinder.Eval(Container, "DataItem.allowdatetime").ToString().Trim(), DataBinder.Eval(Container, "DataItem.starttime").ToString().Trim(), DataBinder.Eval(Container, "DataItem.endtime").ToString().Trim())%>
                </ItemTemplate>
            </asp:TemplateColumn>
            <asp:TemplateColumn HeaderText="选题方式">
               <ItemTemplate>
                    <%# GetExamType(DataBinder.Eval(Container, "DataItem.examtype").ToString().Trim())%>
                </ItemTemplate>
            </asp:TemplateColumn>
            <asp:BoundColumn DataField="postdatetime" HeaderText="发布时间"></asp:BoundColumn>
            <asp:BoundColumn DataField="username" HeaderText="发布者"></asp:BoundColumn>
            <asp:TemplateColumn HeaderText="状态">
                <ItemTemplate>
                    <%#StateStr(DataBinder.Eval(Container, "DataItem.state").ToString())%>
                </ItemTemplate>
            </asp:TemplateColumn>
            <asp:TemplateColumn HeaderText="操作" ItemStyle-HorizontalAlign="Left">
                <ItemTemplate>
                    <a href="examedit.aspx?sortid=<%# DataBinder.Eval(Container, "DataItem.sortid").ToString() %>&id=<%# DataBinder.Eval(Container, "DataItem.id").ToString() %>">
                        编辑</a>&nbsp;&nbsp;
                    <a href="examresultmanage.aspx?sortid=<%# DataBinder.Eval(Container, "DataItem.sortid").ToString() %>&examid=<%# DataBinder.Eval(Container, "DataItem.id").ToString() %>">
                        成绩</a>&nbsp;&nbsp;
                    <%#ExaminationStr(DataBinder.Eval(Container, "DataItem.examtype").ToString(), DataBinder.Eval(Container, "DataItem.sortid").ToString(), DataBinder.Eval(Container, "DataItem.id").ToString())%>
                </ItemTemplate>
            </asp:TemplateColumn>
        </Columns>
    </cc1:DataGrid>
    </form>
</body>
</html>