From b821703f9879a957937d730e46ed1305b404094e Mon Sep 17 00:00:00 2001 From: ch <37327@LLOOCCY> Date: 星期四, 17 十一月 2022 20:03:37 +0800 Subject: [PATCH] 合并 --- WebAPI/Controllers/BaseSet/Gy_DepartmentController.cs | 15 +++++++++++++-- 1 files changed, 13 insertions(+), 2 deletions(-) diff --git a/WebAPI/Controllers/BaseSet/Gy_DepartmentController.cs b/WebAPI/Controllers/BaseSet/Gy_DepartmentController.cs index 269948f..f314d09 100644 --- a/WebAPI/Controllers/BaseSet/Gy_DepartmentController.cs +++ b/WebAPI/Controllers/BaseSet/Gy_DepartmentController.cs @@ -1,4 +1,5 @@ -锘縰sing Newtonsoft.Json.Linq; +锘縰sing Newtonsoft.Json; +using Newtonsoft.Json.Linq; using Pub_Class; using System; using System.Collections; @@ -29,6 +30,7 @@ { try { + List<object> columnNameList = new List<object>(); //鏌ョ湅鏉冮檺 if (!DBUtility.ClsPub.Security_Log("Gy_Department", 1, false, user)) { @@ -49,10 +51,19 @@ ds = oCN.RunProcReturn(sql, "h_v_IF_DepartmentList"); } + //娣诲姞鍒楀悕 + foreach (DataColumn col in ds.Tables[0].Columns) + { + Type dataType = col.DataType; + string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; + columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕 + } + objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "Sucess锛�"; objJsonResult.data = ds.Tables[0]; + objJsonResult.list = columnNameList; return objJsonResult; } catch (Exception e) @@ -495,7 +506,7 @@ } catch (Exception e) { - oCN.RollBack(); + //oCN.RollBack(); objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "Exception锛�" + e.Message; -- Gitblit v1.9.1