WEBUI/PageModel/DisPatch_Manage/inc/Ajax.ashx

(开头部分) 2KB

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

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

using System;
using System.Web;
using Logistics.BLL;
using System.Data;
using Logistics.Model;

public class Ajax : IHttpHandler
{

    public void ProcessRequest(HttpContext context)
    {
        context.Response.ContentType = "text/plain";
        HttpRequest request = context.Request;
        HttpResponse response = context.Response;
        string action = request.QueryString["action"];
        switch (action)
        {
            case "1": getdistance(request, response); break;
            case "2": getcarinfo(request, response); break;
        };
    }

    private static void getdistance(HttpRequest request, HttpResponse response)
    {
        DataTable dt;
        Roadinfo ri = new Roadinfo();
        try
        {
            int s_cityid = int.Parse(request.QueryString["s_id"]);
            int a_cityid = int.Parse(request.QueryString["a_id"]);
            dt = ri.getAllRoadinfo("Roadinfo_Startcity=" + s_cityid.ToString().Trim() + " and Roadinfo_Endcity=" + a_cityid.ToString().Trim());
            if (dt.Rows.Count < 1)
            {
                response.Write("1,没有这条线路的里程信息!");
            }
            else
            {
                response.Write("0," + dt.Rows[0]["Roadinfo_Distance"].ToString() + "," + dt.Rows[0]["Roadinfo_ID"].ToString());
            }
        }
        catch
        {
            response.Write("1,数据读取出错!");
        }
    }

    private static void getcarinfo(HttpRequest request, HttpResponse response)
    {
        DataTable dt;
        var d = new Logistics_Driver();
        Car c = new Car();
        try
        {
            int car_id = int.Parse(request.QueryString["car_id"]);
            dt = c.getModelListByWhere("Car_ID=" + car_id.ToString());
            if (dt.Rows.Count < 1)
            {
                response.Write("1,没有此车辆的信息!");
后面还有 28 行代码,购买后查看完整代码

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

AI 解读 AI

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

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