From 9c634fd767aec36ef97c3a814bf7a29c67d20ee1 Mon Sep 17 00:00:00 2001
From: yl <ykxkd@outlook.com>
Date: 星期五, 29 三月 2024 10:57:35 +0800
Subject: [PATCH] 修改单据重复显示问题,增加工单源单id关联
---
VueWebApi/Tools/DapperHelper.cs | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 59 insertions(+), 0 deletions(-)
diff --git a/VueWebApi/Tools/DapperHelper.cs b/VueWebApi/Tools/DapperHelper.cs
index 88ac79e..8554721 100644
--- a/VueWebApi/Tools/DapperHelper.cs
+++ b/VueWebApi/Tools/DapperHelper.cs
@@ -583,5 +583,64 @@
}
return result;
}
+ /// <summary>
+ /// 鎵цsql鎵ц璇彞,杩斿洖瀛楃涓�
+ /// </summary>
+ /// <param name="sql"></param>
+ /// <returns></returns>
+ public static string sqlstr(String sql)
+ {
+
+ string result = "";
+ using (IDbConnection conn = sqlConnection())
+ {
+ try
+ {
+ if (result == "")
+ {
+ result = conn.Query<string>(sql).First();
+ }
+ }
+ catch (Exception ex)
+ {
+ //鍒涘缓鏃ュ織璁板綍缁勪欢瀹炰緥
+ LogHelper.WriteLog(ex);
+ throw ex;
+ }
+ finally
+ {
+ conn.Dispose();
+ conn.Close();
+ }
+ }
+ return result;
+ }
+
+ public static DataTable lissql(string sql)
+ {
+ //sql璇彞
+ using (IDbConnection conn = sqlConnection())
+ {
+ try
+ {
+ DataTable table = new DataTable();
+ //var data = conn.ExecuteReader(sql, parm);
+ var res = conn.ExecuteReader(sql);//sql 瀛樺偍杩囩▼
+ table.Load(res);
+ return table;
+ }
+ catch (Exception ex)
+ {
+ //鍒涘缓鏃ュ織璁板綍缁勪欢瀹炰緥
+ LogHelper.WriteLog(ex);
+ throw ex;
+ }
+ finally
+ {
+ conn.Dispose();
+ conn.Close();
+ }
+ }
+ }
}
}
\ No newline at end of file
--
Gitblit v1.9.3