<%@ page language="C#" autoeventwireup="true" inherits="ExemOptionsSettingLFRM, App_Web_t61aasr1" stylesheettheme="Themes" theme="Themes" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" 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 runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title></title>



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

    <script type="text/javascript" src="../Js/jquery.pngFix.pack.js"></script>

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

    <script type="text/javascript" src="../Js/InterfaceContrl.js"></script>
</head>
<body>
<div id="loading">
        <div style="position: absolute; top: 0px; left: 0px; width: 100%; height: 100%; background-color: #ffffff;
            z-index: 10; filter: alpha(opacity=90); opacity: 0.9;">
        </div>
        <div id="msg_area" style="z-index: 200; left: 289px; position: absolute; top: 202px;">
            <div id="msgPanel" style="z-index: 200;" height="24px" width="100px" bordercolor="#eeeeee"
                borderstyle="Solid" borderwidth="1px">
                <asp:Image ID="img" runat="server" ImageUrl="~/images/loading.gif" />
                <font style="font-size: 9pt;color:Gray;">loading...读取中......</font>
            </div>
        </div>
    </div>
    <form id="form1" runat="server" defaultbutton="btnSearch">
    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" 
                    runat="server">
                </asp:ToolkitScriptManager>
                &nbsp;<asp:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server" TargetControlID="txtCourseName"
    CompletionSetCount="12" CompletionInterval="1" EnableCaching="true" MinimumPrefixLength="1"
    ServicePath="../services/AutoComplete.asmx" ServiceMethod="GetCourseNameList">
                </asp:AutoCompleteExtender>
    <table cellpadding="0" cellspacing="0" class="table_box">
        <tr>
            <td class="right_bg">
                <span class="right_title">
                    <img src="../Images/homen.gif" class="img_style" />
                    您的当前位置：考试管理 > 设置课程考试 </span>
            </td>
        </tr>
        <tr>
            <td class="r_top_box">
                <table cellspacing="0" cellpadding="5" class="r_top_title_box">
            <tr>
                <td align="right" width="80px">
                   课程名称：
                </td>
                <td width="200px">
                    <asp:DropDownList ID="ddlSubject" runat="server" AppendDataBoundItems="True" Width="200px"
                        AutoPostBack="True" 
                        OnSelectedIndexChanged="ddlSubject_SelectedIndexChanged" Visible="False">
                        <asp:ListItem Value="0">全部</asp:ListItem>
                    </asp:DropDownList>
                    <asp:TextBox ID="txtCourseName" runat="server" Width="195px"></asp:TextBox>
                </td>
                <td colspan="2" align="right">
                    <asp:Button
                        ID="btnSearch" runat="server" SkinID="big_btn" Text="查询已设课程" OnClick="btnSearch_Click" 
                       />
                    &nbsp;<asp:Button ID="btnAdd" runat="server" SkinID="big_btn" Text="添加考试设置" OnClick="btnAdd_Click" />
                    &nbsp;&nbsp;<asp:Button ID="btnDel" runat="server" Text="删 除" OnClick="btnDel_Click" 
                        Visible="False" />
                </td>
            </tr>
        </table>
            </td>
        </tr>
        <tr>
            <td class="margintop5">
                <table cellpadding="0" cellspacing="0" width="100%">
                    <tr>
                        <td>
        <asp:GridView ID="gvExemOptionsSetting" runat="server" AllowPaging="True" AutoGenerateColumns="False"
            DataKeyNames="ExamID,CourseID,SetType" OnRowCommand="gvExemOptionsSetting_RowCommand"
            OnRowDataBound="gvExemOptionsSetting_RowDataBound">
            <PagerSettings Visible="False" />
            <Columns>
                <asp:BoundField DataField="Name" HeaderText="课程" />
                <asp:BoundField DataField="IsCanRetry" HeaderText="重考" />
                <asp:BoundField DataField="ReExam" HeaderText="重考次数" />
                <asp:BoundField DataField="ShowAnswer" HeaderText="显示错题" />
                <asp:BoundField DataField="Exercise" HeaderText="练习" />
                <asp:BoundField DataField="ExamDate" HeaderText="考试时限" Visible="false" />
                <asp:BoundField DataField="ExamTime" HeaderText="考试时间" />
                <asp:BoundField DataField="PassMark" HeaderText="合格分数" />
                <asp:BoundField DataField="SetMarkType" HeaderText="分数设置方式" />
                <asp:BoundField DataField="SetType" HeaderText="试题生成方式" />
                <asp:BoundField DataField="RadioButtons" HeaderText="单选数量" Visible="false" />
                <asp:BoundField DataField="CheckBoxs" HeaderText="多选数量" Visible="false" />
                <asp:BoundField DataField="Opinions" HeaderText="判断数量" Visible="false" />
                 <asp:BoundField DataField="Answer" HeaderText="问答数量" Visible="false" />
                <asp:BoundField DataField="Cloze" HeaderText="填空数量" Visible="false" />
                <asp:TemplateField HeaderText="状态">
                   
                    <ItemTemplate>
                        <asp:Label ID="lblState" runat="server" ></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="操作">
                    <ItemTemplate>
                        <asp:LinkButton ID="ibtnGet" runat="server" CommandName="modify" Text="编辑" />
                        <asp:LinkButton ID="lbtnChangeState" runat="server" CommandName="change"  />
                        <asp:HiddenField ID="hideState" runat="server" />
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <EmptyDataTemplate>
                <asp:Label ID="lblEmpty" runat="server" Text="没有符合条件的数据！"></asp:Label>
            </EmptyDataTemplate>
            <EmptyDataRowStyle HorizontalAlign="Center" />
            <EditRowStyle Wrap="True" />
        </asp:GridView>
   </td>
                    </tr>
                    <tr>
                        <td class="page_bg_left">
         <cc1:AspNetPager ID="myAspNetPager" runat="server" AlwaysShow="True" CssClass="cut_pager" PageSize="10"
                                FirstPageText="首页&nbsp;&nbsp;" HorizontalAlign="Right" InputBoxStyle="width:20px;" 
                                LastPageText="尾页" NextPageText="&nbsp;&nbsp;下一页&nbsp;&nbsp;" NumericButtonTextFormatString="  {0}"
                                OnPageChanging="AspNetPager1_PageChanging" PrevPageText="上一页"  ShowCustomInfoSection="Left" CustomInfoTextAlign="Left"
                                ShowInputBox="Always">
                            </cc1:AspNetPager>
    </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    </form>
         <script type="text/javascript">
             $("#loading").fadeOut()
</script>
</body>

<script type="text/javascript">
    function CheckAll() {
        var cked = false;
        cked = document.getElementById("chkSelAll").checked;
        for (var i = 0; i < document.getElementsByTagName("*").length; i++) {
            var e = document.getElementsByTagName("*")[i];
            try {
                if (e.name.substring(e.name.length - 6, e.name.length) == "chkSel") {
                    e.checked = cked;
                }
            }
            catch (exception) {
            }
        }
    }
    function CheckSelect() {
        var count = 0;
        for (var i = 0; i < document.getElementsByTagName("*").length; i++) {
            var e = document.getElementsByTagName("*")[i];
            try {
                if (e.name.substring(e.name.length - 6, e.name.length) == "chkSel") {
                    if (e.checked == true) {
                        count++;
                    }
                }
            }
            catch (exception) {
            }
        }
        if (count == 0) {
            //alert("请选择您要删除的项！");
            art.dialog({ content: '请选择您要删除的项！', lock: true, icon: 'alert', width: '200px' }, function() { return true; });
            return false;
        }
        else {
            return confirm('您确定要删除所选项吗?');
        }
    }
</script>

</html>
