Meeting/Admin/Ajax/getresultdata.ashx.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;

namespace WebApplication.Admin.Ajax
{
    /// <summary>
    /// getresultdata 的摘要说明
    /// </summary>
    public class getresultdata : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            if (context.Request["infoids"] != null)
            {
                BLL.Models.GZXX_Model mll = new BLL.Models.GZXX_Model();
                string html = string.Empty;
                int count = 0;
                if (context.Request["infoids"] == "") { }
                else
                {
                    DataTable dt = mll.GetDataTable("*,(select title from GZXX_U_Knowledge where GZXX_U_Knowledge.InfoID = GZXX_U_Questions.KnowledgeID) as KnowledgeName", "[GZXX_U_Questions]", " where InfoID in (" + context.Request["infoids"].ToString().Replace("|", ",") + ") and verify = 1 ", 10 * (int.Parse(context.Request["currentsize"]) - 1), 10, null, " order by InfoID desc ");

                    count = mll.GetCount("GZXX_U_Questions", " where InfoID in (" + context.Request["infoids"].ToString().Replace("|", ",") + ")", null);
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        html += "<div style=\"clear:both;border-bottom:1px dashed #ccc;height:84px;width:98%\"><div class=\"itemdiv\" style=\"width:5%\">" + dt.Rows[i]["InfoID"].ToString() + "</div>";
                        html += "<div class=\"itemdiv\" style=\"width:10%\">" + dt.Rows[i]["QuestionType"].ToString() + "</div>";
                        html += "<div class=\"itemdiv\" style=\"width:25%\">" + dt.Rows[i]["KnowledgeName"].ToString() + "</div>";
                        html += "<div class=\"itemdiv\" style=\"width:58%;white-space: nowrap;overflow-x: hidden;\">" + dt.Rows[i]["Content"].ToString() + "</div>";
                       
                        html += "<div class=\"itemdiv\" style=\"width:93%;text-align:left;margin-left:2%\">正确答案:" + ReturnResult(dt.Rows[i]["Answer"].ToString()) + "</div>";
                        
                        html += "<div class=\"itemdiv Ctd\" style=\"width:5%\"><a class=\"delete\" onclick=\"removeresult(this,'" + dt.Rows[i]["InfoID"].ToString() + "')\"></a></div>";
                        html += "</div>";
                    }
                }
                context.Response.Write("操作成功!@@@" + html + "@@@" + Math.Ceiling(double.Parse(count.ToString()) / 10).ToString());
            }
            else
            {
                context.Response.Write("参数错误!@@@");
            }
        }

        public string ReturnResult(string result)
        {
            if (result == "0") { return "错误"; }
            else if (result == "1") { return "正确"; }
            else { return result; }
        }

        public bool IsReusable
        {
            get
            {
后面还有 5 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。