Views/Set/System/MicroDataTable.ashx

(开头部分) 26KB

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

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

using System;
using System.Web;
using System.Data;
using System.Data.SqlClient;
using MicroPublicHelper;
using MicroDBHelper;
using Newtonsoft.Json.Linq;

public class MicroDataTable : IHttpHandler, System.Web.SessionState.IRequiresSessionState
{

    public void ProcessRequest(HttpContext context)
    {
        context.Response.ContentType = "text/plain";

        string flag = "提交失败,请检查URL参数<br/>The submission failed. Check the URL parameters",
                        Action = context.Server.UrlDecode(context.Request.Form["action"]),
                        MID = context.Server.UrlDecode(context.Request.Form["mid"]),
                        Fields = context.Server.UrlDecode(context.Request.Form["fields"]);

        if (!string.IsNullOrEmpty(Action) && !string.IsNullOrEmpty(MID) && !string.IsNullOrEmpty(Fields))
        {
            if (Action.Trim().ToLower() == "modify")
                flag = CtrlModify(MID.Trim(), Fields.Trim());
        }

        context.Response.Write(flag);

    }

    /// <summary>
    /// 修改字段
    /// </summary>
    /// <param name="MID"></param>
    /// <param name="Fields"></param>
    /// <returns></returns>
    protected string CtrlModify(string MID, string Fields)
    {
        string flag = "保存失败<br/>Save failed", TableName = string.Empty, IDName = string.Empty, IDValue = string.Empty, FieldName = string.Empty, FieldValue = string.Empty, _sql2 = string.Empty;

        try
        {
            dynamic json = JToken.Parse(Fields) as dynamic;
            TableName = json["TableName"];
            IDName = json["IDName"];
            IDValue = json["IDValue"];
            FieldName = json["FieldName"];
            FieldValue = json["FieldValue"];
            FieldValue = FieldValue.toStringTrim();
            TableName = TableName == "mTabs" ? "MicroTables" : "";

            //TableName = "MicroTables";

            _sql2 = "update " + TableName + " set " + FieldName + "=@" + FieldName + " where " + IDName + "=@" + IDName + " ";
            SqlParameter[] _sp2 = new SqlParameter[2];
            //获取字段的类型和长度生成动态的SqlParameter
            switch (FieldName)
            {
后面还有 494 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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