From 4c5ff8c2bf65237b9200c5279c4f158c938806da Mon Sep 17 00:00:00 2001 From: yangle <admin@YINMOU> Date: 星期二, 01 十一月 2022 10:26:17 +0800 Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API --- WebAPI/Controllers/BaseSet/Gy_CurrencyController.cs | 41 ++++++++++++++++------------------------- 1 files changed, 16 insertions(+), 25 deletions(-) diff --git a/WebAPI/Controllers/BaseSet/Gy_CurrencyController.cs b/WebAPI/Controllers/BaseSet/Gy_CurrencyController.cs index ee62268..997909f 100644 --- a/WebAPI/Controllers/BaseSet/Gy_CurrencyController.cs +++ b/WebAPI/Controllers/BaseSet/Gy_CurrencyController.cs @@ -45,39 +45,30 @@ if (sWhere == null || sWhere.Equals("")) { - ds = oCN.RunProcReturn("select * from h_v_Gy_CurrencyList where 绂佺敤鏍囪=''" + sWhere+ " order by 璐у竵浠g爜", "h_v_Gy_CurrencyList"); + ds = oCN.RunProcReturn("select * from h_v_Gy_CurrencyList where 绂佺敤鏍囪=''" + sWhere + " order by 璐у竵浠g爜", "h_v_Gy_CurrencyList"); } else { string sql1 = "select * from h_v_Gy_CurrencyList where 绂佺敤鏍囪='' "; - string sql = sql1 + sWhere+ " order by 璐у竵浠g爜"; + string sql = sql1 + sWhere + " order by 璐у竵浠g爜"; ds = oCN.RunProcReturn(sql, "h_v_Gy_CurrencyList"); } - if (ds == null || ds.Tables[0].Rows.Count == 0) - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "false锛�"; - objJsonResult.data = null; - return objJsonResult; - } - else - { - //娣诲姞鍒楀悕 - 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; + + //娣诲姞鍒楀悕 + 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) { -- Gitblit v1.9.1