Admin/system/!/config/Default.aspx.cs
(完整代码) 1KBusing System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using UAP;
[UAP.Role]
public partial class __config_Default : UAP.UI.ListPage
{
protected override string Table
{
get
{
return "ec_config";
}
}
public string save(List<object> data)
{
DataBase.Transaction();
try
{
foreach (JSON d in data)
{
switch (d.String("_state"))
{
case "added":
d.Only("appid", "appSecret", "mch_id", "key");
d.Add("createid", UAP.Role.Id);
DataBase.Insert("ec_config", true, d);
break;
case "modified":
long id = d.Long("id");
d.Only("appid", "appSecret", "mch_id", "key");
DataBase.Update("ec_config", "id=" + id, d);
break;
case "removed":
DataBase.ExecuteNonQuery("delete from ec_config where id=" + d.Long("id"));
break;
}
}
DataBase.Commit();
return "ok";
}
catch (Exception ex)
{
DataBase.Rollback();
return ex.Message;
}
}
}
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。