| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324 |
- <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="questionmanage.aspx.cs"
- Inherits="HySoft.BaseCallCenter.Web.askmanage.questionmanage" %>
- <!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="../scripts/ui/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
- <script src="../scripts/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
- <script src="../scripts/jquery/jquery-1.8.3.min.js" type="text/javascript"></script>
- <script src="../scripts/ui/js/core/base.js" type="text/javascript"></script>
- <script src="../scripts/ui/js/ligerui.min.js" type="text/javascript"></script>
- <link href="../scripts/ui/skins/Tab/css/tab.css" rel="stylesheet" type="text/css" />
- <link href="../scripts/ui/skins/Tab/css/grid.css" rel="stylesheet" type="text/css" />
- <script src="../scripts/ui/js/plugins/ligerGrid.js" type="text/javascript"></script>
- <script src="../scripts/ui/js/plugins/ligerLayout.js" type="text/javascript"></script>
- <script src="../scripts/ui/js/plugins/ligerTree.js" type="text/javascript"></script>
- <script src="../scripts/ui/js/plugins/ligerMenu.js" type="text/javascript"></script>
- <script src="../scripts/CustomersData.js" type="text/javascript"></script>
- <link href="../scripts/ui/skins/ligerui-icons.css" rel="stylesheet" type="text/css" />
- <script src="../scripts/My97DatePicker/lang/zh-cn.js" type="text/javascript"></script>
- <link href="../images/style.css" rel="stylesheet" type="text/css" />
- <script type="text/javascript">
- var selectcategoryid = "";
- var categorylist;
- var questionlist;
- function LoadCategoryList() {
- categorylist=$("#divCategoryList").ligerGrid({
- height: '97%',
- width: 230,
- columns: [
- { display: '试题分类', width: '86%', name: '_f_categoryname' }
- ],
- toolbar: {
- items: [
- { text: '增加', click: itemclick1, icon: 'add' },
- { line: true },
- { text: '修改', click: itemclick1, icon: 'modify' },
- { line: true },
- { text: '删除', click: itemclick1, icon: 'delete' }
- ]
- },
- url: 'ajax/questioncategory.ashx?action=getlist', pageSize: 50, pageSizeOptions: [10, 20, 50], rownumbers: true,
- onSelectRow: function (data, rowindex, rowobj) {
- selectcategoryid = data._f_categoryid;
- LoadQuestionList();
- },
- onDblClickRow: function (data, rowindex, rowobj) {
- var id = "";
- try {
- id = data._f_categoryid;
- }
- catch (e) {
- }
- if (id != "") {
- $.ligerDialog.open({ url: 'questioncategoryedit.aspx?otype=modify&id=' + id, title: '修改分类', height: 200, width: 380, isResize: true
- });
- }
- else {
- $.ligerDialog.error('没有选择要修改的分类,请选择');
- }
- }
- });
- $("#pageloading").hide();
- }
- function LoadQuestionList() {
- var selecttype = document.getElementById("dropQuestionType").value;
- var key=escape(document.getElementById("txtKeywords").value);
- questionlist=$("#divQuestionList").ligerGrid({
- height: '97%',
- columns: [
- { display: '试题分类', width: '120', name: '_f_categoryname' },
- { display: '试题类型', width: '80', name: '_f_type', render: function (rowdata, rowindex, value) {
- if (value == "1")
- return "<img src='../images/help_question_mark_24.png' style='width:18px' /> <font color='red'>问答题</font>";
- else if(value == "2")
- return "<img src='../images/radio_button_off_16.png' style='width:16px' /> <font color='green'>单选题</font>";
- else if (value == "3")
- return "<img src='../images/check_box_24.png' style='width:18px' /> <font color='blue'>多选题</font>";
- else
- return "";
- }
- },
- { display: '试题标题', align: 'left', width: '350', name: '_f_title' },
- { display: '试题内容', align:'left', width: '550', name: '_f_content' }
- ],
- toolbar: {
- items: [
- { text: '增加', click: itemclick2, icon: 'add' },
- { line: true },
- { text: '修改', click: itemclick2, icon: 'modify' },
- { line: true },
- { text: '删除', click: itemclick2, icon: 'delete' },
- { line: true },
- { text: '所有试题', click: itemclick2, icon: 'attibutes' }
- ]
- },
- url: 'ajax/question.ashx?action=getlist&categoryid=' + selectcategoryid + '&selecttype=' + selecttype+'&key='+key, pageSize: 50, pageSizeOptions: [10, 20, 50], rownumbers: true,
- onSelectRow: function (data, rowindex, rowobj) {
- },
- onDblClickRow: function (data, rowindex, rowobj) {
- var vheight = $("#form1").height() - 30;
- var vwidth = $("#form1").width() * 0.9;
- if (vwidth > 700) {
- vwidth = 700;
- }
- var id = "";
- var vtitle = "修改试题";
- try {
- id = data._f_questionid;
- vtitle = "【<font color='red'>" + data._f_title + "</font>】修改试题";
- }
- catch (e) {
- }
- if (id != "") {
- var selecttype = document.getElementById("dropQuestionType").value;
- $.ligerDialog.open({ url: 'questionedit.aspx?otype=modify&id=' + id, title: vtitle, height: vheight, width: vwidth, isResize: true
- });
- }
- else {
- $.ligerDialog.error('没有选择要修改的试题,请选择');
- }
- }
- });
- $("#pageloading").hide();
- }
- function itemclick1(item) {
- switch (item.icon) {
- case "add":
- $.ligerDialog.open({ url: 'questioncategoryedit.aspx?otype=new', title: '添加分类', height: 200, width: 380, isResize: true
- });
- break;
- case "modify":
- var id = "";
- try {
- var rowobj = categorylist.getSelectedRow();
- id = rowobj._f_categoryid;
- }
- catch (e) {
- }
- if (id != "") {
- $.ligerDialog.open({ url: 'questioncategoryedit.aspx?otype=modify&id=' + id, title: '修改分类', height: 200, width: 380, isResize: true
- });
- }
- else {
- $.ligerDialog.error('没有选择要修改的分类,请选择');
- }
- break;
- case "delete":
- var id = "";
- var rowobj;
- try {
- rowobj = categorylist.getSelectedRow();
- id = rowobj._f_categoryid;
- }
- catch (e) {
- }
- if (id != "") {
- $.ligerDialog.confirm('确定要删除【<font color="red">' + rowobj._f_categoryname + '</font>】吗?', function (yes) {
- if (yes) {
- $.post("ajax/questioncategory.ashx?action=delete&id=" + id, function (data) {
- if (data == "success") {
- $.ligerDialog.success('删除成功');
- LoadCategoryList();
- }
- else if (data == "error") {
- $.ligerDialog.error('删除失败');
- }
- else {
- $.ligerDialog.error('删除失败,此分类下有【<font color="red">' + data + '</font>】个关联试题,无法删除');
- }
- });
- }
- });
- }
- else {
- $.ligerDialog.error('没有选择要删除的分类,请选择');
- }
- break;
- }
- }
- function itemclick2(item) {
- switch (item.icon) {
- case "add":
- var vheight = $("#form1").height() - 30;
- var vwidth = $("#form1").width() * 0.9;
- if (vwidth > 700) {
- vwidth = 700;
- }
- var id = "";
- var vtitle = "添加试题";
- var rowobj;
- try {
- rowobj = categorylist.getSelectedRow();
- id = rowobj._f_categoryid;
- vtitle = "【<font color='red'>" + rowobj._f_categoryname + "</font>】分类下添加试题";
- }
- catch (e) {
- }
- var selecttype = document.getElementById("dropQuestionType").value;
- $.ligerDialog.open({ url: 'questionedit.aspx?otype=new&categoryid=' + id + '&selecttype=' + selecttype, title: vtitle, height: vheight, width: vwidth, isResize: true
- });
- break;
- case "modify":
- var vheight = $("#form1").height() - 30;
- var vwidth = $("#form1").width() * 0.9;
- if (vwidth > 700) {
- vwidth = 700;
- }
- var id = "";
- var vtitle = "修改试题";
- var rowobj;
- try {
- rowobj = questionlist.getSelectedRow();
- id = rowobj._f_questionid;
- vtitle = "【<font color='red'>" + rowobj._f_title + "</font>】修改试题";
- }
- catch (e) {
- }
- if (id != "") {
- var selecttype = document.getElementById("dropQuestionType").value;
- $.ligerDialog.open({ url: 'questionedit.aspx?otype=modify&id=' + id, title: vtitle, height: vheight, width: vwidth, isResize: true
- });
- }
- else {
- $.ligerDialog.error('没有选择要修改的试题,请选择');
- }
- break;
- case "delete":
- var id = "";
- var rowobj;
- try {
- rowobj = questionlist.getSelectedRow();
- id = rowobj._f_questionid;
- }
- catch (e) {
- }
- if (id != "") {
- $.ligerDialog.confirm('确定要删除【<font color="red">' + rowobj._f_title + '</font>】试题吗?', function (yes) {
- if (yes) {
- $.post("ajax/question.ashx?action=delete&id=" + id, function (data) {
- if (data == "success") {
- $.ligerDialog.success('删除成功');
- LoadQuestionList();
- }
- else{
- $.ligerDialog.error('删除失败');
- }
- });
- }
- });
- }
- else {
- $.ligerDialog.error('没有选择要删除的试题,请选择');
- }
- break;
- case "attibutes":
- selectcategoryid = "";
- LoadQuestionList();
- break;
- }
- }
- $(function () {
- //var vheight = $("#form1").height();
- //document.getElementById("tableMessage").style.height = vheight - 80;
- LoadCategoryList();
- LoadQuestionList();
- });
- document.onkeydown = function (event) {
- var e = event || window.event || arguments.callee.caller.arguments[0];
- if (e && e.keyCode == 13) {
- LoadQuestionList();
- }
- };
- </script>
- </head>
- <body>
- <form id="form1" runat="server">
- <div class="tools_box">
- <asp:HiddenField ID="hdF_FunctionId" runat="server" />
- <asp:HiddenField ID="hdF_ModuleId" runat="server" />
- <div class="tools_bar">
- <div class="search_box">
- 题型:<asp:DropDownList ID="dropQuestionType" runat="server" onchange="LoadQuestionList();" CssClass="selectBox" Width="120px">
- <asp:ListItem Value="" Text="所有题型"></asp:ListItem>
- <asp:ListItem Value="1" Text="问答题"></asp:ListItem>
- <asp:ListItem Value="2" Text="单选题"></asp:ListItem>
- <asp:ListItem Value="3" Text="多选题"></asp:ListItem>
- </asp:DropDownList>
- 关键字:<asp:TextBox ID="txtKeywords" runat="server" CssClass="txtInput"></asp:TextBox>
- <input id="btnSearch" type="button" value="搜 索" class="btnSearch" onclick="LoadQuestionList();" />
- </div>
- </div>
- </div>
- <table id="tableMessage" cellpadding="3" cellspacing="3" border="0" style="width: 100%;">
- <tr>
- <td valign="top" style="width: 230px; padding: 0px 2px 5px 2px;">
- <div class="tools_box" style="height: 30px;">
- <div class="tools_bar">
- <div style="float: left; padding-top: 6px; padding-left: 1px; font-weight: bold;
- color: red;">
- <img src="../images/icon_site.gif" /> 试题分类</div>
- </div>
- </div>
- <div id="divCategoryList">
- </div>
- </td>
- <td valign="top" style="padding: 0px 2px 5px 2px;">
- <div class="tools_box" style="height: 30px;">
- <div class="tools_bar">
- <div style="float: left; padding-top: 6px; padding-left: 1px; font-weight: bold;
- color: red;">
- <img src="../images/icon_attach.png" /> 试题列表</div>
- </div>
- </div>
- <div id="divQuestionList">
- </div>
- </td>
- </tr>
- </table>
- </form>
- </body>
- </html>
|