WebUI/Admin/ChangeCategoryInfo.ashx

(完整代码) 1KB

<%@ WebHandler Language="C#" Class="ChangeCategoryInfo" %>

using System;
using System.Web;
using System.Data.SqlClient;
using System.Collections.Generic;
using System.Data;
using BLL;
using Model;
public class ChangeCategoryInfo : IHttpHandler {
    
    public void ProcessRequest (HttpContext context) {
        if (context.Request.UrlReferrer != null)//防止用户直接访问本页面
        {
            int CategoryID = int.Parse(context.Request["id"].ToString());
            context.Response.ContentType = "text/plain";
            context.Response.Write(GetProfession(CategoryID));//这个是从数据库中根据传来类别的code查询出来的。
            context.Response.End();
        }
    }
    public string GetProfession(int CategoryID)
    {
        List<ProfessionMOD> ProfessionList = ProfessionBLL.GetProfession(CategoryID);//逻辑层
        string str = "";
        for (int i = 0; i < ProfessionList.Count; i++)
        {
            if (i == ProfessionList.Count - 1)
            {
                str += ProfessionList[i].ID.ToString() + "," + ProfessionList[i].Name.ToString();
            }
            else
            {
                str += ProfessionList[i].ID .ToString() + "," + ProfessionList[i].Name.ToString() + "|";
            }
        }
        return str.Trim();
    }
    public bool IsReusable {
        get {
            return false;
        }
    }

}

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

AI 解读 AI

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

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