From d6502baa8e5610c04127fbee92ff6111e40956f8 Mon Sep 17 00:00:00 2001
From: yl <ykxkd@outlook.com>
Date: 星期二, 13 六月 2023 09:50:02 +0800
Subject: [PATCH] 生产入库、采购入库接口提交

---
 VueWebApi/Tools/DapperHelper.cs |   61 ++++++++++++++++++++++++++++++
 1 files changed, 61 insertions(+), 0 deletions(-)

diff --git a/VueWebApi/Tools/DapperHelper.cs b/VueWebApi/Tools/DapperHelper.cs
index 37af73e..8554721 100644
--- a/VueWebApi/Tools/DapperHelper.cs
+++ b/VueWebApi/Tools/DapperHelper.cs
@@ -45,6 +45,8 @@
             {
                 try
                 {
+                    //鐢ㄦ埛鎿嶄綔璁板綍鍐欏叆鏁版嵁琛�
+                    //Log4net.LogUtil.SaveMessage("PC", "鎿嶄綔浜唜xxxx", "api/Login/LoginSave", ConfigurationManager.AppSettings["FileIP"], "9999", 1);
                     list = conn.Query<T>(sql, parm).ToList<T>();
                 }
                 catch (Exception ex)
@@ -581,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