chore: 初始化东安动力外部数据接口工程

This commit is contained in:
yexingqiang
2026-05-29 13:57:08 +08:00
commit aa6841144a
201 changed files with 14427 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
using DatabaseClient;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SlMesDbIterface
{
public class solveUploadData {
public static DataTable GetUpLoadData(int dataType, string tableName, out string erorrMessage)
{
erorrMessage = "";
DataTable dt = new DataTable();
var dbClient = new DBClientFactory("mysql").Create();
dbClient.Connect(Program.MySqlConnectString);
try
{
string sql = "select * from " + tableName + " WHERE S001 = '" + dataType.ToString() + "' AND S028 = '0' order by S029 DESC limit 10";
dt = dbClient.ExecQuery(sql);
}
catch (Exception err)
{
erorrMessage = err.Message;
}
return dt;
}
public static void UpDateUpLoadData(int id, string tableName, string resCode, string resMsg)
{
var dbClient = new DBClientFactory("mysql").Create();
dbClient.Connect(Program.MySqlConnectString);
try
{
string sql = "update " + tableName + " set S028 = '" + resCode
+ "', S029 = '" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "', S030 = '" + resMsg + "'"
+ " WHERE id = '" + id.ToString() + "'";
dbClient.ExecNonQuery(sql);
}
catch (Exception err)
{
}
}
}
}