WebApplication/Admin/Ajax/getcachedata.ashx.cs
(完整代码) 2KBusing System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
namespace WebApplication.Admin.Ajax
{
/// <summary>
/// getcachedata 的摘要说明
/// </summary>
public class getcachedata : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
//context.Response.Write("Hello World");
if (context.Request["qtype"] != null)
{
BLL.Models.GZXX_Model mll = new BLL.Models.GZXX_Model();
DataTable dt = mll.GetDataTable("*", "[GZXX_U_Questions]", " where [KnowledgeID] = " + context.Request["qtype"] + " and [QuestionType] in ("+context.Request["questiontype"]+") and verify = 1", 10 * (int.Parse(context.Request["currentsize"]) - 1), 10, null, " order by InfoID desc ");
string haveinfoid = "|"+context.Request["infoids"].ToString()+"|";
string html = string.Empty;
int count = mll.GetCount("GZXX_U_Questions", " where [KnowledgeID] = " + context.Request["qtype"] + " and [QuestionType] in (" + context.Request["questiontype"] + ") and verify = 1", null);
for (int i = 0; i < dt.Rows.Count; i++)
{
string ck = "";
if (haveinfoid.IndexOf("|" + dt.Rows[i]["InfoID"].ToString() + "|") >= 0)
{
ck = "\" checked = 'checked' \"";
}
html += "<div class=\"itemdiv\" style=\"width:5%\"><input name=\"ckb\" onclick=\"setcache(this);\" "+ck+" id=\"Chk" + dt.Rows[i]["InfoID"].ToString() + "\" type=\"checkbox\" cv=\"" + dt.Rows[i]["Content"].ToString() + "\" /></div>";
html += "<div class=\"itemdiv\" style=\"width:8%\">"+dt.Rows[i]["InfoID"].ToString()+"</div>";
html += "<div class=\"itemdiv\" style=\"width:17%\">"+dt.Rows[i]["QuestionType"].ToString()+"</div>";
html += "<div class=\"itemdiv\" style=\"width:68%;white-space: nowrap;overflow-x: hidden;\">"+dt.Rows[i]["Content"].ToString()+"</div>";
html += "<div style=\"clear:both\"></div>";
}
context.Response.Write("操作成功!@@@" + html + "@@@" + Math.Ceiling(double.Parse(count.ToString()) / 10).ToString());
}
else
{
context.Response.Write("参数错误!@@@");
}
}
public bool IsReusable
{
get
{
return false;
}
}
}
}
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
