Hidistro.UI.Web/Admin/Shop/Hi_Ajax_GetGames.cs
(开头部分) 3KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Data;
using System.Text;
using System.Web;
using ControlPanel.Promotions;
using Hidistro.Core;
using Hidistro.Core.Entities;
using Hidistro.Core.Enums;
using Hidistro.Entities.Promotions;
namespace Hidistro.UI.Web.Admin.Shop
{
public class Hi_Ajax_GetGames : IHttpHandler
{
public GameSearch GetGameSearch(HttpContext context)
{
return new GameSearch { Status = "0", GameType = new int?((context.Request.Form["type"] == null) ? 1 : Convert.ToInt32(context.Request.Form["type"])), PageIndex = (context.Request.Form["p"] == null) ? 1 : Convert.ToInt32(context.Request.Form["p"]), SortOrder = SortAction.Desc, EndTime = new DateTime?(DateTime.Now), SortBy = "GameId" };
}
public string GetGamesListJson(DbQueryResult CouponsTable, HttpContext context)
{
StringBuilder builder = new StringBuilder();
builder.Append("\"list\":[");
DataTable data = (DataTable)CouponsTable.Data;
for (int i = 0; i < data.Rows.Count; i++)
{
builder.Append("{");
builder.Append("\"game_id\":\"" + data.Rows[i]["GameId"].ToString() + "\",");
builder.Append("\"title\":\"" + data.Rows[i]["GameTitle"].ToString() + "\",");
builder.Append("\"create_time\":\"" + DateTime.Now + "\",");
builder.Append("\"type\":\"" + data.Rows[i]["GameType"].ToString() + "\",");
builder.Append("\"link\":\"" + data.Rows[i]["GameUrl"].ToString() + "\"");
builder.Append("},");
}
return (builder.ToString().TrimEnd(new char[] { ',' }) + "]");
}
public DbQueryResult GetGamesTable(HttpContext context)
{
return GameHelper.GetGameList(this.GetGameSearch(context));
}
public string GetModelJson(HttpContext context)
{
DbQueryResult gamesTable = this.GetGamesTable(context);
int pageCount = TemplatePageControl.GetPageCount(gamesTable.TotalRecords, 10);
if (gamesTable != null)
{
string str = "{\"status\":1,";
return (((str + this.GetGamesListJson(gamesTable, context) + ",") + "\"page\":\"" + this.GetPageHtml(pageCount, context) + "\"") + "}");
}
return "{\"status\":1,\"list\":[],\"page\":\"\"}";
}
public string GetPageHtml(int pageCount, HttpContext context)
{
int pageIndex = (context.Request.Form["p"] == null) ? 1 : Convert.ToInt32(context.Request.Form["p"]);
return TemplatePageControl.GetPageHtml(pageCount, pageIndex);
}
后面还有 17 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。
