<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="subjectmanage.aspx.cs" Inherits="FangPage.Exam.Admin.subjectmanage" %>
<%@ 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>
    <script language="javascript" type="text/javascript">
	    function Export(pathname)
	    {
	        if(confirm("您确定要导出题库吗？\r\n\r\n当前操作可能要运行一段时间，在此期间不要进行其它操作。")) 
	        {
                window.location=pathname;
            }
	    }
    </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 width="60">&nbsp;
                <input title="选中/取消选中" onclick="CheckAll(this.form)" type="checkbox" name="chkall"
                        id="chkall" />全选
                </td>
                <td align="left">
                    <cc1:Button ID="DelRec" runat="server" Text=" 删 除 " ButtonImgUrl="images/dell.gif"
                        OnClick="DelRec_Click"></cc1:Button>
                    <cc1:Button ID="Copy" runat="server" Text=" 复 制 " ButtonImgUrl="images/copy.gif"
                        OnClick="Copy_Click"></cc1:Button>
                    <cc1:Button ID="Moveto" runat="server" Text=" 移 动 " ButtonImgUrl="images/move.gif"
                        OnClick="Moveto_Click"></cc1:Button>
                    <cc1:Button ID="Status" runat="server" Text=" 审 核 " OnClick="Status_Click"></cc1:Button>&nbsp;
                    <button type="button" class="ManagerButton" onclick="window.location='subjectadd.aspx?sortid=<%=sortid%>';">
                        <img src="images/add.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="subjectedit.aspx?sortid=<%# DataBinder.Eval(Container, "DataItem.sortid").ToString() %>&id=<%# DataBinder.Eval(Container, "DataItem.id").ToString() %>&aciton=<%=action %>" title="<%#GetQuestion(DataBinder.Eval(Container, "DataItem.type").ToString().Trim(), DataBinder.Eval(Container, "DataItem.question").ToString(), DataBinder.Eval(Container, "DataItem.text1").ToString(), DataBinder.Eval(Container, "DataItem.text2").ToString(), DataBinder.Eval(Container, "DataItem.text3").ToString(), DataBinder.Eval(Container, "DataItem.text4").ToString(), DataBinder.Eval(Container, "DataItem.text5").ToString(), DataBinder.Eval(Container, "DataItem.text6").ToString())%>">
                        <%#GetQuestion(DataBinder.Eval(Container, "DataItem.type").ToString().Trim(), DataBinder.Eval(Container, "DataItem.question").ToString(), DataBinder.Eval(Container, "DataItem.text1").ToString(), DataBinder.Eval(Container, "DataItem.text2").ToString(), DataBinder.Eval(Container, "DataItem.text3").ToString(), DataBinder.Eval(Container, "DataItem.text4").ToString(), DataBinder.Eval(Container, "DataItem.text5").ToString(), DataBinder.Eval(Container, "DataItem.text6").ToString(),60)%></a>
                </ItemTemplate>
            </asp:TemplateColumn>
            <asp:TemplateColumn HeaderText="题型">
               <ItemTemplate>
                    <%# GetTypeName(DataBinder.Eval(Container, "DataItem.type").ToString().Trim())%>
                </ItemTemplate>
            </asp:TemplateColumn>
            <asp:BoundColumn DataField="typename" HeaderText="所属分类"></asp:BoundColumn>
            <asp:TemplateColumn HeaderText="难度">
                <ItemTemplate>
                    <%#DifficultyStr(DataBinder.Eval(Container, "DataItem.difficulty").ToString())%>
                </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="操作">
                <ItemTemplate>
                    <a href="subjectedit.aspx?sortid=<%# DataBinder.Eval(Container, "DataItem.sortid").ToString() %>&id=<%# DataBinder.Eval(Container, "DataItem.id").ToString() %>&aciton=<%=action %>">
                        编辑</a>
                </ItemTemplate>
            </asp:TemplateColumn>
        </Columns>
        <PagerStyle Mode="NumericPages"></PagerStyle>
        <SelectedItemStyle CssClass="datagridSelectedItem"></SelectedItemStyle>
        <HeaderStyle CssClass="category"></HeaderStyle>
    </cc1:DataGrid>
    <div class="Navbutton" style="width: 98%;">
        <table cellspacing="1" cellpadding="4" align="left">
            <tr>
                <td align="left">
                    &nbsp;
                    <button type="button" class="ManagerButton" onclick="window.location='subjectsearch.aspx?sortid=<%=sortid%>';">
                        <img src="images/search.gif" />搜索题目</button>&nbsp;
                    <button type="button" class="ManagerButton" onclick="window.location='subjectimport.aspx?sortid=<%=sortid%>';">
                        <img src="images/filetype/xls.gif" />导入题目</button>&nbsp;
                    <button class="ManagerButton" type="button" onclick="javascript:Export('subjectmanage.aspx?sortid=<%=sortid%>&export=1');">
                            <img src="images/icon16/export.gif" />导出题目
                    </button>&nbsp;
                    <button type="button" class="ManagerButton" onclick="window.location='exammanage.aspx?sortid=<%=sortid%>';">
                        <img src="images/icon16/exammanage.gif" />考试管理</button>
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
