<%@ page language="C#" enableeventvalidation="false" autoeventwireup="true" inherits="ExamQuestionLFRM, App_Web_t61aasr1" stylesheettheme="Themes" theme="Themes" %>

<%@ 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 id="Head1" runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>

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

    <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>
    
        <script src="../js/artDialog3/artDialog.min.js"></script>
      <script>          (function($) { var d = $.dialog.defaults; d.skin = ['chrome']; })(art);</script>

    <style>
        html
        {
            overflow-x: hidden;
        }
    </style>
</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">
    <table cellpadding="0" cellspacing="0" class="table_box">
        <tr>
            <td class="right_bg">
                <span class="right_title" id="divTitle" runat="server">
                    <img src="../Images/homen.gif" class="img_style" />
                    您的当前位置：<asp:Label ID="lblnum" runat="server" Text="Label"></asp:Label> </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 style="width: 150px">
                            <asp:DropDownList ID="ddlSubject" runat="server" Width="150px">
                            </asp:DropDownList>
                        </td>
                        <td align="right" width="80px">
                            题目类型：
                        </td>
                        <td style="width: 70px">
                            <asp:DropDownList ID="ddlExerciseType" runat="server" Width="70px" AppendDataBoundItems="True"
                                AutoPostBack="True" OnSelectedIndexChanged="ddlExerciseType_SelectedIndexChanged">
                                <asp:ListItem Value="0">全部</asp:ListItem>
                                <asp:ListItem Value="1">单选</asp:ListItem>
                                <asp:ListItem Value="2">多选</asp:ListItem>
                                <asp:ListItem Value="3">判断</asp:ListItem>
                                <asp:ListItem Value="4">问答</asp:ListItem>
                                <asp:ListItem Value="5">填空</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                        <td align="right" style="width: 70px">
                            难&nbsp;&nbsp;&nbsp;&nbsp;度：
                        </td>
                        <td align="left" width="70px">
                            <asp:DropDownList ID="ddlDifficulty" runat="server" Width="70px" 
                                AppendDataBoundItems="True" AutoPostBack="True" 
                                onselectedindexchanged="ddlDifficulty_SelectedIndexChanged">
                                <asp:ListItem Value="0">全部</asp:ListItem>
                                <asp:ListItem Value="1">容易</asp:ListItem>
                                <asp:ListItem Value="2">普通</asp:ListItem>
                                <asp:ListItem Value="3">困难</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                        <td align="right">
                            <asp:Button ID="btnAdd" runat="server" Text="添加试题" OnClick="btnAdd_Click1" />
                            &nbsp;<asp:Button ID="btnLeadIn" runat="server" Text="导入试题" OnClick="btnLeadIn_Click" />
                            &nbsp;<asp:Button ID="btnReturn" runat="server" OnClick="btnReturn_Click" Text="返回"
                                Visible="False" />
                        </td>
                    </tr>
                    <tr>
                        <td align="right" width="80px">
                            &nbsp;题&nbsp;&nbsp;&nbsp;&nbsp;目：
                        </td>
                        <td style="width: 150px">
                            <asp:DropDownList ID="ddlState" runat="server" Width="70px" AppendDataBoundItems="True"
                                Visible="False">
                                <asp:ListItem Value="0">全部</asp:ListItem>
                                <asp:ListItem Value="1">在用</asp:ListItem>
                                <asp:ListItem Value="2">停用</asp:ListItem>
                            </asp:DropDownList>
                            <asp:TextBox ID="txtExercise" runat="server" MaxLength="50" Width="140"></asp:TextBox>
                        </td>
                        <td align="right" width="80px">
                            <asp:Button ID="btnSearch" runat="server" Text="查 询" OnClick="btnSearch_Click" />
                        </td>
                        <td colspan="2" width="140">
                            &nbsp;
                        </td>
                        <td align="center">
                            &nbsp;
                        </td>
                        <td align="right">
                            <asp:Button ID="btnModify" runat="server" Text="批量修改" OnClick="btnModify_Click" />
                            &nbsp;<asp:Button ID="btnDelete" runat="server" Text="删 除" OnClick="btnDelete_Click" />
                            &nbsp;<asp:Button ID="btnLeadOut" runat="server" Text="导出试题" OnClick="btnLeadOut_Click"
                                Enabled="False" />&nbsp;&nbsp;
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td class="margintop5">
                <table cellpadding="0" cellspacing="0" width="100%">
                    <tr>
                        <td>
                            <asp:GridView ID="gvExamQuestion" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                                DataKeyNames="ThemaID" OnRowCommand="gvExamQuestion_RowCommand" OnRowDataBound="gvExamQuestion_RowDataBound"
                                Width="100%">
                                <PagerSettings Visible="False" />
                                <Columns>
                                    <asp:TemplateField>
                                        <HeaderTemplate>
                                            全选<input id="chkSelAll" name="chkSelAll" onclick="javascript:CheckAll();" type="checkbox">
                                        </HeaderTemplate>
                                        <HeaderStyle Width="50px" />
                                        <ItemTemplate>
                                            <asp:CheckBox ID="chkSel" runat="server" />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:BoundField DataField="Name" HeaderText="课程">
                                        <HeaderStyle Width="80px" />
                                        <ItemStyle Width="80px" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="Question" HeaderText="问题">
                                        <HeaderStyle Width="300px" />
                                        <ItemStyle Width="300px" HorizontalAlign="Left" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="Type" HeaderText="问题类型">
                                        <HeaderStyle Width="70px" />
                                        <ItemStyle Width="70px" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="Difficulty" HeaderText="试题难度">
                                        <HeaderStyle Width="70px" />
                                        <ItemStyle Width="70px" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="State" HeaderText="试题状态" Visible="false">
                                        <HeaderStyle Width="70px" />
                                        <ItemStyle Width="70px" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="Mark" HeaderText="题目分数">
                                        <HeaderStyle Width="70px" />
                                        <ItemStyle Width="70px" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="CreateTime" DataFormatString="{0:d}" HeaderText="创建时间">
                                        <HeaderStyle Width="100px" />
                                        <ItemStyle Width="100px" />
                                    </asp:BoundField>
                                    <asp:TemplateField HeaderText="操作">
                                        <ItemTemplate>
                                            <asp:LinkButton ID="ibtnEdit" runat="server" CommandName="edit" Text="编辑" />
                                        </ItemTemplate>
                                        <HeaderStyle Width="70px" />
                                        <ItemStyle Width="70px" />
                                    </asp:TemplateField>
                                </Columns>
                                <EmptyDataTemplate>
                                    <asp:Label ID="lblEmpty" runat="server" Text="没有符合条件的数据！"></asp:Label>
                                </EmptyDataTemplate>
                                <EmptyDataRowStyle Font-Size="XX-Large" Font-Bold="true" ForeColor="Red" 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">
    $(document).ready(function() {
        Validator();
    });
    function Validator() {
        /* $('#<%= btnSearch.ClientID %>').bind('click', function() {
        ValidateDropdownList($("#<%=ddlSubject.ClientID%>"), "���Կ�Ŀ");                         
        return GetValidatorMessage();
        });*/
    }
    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 CheckSelectModify() {
        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;
        }
    }
    function CheckSelect() {
        var num = document.getElementById("ddlSubject").value;
        if (num == 0) {
            //alert("只能批量删除同一科目的试题！请选择科目查询后删除！");
            art.dialog({ content: '只能批量删除同一科目的试题！请选择科目查询后删除！', lock: true, icon: 'alert', width: '200px' }, function() { return true; });
            return false;
        }
        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>
